Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Aug 20, 2020
1 parent d507c65 commit 00ba0cd
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
2 changes: 2 additions & 0 deletions include/internal/iutest_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@
* @brief Test class defined macro
*/
#define IUTEST_TEST_(testsuite_, testname_, parent_class_, type_id_) \
IUTEST_STATIC_ASSERT_MSG(sizeof(IUTEST_PP_TOSTRING(testsuite_)) > 1, "testsuite_ must not be empty"); \
IUTEST_STATIC_ASSERT_MSG(sizeof(IUTEST_PP_TOSTRING(testname_)) > 1, "testname_ must not be empty"); \
class IUTEST_TEST_CLASS_NAME_(testsuite_, testname_) : public parent_class_ { \
IUTEST_PP_DISALLOW_COPY_AND_ASSIGN(IUTEST_TEST_CLASS_NAME_(testsuite_, testname_)); \
public: IUTEST_TEST_CLASS_NAME_(testsuite_, testname_)() {} \
Expand Down
27 changes: 10 additions & 17 deletions test/empty_testname_failure_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

// ill-formed test definitions..

IUTEST_TEST_STATICASSERT("static_assert: testsuite_ must not be empty")
IUTEST_TEST_STATICASSERT("testsuite_ must not be empty")
IUTEST(, Test)
{
}

IUTEST_TEST_STATICASSERT("static_assert: testname_ must not be empty")
IUTEST_TEST_STATICASSERT("testname_ must not be empty")
IUTEST(Test, )
{
}
Expand All @@ -33,37 +33,30 @@ class BaseFixture : public ::iutest::Test
{
};

IUTEST_TEST_STATICASSERT("static_assert: testname_ must not be empty")
IUTEST_TEST_STATICASSERT("testname_ must not be empty")
IUTEST_F(BaseFixture, )
{
}

#if IUTEST_HAS_TESTFIXTURE_ALIAS_BY_TUPLE
namespace fixture_alias
{

IUTEST_TEST_STATICASSERT("static_assert: testsuite_ must not be empty")
IUTEST_F((, BaseFixture), Test)
IUTEST_TEST_STATICASSERT("testsuite_ must not be empty")
IUTEST_F(, Test)
{
}

}
#endif

#if IUTEST_HAS_TYPED_TEST_P

template<typename T>
class TypeParamTest : public ::iutest::Test {};

IUTEST_TYPED_TEST_SUITE_P(TypeParamTest);
IUTEST_TEST_STATICASSERT("static_assert: testname_ must not be empty")
IUTEST_TEST_STATICASSERT("testname_ must not be empty")
IUTEST_TYPED_TEST_P(TypeParamTest, )
{
}
IUTEST_REGISTER_TYPED_TEST_SUITE_P(TypeParamTest, );

typedef ::iutest::Types<int, float> TypeParamTestTypes;
IUTEST_INSTANTIATE_TYPED_TEST_SUITE_P(My1, TypeParamTest, TypeParamTestTypes);
IUTEST_TEST_STATICASSERT("testsuite_ must not be empty")
IUTEST_TYPED_TEST_P(, Test)
{
}

#endif

Expand Down
15 changes: 15 additions & 0 deletions test/empty_testname_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@

// well-formed test definitions..

class BaseFixture : public ::iutest::Test
{
};

#if IUTEST_HAS_TESTFIXTURE_ALIAS_BY_TUPLE
namespace fixture_alias
{

IUTEST_F((, BaseFixture), Test)
{
}

}
#endif

#if IUTEST_HAS_PARAM_TEST

class ParamTest : public ::iutest::TestWithParam<int> {};
Expand Down
2 changes: 1 addition & 1 deletion test/static_assertion_failure_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2015-2016, Takazumi Shirayanagi\n
* Copyright (C) 2015-2020, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
Expand Down
1 change: 0 additions & 1 deletion tools/python/iutest_compile_error_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ def message(self):
if msg:
msg.message += '\n'
msg.message += line
print('%s - %d' % (msg.file, msg.line))
msg_list.append(msg)
return msg_list

Expand Down

0 comments on commit 00ba0cd

Please sign in to comment.