Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the new MSVC preprocessor #1734

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use _MSVC_TRADITIONAL instead of _MSC_VER
abrauninger committed Nov 30, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 02aee02c0eb4a2eb8b94ad73a75b4cb6f9ffd55b
4 changes: 2 additions & 2 deletions Release/tests/common/UnitTestpp/src/CheckMacros.h
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@
#error UnitTest++ redefines VERIFY_IS_NULL
#endif

#if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER < 1926)
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
#define VERIFY_IS_TRUE(expression, ...) CHECK_EQUAL(true, expression, __VA_ARGS__)
#define VERIFY_IS_FALSE(expression, ...) CHECK_EQUAL(false, expression, __VA_ARGS__)
#define VERIFY_ARE_NOT_EQUAL(expected, actual, ...) CHECK_NOT_EQUAL(expected, actual, __VA_ARGS__)
@@ -118,7 +118,7 @@
UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), #value); \
UNITTEST_MULTILINE_MACRO_END

#if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER < 1926)
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL

#define CHECK_EQUAL(expected, actual, ...) \
do \
8 changes: 4 additions & 4 deletions Release/tests/common/UnitTestpp/src/TestMacros.h
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ extern "C" _DLL_EXPORT TestList& __cdecl GetTestList();
} \
namespace Suite##Name

#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1926)
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
#define TEST_EX(Name, List, ...) \
class Test##Name : public UnitTest::Test \
{ \
@@ -124,13 +124,13 @@ extern "C" _DLL_EXPORT TestList& __cdecl GetTestList();
void Test##Name::RunImpl() const
#endif

#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1926)
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
#define TEST(Name, ...) TEST_EX(Name, UnitTest::GetTestList(), __VA_ARGS__)
#else
#define TEST(Name, ...) TEST_EX(Name, UnitTest::GetTestList(), ##__VA_ARGS__)
#endif

#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1926)
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
#define TEST_FIXTURE_EX(Fixture, Name, List, ...) \
class Fixture##Name##Helper : public Fixture \
{ \
@@ -242,7 +242,7 @@ extern "C" _DLL_EXPORT TestList& __cdecl GetTestList();
void Fixture##Name##Helper::RunImpl()
#endif

#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1926)
#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
#define TEST_FIXTURE(Fixture, Name, ...) TEST_FIXTURE_EX(Fixture, Name, UnitTest::GetTestList(), __VA_ARGS__)
#else
#define TEST_FIXTURE(Fixture, Name, ...) TEST_FIXTURE_EX(Fixture, Name, UnitTest::GetTestList(), ##__VA_ARGS__)