Skip to content

Commit

Permalink
update r830
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Apr 24, 2015
1 parent aab1cbc commit 26a9071
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CommonMakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ TARGETS_IUTEST_ONLY = \
iutest_filter_file_syntax_tests \
iutest_filter_file_tests \
iutest_ostream_formatter_tests \
iutest_output_tests \
iutest_output_xml_invalid_path_tests \
iutest_tap_file_generator_listener_tests \
iutest_tap_printer_listener_tests \
Expand Down
52 changes: 52 additions & 0 deletions test/iutest_output_tests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//======================================================================
//-----------------------------------------------------------------------
/**
* @file iutest_output_tests.cpp
* @brief 出力テスト
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2015, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
//-----------------------------------------------------------------------
//======================================================================

//======================================================================
// include
#include "iutest.hpp"
#include "internal/iutest_log_stream.hpp"
#include "iutest_logger_tests.hpp"

TestLogger logger;

IUTEST(LoggerTest, Output)
{
logger.clear();
logger.output("%d", 1);

IUTEST_EXPECT_STREQ("1", logger.c_str());
}

IUTEST(LogStreamTest, Write)
{
logger.clear();
::iutest::detail::LogStream stream;
const char text[] = "test text";
stream.Write(text, sizeof(text), 1);

IUTEST_EXPECT_STREQ(text, logger.c_str());
}

#ifdef UNICODE
int wmain(int argc, wchar_t* argv[])
#else
int main(int argc, char* argv[])
#endif
{
::iutest::detail::iuConsole::SetLogger(&logger);
IUTEST_INIT(&argc, argv);
return IUTEST_RUN_ALL_TESTS();
}

16 changes: 16 additions & 0 deletions test/iutest_printers_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ IUTEST(PrintToTest, Bar)
IUTEST_SUCCEED() << ::iutest::PrintToString(bar);
}

struct BigVar
{
int big[10];
operator ::iutest::BiggestInt () const
{
return 42;
}
};

IUTEST(PrintToTest, BigVar)
{
BigVar bigvar;
LogChecker ck("42");
IUTEST_SUCCEED() << ::iutest::PrintToString(bigvar);
}

#if IUTEST_HAS_TYPED_TEST

template<typename T>
Expand Down

0 comments on commit 26a9071

Please sign in to comment.