Beispiel #1
0
IUTEST(SyntaxTest, NotNull)
{
    if( void* p = this )
        IUTEST_ASSERT_NOTNULL(p) << p;
    if( void* p = this )
        IUTEST_EXPECT_NOTNULL(p) << p;
    if( void* p = this )
        IUTEST_INFORM_NOTNULL(p) << p;
    if( void* p = this )
        IUTEST_ASSUME_NOTNULL(p) << p;
}
Beispiel #2
0
int main(int argc, char* argv[])
#endif
{
    IUTEST_INIT(&argc, argv);
#if defined(OUTPUTXML)
    // 実行対象テストがないので xml 出力しない
    ::iutest::IUTEST_FLAG(output) = NULL;
#endif

#if !defined(IUTEST_USE_GTEST)
    TestLogger logger;
    ::iutest::detail::iuConsole::SetLogger(&logger);
#endif

    ::iutest::TestEventListener* listener = ::iuutil::QuietResultPrinter::SetUp();
#if IUTEST_HAS_ASSERTION_RETURN
    IUTEST_ASSERT_NOTNULL( listener ) << ::iutest::AssertionReturn<int>(1);
#else
    if( listener == NULL ) return 1;
#endif

    if( IUTEST_RUN_ALL_TESTS() == 0 ) return 1;
#if !defined(IUTEST_USE_GTEST) && IUTEST_HAS_ASSERTION_RETURN
    IUTEST_ASSERT_STRNOTIN("[       OK ]", logger.c_str()) << ::iutest::AssertionReturn<int>(1);
    IUTEST_ASSERT_STRIN   ("[  FAILED  ]", logger.c_str()) << ::iutest::AssertionReturn<int>(1);
#endif

    {
        ::iutest::TestEventListeners& listeners = ::iutest::UnitTest::GetInstance()->listeners();
        delete listeners.Release(listener);
    }

    listener = ::iuutil::QuietResultPrinter::SetUp();
#if IUTEST_HAS_ASSERTION_RETURN
    IUTEST_ASSERT_NULL( listener ) << ::iutest::AssertionReturn<int>(1);
#else
    if( listener != NULL ) return 1;
#endif

    printf("*** Successful ***\n");
    return 0;
}