12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #include <stdio.h>
- #include <time.h>
- /*
- * hello.c
- */
- #define NDEBUG
- #ifdef MDEBUG
- #define TEST_LOG(format, ...) fprintf(stderr, format, ##__VA_ARGS__)
- #else
- #define TEST_LOG(format, ...) fprintf(stderr, format);
- #endif
- #define CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS
- #define CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS
- #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \
- void TestName()
- // CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \
- // namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); } /* NOLINT */ \
- // CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \
- // static void TestName()
- #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
- #define INTERNAL_CATCH_TESTCASE( ... ) \
- INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ )
- #define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
- #define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
- #define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
- int test()
- {
- int num = 2;
- TEST_LOG("my num is 1");
- return num;
- }
- int main(void) {
- printf("Hello World!\n");
- printf("long lenth = %d, int lenth = %d\n", sizeof(long), sizeof(int));
- int a;
- long b;
- printf("a = %d\n", a);
- printf("b = %d\n", b);
- TEST_CASE("test");
- printf("----------ok----------\n");
- return 0;
- }
|