57 lines
1.1 KiB
C++
Raw Normal View History

2013-11-03 12:27:13 +02:00
#ifndef TEST_DEFINE
2018-08-09 18:06:22 +02:00
# error Expected definition TEST_DEFINE
2013-11-03 12:27:13 +02:00
#endif
#ifndef NEEDS_ESCAPE
2018-08-09 18:06:22 +02:00
# error Expected definition NEEDS_ESCAPE
2013-11-03 12:27:13 +02:00
#endif
#ifdef DO_GNU_TESTS
2018-08-09 18:06:22 +02:00
# ifndef TEST_DEFINE_GNU
# error Expected definition TEST_DEFINE_GNU
# endif
2016-07-09 11:21:54 +02:00
#endif
2018-08-09 18:06:22 +02:00
#ifndef NO_DEF_TESTS
# ifndef DEF_A
# error Expected definition DEF_A
# endif
# ifndef DEF_B
# error Expected definition DEF_B
# endif
# ifndef DEF_C
# error Expected definition DEF_C
# endif
# ifndef DEF_D
# error Expected definition DEF_D
# endif
# ifndef DEF_STR
# error Expected definition DEF_STR
# endif
2013-11-03 12:27:13 +02:00
#endif
#include <string.h>
int main()
{
return (strcmp(NEEDS_ESCAPE, "E$CAPE") == 0
2015-04-27 22:25:09 +02:00
#ifdef TEST_OCTOTHORPE
2016-07-09 11:21:54 +02:00
&& strcmp(TEST_OCTOTHORPE, "#") == 0
2018-08-09 18:06:22 +02:00
#endif
#ifndef NO_DEF_TESTS
&& strcmp(DEF_STR, "string with spaces") == 0
2015-04-27 22:25:09 +02:00
#endif
2016-07-09 11:21:54 +02:00
&&
strcmp(EXPECTED_C_COMPILER_VERSION, TEST_C_COMPILER_VERSION) == 0 &&
strcmp(EXPECTED_CXX_COMPILER_VERSION, TEST_CXX_COMPILER_VERSION) ==
0 &&
TEST_C_COMPILER_VERSION_EQUALITY == 1 &&
TEST_CXX_COMPILER_VERSION_EQUALITY == 1)
? 0
: 1;
2013-11-03 12:27:13 +02:00
}