File tree Expand file tree Collapse file tree 2 files changed +4
-22
lines changed Expand file tree Collapse file tree 2 files changed +4
-22
lines changed Original file line number Diff line number Diff line change @@ -33,26 +33,13 @@ extern bool getDevicesResult;
33
33
34
34
struct PlatformNegativeTest : public ::testing::Test {
35
35
void SetUp () override {
36
- pPlatform = platform ( );
36
+ pPlatform. reset ( new Platform () );
37
37
}
38
38
39
- Platform * pPlatform = nullptr ;
39
+ std::unique_ptr< Platform> pPlatform;
40
40
};
41
41
42
42
TEST_F (PlatformNegativeTest, GivenPlatformWhenGetDevicesFailedThenFalseIsReturned) {
43
- class PlatformShutdown {
44
- public:
45
- PlatformShutdown (Platform *pPlatform) : pPlatform(pPlatform) {
46
- pPlatform->shutdown ();
47
- }
48
- ~PlatformShutdown () {
49
- pPlatform->shutdown ();
50
- }
51
-
52
- protected:
53
- Platform *pPlatform = nullptr ;
54
- } a (pPlatform);
55
-
56
43
VariableBackup<decltype (getDevicesResult)> bkp (&getDevicesResult, false );
57
44
58
45
auto ret = pPlatform->initialize ();
Original file line number Diff line number Diff line change 34
34
using namespace OCLRT ;
35
35
36
36
struct PlatformTest : public ::testing::Test {
37
- PlatformTest () {}
38
-
39
- void SetUp () override { pPlatform = platform (); }
40
-
41
- void TearDown () override {}
42
-
37
+ void SetUp () override { pPlatform.reset (new Platform ()); }
43
38
cl_int retVal = CL_SUCCESS;
44
- Platform * pPlatform = nullptr ;
39
+ std::unique_ptr< Platform> pPlatform;
45
40
};
46
41
47
42
TEST_F (PlatformTest, getDevices) {
You can’t perform that action at this time.
0 commit comments