X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Funittest.cc;h=e35911bf537ffc23598cc190f52045c124424584;hb=543d6be67139ee7cb47c0c8e7d383743f4e68857;hp=75b41f70d941046db92d03b4b54fa9a87a429efe;hpb=293e7b59e12ff6b95b5463614b09bc0158f14592;p=awesomized%2Flibmemcached diff --git a/libtest/unittest.cc b/libtest/unittest.cc index 75b41f70..e35911bf 100644 --- a/libtest/unittest.cc +++ b/libtest/unittest.cc @@ -143,10 +143,7 @@ static test_return_t test_throw_skip_TEST(void *) static test_return_t test_throw_fail_TEST(void *) { try { -#if 0 FAIL("test message!"); -#endif - throw libtest::__failure(LIBYATL_DEFAULT_PARAM, "test message!"); } catch (const libtest::__failure& e) { @@ -168,10 +165,9 @@ static test_return_t ASSERT_FALSE__TEST(void *) try { ASSERT_FALSE_(true, __func__); } - catch (libtest::__failure e) + catch (const libtest::__failure& e) { - std::string compare_message(__func__); - ASSERT_EQ(compare_message.compare(e.what()), -32); + ASSERT_STREQ(e.what(), "Assertion '!true' [ ASSERT_FALSE__TEST ]"); return TEST_SUCCESS; } catch (...) @@ -187,10 +183,9 @@ static test_return_t ASSERT_FALSE_TEST(void *) try { FAIL(__func__); } - catch (libtest::__failure e) + catch (const libtest::__failure& e) { - std::string compare_message(__func__); - ASSERT_EQ(0, compare_message.compare(e.what())); + ASSERT_STREQ(e.what(), __func__); return TEST_SUCCESS; } catch (...)