Commit 3798fe32 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1398 It's actually not possible to use a define inside a macro (see...

#1398 It's actually not possible to use a define inside a macro (see https://stackoverflow.com/questions/7246512/ifdef-inside-a-macro). I therefore had to duplicate the macro for the clang and not clang cases... (using a middleman macro didn't work as the warnings about macro recursion popped up - the very same for which I had to disambiguate clang and gcc in the first place in the macro...)
parent 8cf96579
Pipeline #73444 passed with stages
in 22 minutes and 16 seconds
......@@ -14,12 +14,19 @@
# include <memory>
# include <vector>
//! Convenient macro for testing operators that acts upon both scalar and vectorial unknowns.
#define TEST_VARIATIONAL_OPERATOR \
/*!
* \class doxygen_hide_TEST_VARIATIONAL_OPERATOR
*
* \brief Convenient macro for testing operators that acts upon both scalar and vectorial unknowns.
* It's ugly as the code is duplicated just to ignore a pragma only for clang compiler, but I can't
* use something else than the macro I despised as Boost test is itself relying heavily on them.
*/
# ifdef __clang__
//! \copydoc doxygen_hide_TEST_VARIATIONAL_OPERATOR
# define TEST_VARIATIONAL_OPERATOR \
PRAGMA_DIAGNOSTIC(push) \
#ifdef __clang__ \
PRAGMA_DIAGNOSTIC(ignored "-Wdisabled-macro-expansion") \
#endif \
\
BOOST_FIXTURE_TEST_SUITE(same_unknown_for_test, fixture_type) \
\
......@@ -57,5 +64,43 @@ BOOST_AUTO_TEST_SUITE_END() \
PRAGMA_DIAGNOSTIC(pop)
# else // __clang__
//! \copydoc doxygen_hide_TEST_VARIATIONAL_OPERATOR
# define TEST_VARIATIONAL_OPERATOR \
BOOST_FIXTURE_TEST_SUITE(same_unknown_for_test, fixture_type) \
\
BOOST_AUTO_TEST_CASE(p1_scalar_same) \
{ \
GetModel().SameUnknownP1(UnknownNS::Nature::scalar); \
} \
\
BOOST_AUTO_TEST_CASE(p1_vectorial_same) \
{ \
GetModel().SameUnknownP1(UnknownNS::Nature::vectorial); \
} \
\
BOOST_AUTO_TEST_CASE(p2_scalar_same) \
{ \
GetModel().SameUnknownP2(); \
} \
\
BOOST_AUTO_TEST_SUITE_END() \
\
BOOST_FIXTURE_TEST_SUITE(different_unknown, fixture_type) \
\
BOOST_AUTO_TEST_CASE(p1_scalar_same) \
{ \
GetModel().UnknownP1TestP1(); \
} \
\
BOOST_AUTO_TEST_CASE(unknown_p2_test_p1) \
{ \
GetModel().UnknownP2TestP1(); \
} \
\
BOOST_AUTO_TEST_SUITE_END()
# endif // __clang__
#endif // MOREFEM_x_TEST_x_TOOLS_x_MACRO_VARIATIONAL_OPERATOR_HPP_
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment