mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-01 13:45:53 +00:00
tests: add sstring tests
This commit is contained in:
@@ -12,6 +12,7 @@ tests = [
|
||||
'tests/udp_server',
|
||||
'tests/udp_client',
|
||||
'tests/blkdiscard_test',
|
||||
'tests/sstring_test',
|
||||
]
|
||||
|
||||
apps = [
|
||||
@@ -57,6 +58,7 @@ deps = {
|
||||
'tests/udp_server': ['tests/udp_server.cc'] + core + libnet,
|
||||
'tests/udp_client': ['tests/udp_client.cc'] + core + libnet,
|
||||
'tests/blkdiscard_test': ['tests/blkdiscard_test.cc'] + core,
|
||||
'tests/sstring_test': ['tests/sstring_test.cc'] + core,
|
||||
}
|
||||
|
||||
modes = {
|
||||
@@ -139,9 +141,9 @@ def debug_flag(compiler):
|
||||
src_with_auto = textwrap.dedent('''\
|
||||
template <typename T>
|
||||
struct x { auto f() {} };
|
||||
|
||||
|
||||
x<int> a;
|
||||
''')
|
||||
''')
|
||||
if try_compile(source = src_with_auto, flags = ['-g', '-std=gnu++1y'], compiler = compiler):
|
||||
return '-g'
|
||||
else:
|
||||
|
||||
17
tests/sstring_test.cc
Normal file
17
tests/sstring_test.cc
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2014 Cloudius Systems
|
||||
*/
|
||||
|
||||
#define BOOST_TEST_DYN_LINK
|
||||
#define BOOST_TEST_MODULE core
|
||||
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include "core/sstring.hh"
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_equality) {
|
||||
BOOST_REQUIRE_EQUAL(sstring("aaa"), sstring("aaa"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_to_sstring) {
|
||||
BOOST_REQUIRE_EQUAL(to_sstring(1234567), sstring("1234567"));
|
||||
}
|
||||
Reference in New Issue
Block a user