1 #include "UnitTest++/UnitTestPP.h" 2 #include "UnitTest++/CurrentTest.h" 3 #include "ScopedCurrentTest.h" 4 5 namespace 6 { 7 TEST(CanSetandGetDetails)8TEST(CanSetandGetDetails) 9 { 10 bool ok = false; 11 { 12 ScopedCurrentTest scopedTest; 13 14 const UnitTest::TestDetails* details = reinterpret_cast< const UnitTest::TestDetails* >(12345); 15 UnitTest::CurrentTest::Details() = details; 16 17 ok = (UnitTest::CurrentTest::Details() == details); 18 } 19 20 CHECK(ok); 21 } 22 TEST(CanSetAndGetResults)23TEST(CanSetAndGetResults) 24 { 25 bool ok = false; 26 { 27 ScopedCurrentTest scopedTest; 28 29 UnitTest::TestResults results; 30 UnitTest::CurrentTest::Results() = &results; 31 32 ok = (UnitTest::CurrentTest::Results() == &results); 33 } 34 35 CHECK(ok); 36 } 37 38 } 39