X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Funittest.cc;h=b96fea06486a311b6e00744b065dd02568c16448;hb=673be386d6ae670d3c62051b10e7f57719338595;hp=b3e90c79dcdb7d927ef57c7678f0b6546f83260e;hpb=381d409b224ca3b4510e770a98bc960084cdf2c4;p=m6w6%2Flibmemcached diff --git a/libtest/unittest.cc b/libtest/unittest.cc index b3e90c79..b96fea06 100644 --- a/libtest/unittest.cc +++ b/libtest/unittest.cc @@ -111,7 +111,7 @@ static test_return_t test_throw_success_TEST(void *) try { _SUCCESS; } - catch (libtest::__success) + catch (const libtest::__success&) { return TEST_SUCCESS; } @@ -128,7 +128,7 @@ static test_return_t test_throw_skip_macro_TEST(void *) try { SKIP_IF(true); } - catch (libtest::__skipped e) + catch (const libtest::__skipped&) { return TEST_SUCCESS; } @@ -147,7 +147,7 @@ static test_return_t test_throw_skip_TEST(void *) try { throw libtest::__skipped(LIBYATL_DEFAULT_PARAM, "basic test"); } - catch (libtest::__skipped e) + catch (const libtest::__skipped&) { return TEST_SUCCESS; } @@ -396,7 +396,7 @@ static test_return_t drizzled_cycle_test(void *object) test_skip(true, has_drizzled()); - test_skip(true, server_startup(*servers, "drizzled", get_free_port(), 0, NULL, false)); + test_skip(true, server_startup(*servers, "drizzled", get_free_port(), NULL)); return TEST_SUCCESS; } @@ -407,7 +407,7 @@ static test_return_t gearmand_cycle_test(void *object) test_true(servers and servers->validate()); test_skip(true, has_gearmand()); - test_skip(true, server_startup(*servers, "gearmand", get_free_port(), 0, NULL, false)); + test_skip(true, server_startup(*servers, "gearmand", get_free_port(), NULL)); servers->clear(); return TEST_SUCCESS; @@ -442,7 +442,7 @@ static test_return_t server_startup_fail_TEST(void *object) test_true(servers); fatal::disable(); - ASSERT_EQ(servers->start_server(testing_service, LIBTEST_FAIL_PORT, 0, NULL, false), true); + ASSERT_EQ(servers->start_server(testing_service, LIBTEST_FAIL_PORT, NULL), true); fatal::enable(); return TEST_SUCCESS; @@ -453,7 +453,7 @@ static test_return_t server_startup_TEST(void *object) server_startup_st *servers= (server_startup_st*)object; test_true(servers); - ASSERT_EQ(servers->start_server(testing_service, get_free_port(), 0, NULL, false), true); + ASSERT_EQ(servers->start_server(testing_service, get_free_port(), NULL), true); test_true(servers->last()); pid_t last_pid= servers->last()->pid(); @@ -476,7 +476,7 @@ static test_return_t socket_server_startup_TEST(void *object) server_startup_st *servers= (server_startup_st*)object; test_true(servers); - test_true(servers->start_socket_server(testing_service, get_free_port(), 0, NULL, false)); + test_true(servers->start_socket_server(testing_service, get_free_port(), NULL)); return TEST_SUCCESS; } @@ -494,7 +494,7 @@ static test_return_t memcached_sasl_test(void *object) if (HAVE_LIBMEMCACHED) { test_true(has_memcached_sasl()); - test_true(server_startup(*servers, "memcached-sasl", get_free_port(), 0, NULL, false)); + test_true(server_startup(*servers, "memcached-sasl", get_free_port(), NULL)); return TEST_SUCCESS; } @@ -618,6 +618,17 @@ static test_return_t vchar_t_TEST(void *) return TEST_SUCCESS; } +static test_return_t vchar_t_make_append_TEST(void *) +{ + libtest::vchar_t hostname; + libtest::vchar::make(hostname, 23); + libtest::vchar::append(hostname, ".com"); + ASSERT_EQ(28, hostname.size()); + ASSERT_EQ(0, hostname[27]); + + return TEST_SUCCESS; +} + static test_return_t vchar_t_compare_neg_TEST(void *) { libtest::vchar_t response; @@ -855,11 +866,8 @@ static test_return_t lookup_true_TEST(void *) static test_return_t lookup_false_TEST(void *) { - if (libtest::lookup("does_not_exist.gearman.info")) - { - Error << "Broken DNS server detected"; - return TEST_SKIPPED; - } + SKIP_IF_(libtest::lookup("does_not_exist.gearman.info"), + "Broken DNS server detected"); return TEST_SUCCESS; } @@ -885,7 +893,7 @@ static test_return_t create_tmpfile_TEST(void *) static test_return_t fatal_message_TEST(void *) { ASSERT_EQ(fatal_calls++, fatal::disabled_counter()); - fatal_message("Fatal test"); + FATAL("Fatal test"); return TEST_SUCCESS; } @@ -924,7 +932,6 @@ static test_return_t check_for_gearman(void *) static test_return_t check_for_drizzle(void *) { - test_skip(true, HAVE_LIBDRIZZLE); test_skip(true, has_drizzled()); testing_service= "drizzled"; @@ -1086,6 +1093,7 @@ test_st dns_TESTS[] ={ test_st application_tests[] ={ {"vchar_t", 0, vchar_t_TEST }, + {"vchar_t make() append()", 0, vchar_t_make_append_TEST }, {"vchar_t compare()", 0, vchar_t_compare_neg_TEST }, {"true", 0, application_true_BINARY }, {"gbd true --fubar", 0, application_gdb_true_BINARY }, @@ -1099,6 +1107,7 @@ test_st application_tests[] ={ static test_return_t check_for_curl(void *) { + test_skip_valgrind(); test_skip(true, HAVE_LIBCURL); return TEST_SUCCESS; }