Debian Codegraph @

tests/src/test_amdpmauto.cpp

raw symbols SCIP
1 // SPDX-License-Identifier: GPL-3.0-or-later
2 // Copyright 2019 Juan Palacios <[email protected]>
3
4 #include <catch2/catch_all.hpp>
5 #include <catch2/trompeloeil.hpp>
6
7 #include "common/commandqueuestub.h"
8 #include "core/components/controls/amd/pm/auto/pmauto.h"
9
10 extern template struct trompeloeil::reporter<trompeloeil::specialized>;
11
12 namespace Tests::AMD::PMAuto {
13
14 class PMAutoTestAdapter : public ::AMD::PMAuto
15 {
16 public:
17 MAKE_MOCK1(cleanControl, void(ICommandQueue &), override);
18 MAKE_MOCK1(syncControl, void(ICommandQueue &), override);
19 };
20
21 TEST_CASE("AMD PMAuto tests", "[GPU][AMD][PM][PMAuto]")
22 {
23 PMAutoTestAdapter ts;
24
25 SECTION("Has PMAuto ID")
26 {
27 REQUIRE(ts.ID() == ::AMD::PMAuto::ItemID);
28 }
29
30 SECTION("Is active by default")
31 {
32 REQUIRE(ts.active());
33 }
34
35 SECTION("Does not generate pre-init control commands")
36 {
37 CommandQueueStub cmds;
38 ts.preInit(cmds);
39 REQUIRE(cmds.commands().empty());
40 }
41
42 SECTION("Does not generate post-init control commands")
43 {
44 CommandQueueStub cmds;
45 ts.postInit(cmds);
46 REQUIRE(cmds.commands().empty());
47 }
48 }
49
50 } // namespace Tests::AMD::PMAuto