mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
Fixed problems with server_context unit tests.
Added WITH_ASAN and WITH_TSAN options, enabled unit tests by default.
This commit is contained in:
@ -16,6 +16,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
|
||||
namespace wsrep
|
||||
{
|
||||
@ -100,13 +101,6 @@ namespace wsrep
|
||||
assert(data_size <= 16);
|
||||
std::memcpy(data_, data, data_size);
|
||||
}
|
||||
#if 0
|
||||
void assign(const void* data, size_t data_size)
|
||||
{
|
||||
assert(data_size == 16);
|
||||
memcpy(data_, data, data_size);
|
||||
}
|
||||
#endif
|
||||
bool operator<(const id& other) const
|
||||
{
|
||||
return (std::memcmp(data_, other.data_, sizeof(data_)) < 0);
|
||||
@ -375,6 +369,28 @@ namespace wsrep
|
||||
// Factory method
|
||||
static provider* make_provider(const std::string& provider);
|
||||
};
|
||||
|
||||
static inline std::string flags_to_string(int flags)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
if (flags & provider::flag::start_transaction)
|
||||
oss << "start_transaction | ";
|
||||
if (flags & provider::flag::commit)
|
||||
oss << "commit | ";
|
||||
if (flags & provider::flag::rollback)
|
||||
oss << "rollback | ";
|
||||
if (flags & provider::flag::isolation)
|
||||
oss << "isolation | ";
|
||||
if (flags & provider::flag::pa_unsafe)
|
||||
oss << "pa_unsafe | ";
|
||||
if (flags & provider::flag::snapshot)
|
||||
oss << "snapshot | ";
|
||||
|
||||
std::string ret(oss.str());
|
||||
if (ret.size() > 3) ret.erase(ret.size() - 3);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // WSREP_PROVIDER_HPP
|
||||
|
@ -123,6 +123,7 @@ namespace wsrep
|
||||
wsrep::mutex& mutex();
|
||||
|
||||
wsrep::ws_handle& ws_handle() { return ws_handle_; }
|
||||
const wsrep::ws_meta& ws_meta() const { return ws_meta_; }
|
||||
private:
|
||||
transaction_context(const transaction_context&);
|
||||
transaction_context operator=(const transaction_context&);
|
||||
|
Reference in New Issue
Block a user