mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-31 18:24:25 +03:00
Reorganized coverage report, missing test cases for id.
This commit is contained in:
@ -51,7 +51,7 @@ if (WITH_TSAN)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_custom_target(coverage_report
|
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)
|
COMMAND genhtml --output-directory coverage_report lcov.info)
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include "wsrep/provider.hpp"
|
#include "wsrep/provider.hpp"
|
||||||
#include "wsrep/logger.hpp"
|
#include "wsrep/logger.hpp"
|
||||||
|
|
||||||
#include "../test/mock_provider.hpp"
|
|
||||||
#include "wsrep_provider_v26.hpp"
|
#include "wsrep_provider_v26.hpp"
|
||||||
|
|
||||||
wsrep::provider* wsrep::provider::make_provider(
|
wsrep::provider* wsrep::provider::make_provider(
|
||||||
@ -15,15 +14,8 @@ wsrep::provider* wsrep::provider::make_provider(
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (provider_spec == "mock")
|
return new wsrep::wsrep_provider_v26(
|
||||||
{
|
server_context, provider_options, provider_spec);
|
||||||
return new wsrep::mock_provider(server_context);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return new wsrep::wsrep_provider_v26(
|
|
||||||
server_context, provider_options, provider_spec);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (const wsrep::runtime_error& e)
|
catch (const wsrep::runtime_error& e)
|
||||||
{
|
{
|
||||||
|
@ -36,3 +36,19 @@ BOOST_AUTO_TEST_CASE(id_test_string_too_long)
|
|||||||
BOOST_REQUIRE_EXCEPTION(wsrep::id id(id_str), wsrep::runtime_error,
|
BOOST_REQUIRE_EXCEPTION(wsrep::id id(id_str), wsrep::runtime_error,
|
||||||
exception_check);
|
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);;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user