Skip to content

Commit

Permalink
update r737
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Nov 5, 2014
1 parent 4b7c43d commit d0ef566
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 16 deletions.
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ install:
# lcov
- if [ "${USE_COVERAGE}" = 'lcov' ]; then sudo apt-get install lcov rubygems; fi
- if [ "${USE_COVERAGE}" = 'lcov' ]; then gem install lcoveralls; fi
# gtest
- if [ "${USE_GTEST}" = '1' ]; then sudo apt-get -qq install cmake; fi
- if [ "${USE_GTEST}" = '1' ]; then sudo apt-get -qq install libgtest-dev; fi
- if [ "${USE_GTEST}" = '1' ]; then "cd /usr/src/gtest && sudo cmake . && sudo cmake --build . && sudo mv libg* /usr/local/lib/ ; cd -"; fi

script:
- cd ./test
Expand Down Expand Up @@ -65,8 +61,6 @@ matrix:
env: USE_FUSE=fuse_min
- compiler: gcc
env: USE_FUSE=fuse_min STDFLAG=-std=c++98
- compiler: gcc
env: USE_GTEST=1
- compiler: gcc
env: COVERITY_SCAN=1
addons:
Expand Down
2 changes: 1 addition & 1 deletion doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = iutest
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.10.99.35
PROJECT_NUMBER = 1.10.99.36

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 2 additions & 0 deletions include/internal/iutest_file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_END()
*/
class StringStreamFile : public IFile
{
public:
virtual ~StringStreamFile(void) { Close(); }
public:
/**
* @brief 開く
Expand Down
11 changes: 10 additions & 1 deletion include/iutest_matcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,17 @@ inline iu_ostream& operator << (iu_ostream& os, const IMatcher& msg)
}


IUTEST_PARGMA_WARN_PUSH()
IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE()

DECL_COMPARE_MATCHER(Ne, !=);
DECL_COMPARE_MATCHER(Le, <=);
DECL_COMPARE_MATCHER(Lt, < );
DECL_COMPARE_MATCHER(Ge, >=);
DECL_COMPARE_MATCHER(Gt, > );

IUTEST_PARGMA_WARN_POP()

#undef DECL_COMPARE_MATCHER

#define DECL_STR_COMPARE_MATCHER(name) \
Expand Down Expand Up @@ -429,10 +434,14 @@ class EqMatcher : public IMatcher
return strm.str();
}
private:

template<typename A, typename B>
static bool Equals(const A& actual, const B& expected)
{
IUTEST_PARGMA_WARN_PUSH()
IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE()
return actual == expected;
IUTEST_PARGMA_WARN_POP()
}
static bool Equals(const char* actual, const char* expected)
{
Expand Down Expand Up @@ -461,7 +470,7 @@ template<typename T>
class TypedEqMatcher : public EqMatcher<T>
{
public:
TypedEqMatcher(T expected) : m_expected(expected), EqMatcher<T>(m_expected) {}
TypedEqMatcher(T expected) : EqMatcher<T>(m_expected), m_expected(expected) {}
public:
AssertionResult operator ()(const T& actual)
{
Expand Down
4 changes: 2 additions & 2 deletions include/iutest_ver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

//======================================================================
// define
#define IUTEST_VER 0x01109935u //!< iutest version 1.10.99.35
#define IUTEST_VER 0x01109936u //!< iutest version 1.10.99.36
#define IUTEST_MAJORVER 0x01u //!< Major Version
#define IUTEST_MINORVER 0x10u //!< Minor Version
#define IUTEST_BUILD 0x99u //!< Build
#define IUTEST_REVISION 0x35u //!< Revision
#define IUTEST_REVISION 0x36u //!< Revision

/**
* @mainpage
Expand Down
4 changes: 2 additions & 2 deletions samples/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
*//*--------------------------------------------------*/
class FooEnvironment : public ::iutest::Environment
{
virtual void SetUp(void)
virtual void SetUp(void)
{
iuutil::Console::output("FooEnvironment::SetUp\n");
}
virtual void TearDown(void)
virtual void TearDown(void)
{
iuutil::Console::output("FooEnvironment::TearDown\n");
}
Expand Down
2 changes: 0 additions & 2 deletions samples/matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ IUTEST(Matcher, AllOf)
IUTEST(Matcher, AnyOf)
{
int a[3] ={ 0, -1, 10 };
int b=1;
int c=1;
IUTEST_EXPECT_THAT("hoge", AnyOf(StartsWith("Ho"), EndsWith("ge")));
IUTEST_EXPECT_THAT(a, Each(AnyOf(Le(0), Ge(10))));
}
Expand Down
18 changes: 16 additions & 2 deletions test/iutest_quiet_result_printer_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,31 @@ int main(int argc, char* argv[])
::iutest::detail::iuConsole::SetLogger(&logger);
#endif

::iutest::TestEventListener* listener = ::iuutil::QuietResultPrinter::SetUp();
#if IUTEST_HAS_ASSERTION_RETURN
IUTEST_ASSERT_NOTNULL( ::iuutil::QuietResultPrinter::SetUp() ) << ::iutest::AssertionReturn<int>(1);
IUTEST_ASSERT_NOTNULL( listener ) << ::iutest::AssertionReturn<int>(1);
#else
if( ::iuutil::QuietResultPrinter::SetUp() == NULL ) return 1;
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;
}

0 comments on commit d0ef566

Please sign in to comment.