diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ed08a1..cf0b72b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ if (WITH_TSAN) endif() add_custom_target(coverage_report - lcov --capture --directory src --output lcov.info --no-external + lcov --capture --directory src --directory test --directory include --output lcov.info --no-external COMMAND genhtml --output-directory coverage_report lcov.info) diff --git a/src/provider.cpp b/src/provider.cpp index f1af0b4..9713372 100644 --- a/src/provider.cpp +++ b/src/provider.cpp @@ -5,7 +5,6 @@ #include "wsrep/provider.hpp" #include "wsrep/logger.hpp" -#include "../test/mock_provider.hpp" #include "wsrep_provider_v26.hpp" wsrep::provider* wsrep::provider::make_provider( @@ -15,15 +14,8 @@ wsrep::provider* wsrep::provider::make_provider( { try { - if (provider_spec == "mock") - { - return new wsrep::mock_provider(server_context); - } - else - { - return new wsrep::wsrep_provider_v26( - server_context, provider_options, provider_spec); - } + return new wsrep::wsrep_provider_v26( + server_context, provider_options, provider_spec); } catch (const wsrep::runtime_error& e) { diff --git a/test/id_test.cpp b/test/id_test.cpp index 7417b4e..4d7e734 100644 --- a/test/id_test.cpp +++ b/test/id_test.cpp @@ -36,3 +36,19 @@ BOOST_AUTO_TEST_CASE(id_test_string_too_long) BOOST_REQUIRE_EXCEPTION(wsrep::id id(id_str), wsrep::runtime_error, exception_check); } + +BOOST_AUTO_TEST_CASE(id_test_binary) +{ + char data[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4 ,5 ,6}; + wsrep::id id(data, sizeof(data)); + std::ostringstream os; + os << id; + BOOST_REQUIRE(os.str() == "01020304-0506-0708-0900-010203040506"); +} + +BOOST_AUTO_TEST_CASE(id_test_binary_too_long) +{ + char data[17] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4 ,5 ,6, 7}; + BOOST_REQUIRE_EXCEPTION(wsrep::id id(data, sizeof(data)), + wsrep::runtime_error, exception_check);; +}