15 #ifndef INCG_IRIS_IUTEST_LEGACY_HPP_E7B75232_2AB9_44F5_B9C5_CF62CD3FF958_
16 #define INCG_IRIS_IUTEST_LEGACY_HPP_E7B75232_2AB9_44F5_B9C5_CF62CD3FF958_
22 #if IUTEST_HAS_TESTCASE
24 #if IUTEST_HAS_PARAM_TEST
25 # define IUTEST_INSTANTIATE_TEST_CASE_P IUTEST_INSTANTIATE_TEST_SUITE_P
27 #if IUTEST_HAS_ANY_PARAM_TEST
28 # define IUTEST_INSTANTIATE_TEST_CASE_AP IUTEST_INSTANTIATE_TEST_SUITE_AP
30 #if IUTEST_HAS_TYPED_TEST
31 # define IUTEST_TYPED_TEST_CASE IUTEST_TYPED_TEST_SUITE
32 # define IUTEST_VALUETMP_TEST_CASE IUTEST_VALUETMP_TEST_SUITE
34 #if IUTEST_HAS_TYPED_TEST_P
35 # define IUTEST_TYPED_TEST_CASE_P IUTEST_TYPED_TEST_SUITE_P
36 # define IUTEST_INSTANTIATE_TYPED_TEST_CASE_P IUTEST_INSTANTIATE_TYPED_TEST_SUITE_P
37 # define IUTEST_REGISTER_TYPED_TEST_CASE_P IUTEST_REGISTER_TYPED_TEST_SUITE_P
46 typedef TestSuite TestCase;
51 ::std::string FormatCompilerIndependentFileLocation(
const char* file,
int line);
58 typedef void (*SetUpTearDownTestSuiteFuncType)();
60 inline SetUpTearDownTestSuiteFuncType GetNotDefaultOrNull(SetUpTearDownTestSuiteFuncType a, SetUpTearDownTestSuiteFuncType def)
62 return a == def ? NULL : a;
66 struct SuiteApiResolver : T
68 typedef typename iutest_type_traits::enable_if<
sizeof(T) != 0, ::
iutest::Test>::type
Tester;
70 static SetUpTearDownTestSuiteFuncType GetSetUpCaseOrSuite(
const char* file,
int line)
72 SetUpTearDownTestSuiteFuncType testcase = GetNotDefaultOrNull(&T::SetUpTestCase, &Tester::SetUpTestCase);
73 SetUpTearDownTestSuiteFuncType testsuite = GetNotDefaultOrNull(&T::SetUpTestSuite, &
Tester::SetUpTestSuite);
76 <<
"Test can not provide both SetUpTestSuite and SetUpTestCase, please make sure there is only one present at "
77 << detail::FormatCompilerIndependentFileLocation(file, line);
79 return testcase != NULL ? testcase : testsuite;
81 static SetUpTearDownTestSuiteFuncType GetTearDownCaseOrSuite(
const char* file,
int line)
83 SetUpTearDownTestSuiteFuncType testcase = GetNotDefaultOrNull(&T::TearDownTestCase, &Tester::TearDownTestCase);
87 <<
"Test can not provide both TearDownTestSuite and TearDownTestCase, please make sure there is only one present at "
88 << detail::FormatCompilerIndependentFileLocation(file, line);
90 return testcase != NULL ? testcase : testsuite;
97 #define IUTEST_GET_SETUP_TESTSUITE(type, file, line) ::iutest::legacy::SuiteApiResolver<type>::GetSetUpCaseOrSuite(file, line)
98 #define IUTEST_GET_TEARDOWN_TESTSUITE(type, file, line) ::iutest::legacy::SuiteApiResolver<type>::GetTearDownCaseOrSuite(file, line)
102 #define IUTEST_GET_SETUP_TESTSUITE(type, file, line) ((void)(file), (void)(line), type::SetUpTestSuite)
103 #define IUTEST_GET_TEARDOWN_TESTSUITE(type, file, line) ((void)(file), (void)(line), type::TearDownTestSuite)
テストベース
Definition: iutest_body.hpp:44
static void TearDownTestSuite()
test suite tear down
Definition: iutest_body.hpp:173
static void SetUpTestSuite()
test suite setup
Definition: iutest_body.hpp:172
#define IUTEST_CHECK_(condition)
内部エラーチェック
Definition: iutest_port.hpp:63
iutest root namespace
Definition: iutest_charcode.hpp:33