Skip to content
Snippets Groups Projects
Unverified Commit c838727f authored by Sébastien Blin's avatar Sébastien Blin
Browse files

tests: fix build for testString_utils.cpp

Change-Id: I58229b352a9d1ed1507696ccdf5341e697ffbfb9
parent c420c5b4
Branches
No related tags found
No related merge requests found
...@@ -29,9 +29,11 @@ ...@@ -29,9 +29,11 @@
using namespace std::literals; using namespace std::literals;
namespace jami { namespace test { namespace jami {
namespace test {
class StringUtilsTest : public CppUnit::TestFixture { class StringUtilsTest : public CppUnit::TestFixture
{
public: public:
static std::string name() { return "string_utils"; } static std::string name() { return "string_utils"; }
...@@ -73,8 +75,8 @@ StringUtilsTest::to_string_test() ...@@ -73,8 +75,8 @@ StringUtilsTest::to_string_test()
// test with float // test with float
float varFloat = 3.14; float varFloat = 3.14;
std::string sVarFloat = to_string(varFloat); std::string sVarFloat = to_string(varFloat);
CPPUNIT_ASSERT(sVarFloat.at(0) == '3' && sVarFloat.at(1) == '.' CPPUNIT_ASSERT(sVarFloat.at(0) == '3' && sVarFloat.at(1) == '.' && sVarFloat.at(2) == '1'
&& sVarFloat.at(2) == '1' && sVarFloat.at(3) == '4'); && sVarFloat.at(3) == '4');
// test with int // test with int
CPPUNIT_ASSERT(std::to_string(INT).compare(PI_42) == 0); CPPUNIT_ASSERT(std::to_string(INT).compare(PI_42) == 0);
...@@ -93,7 +95,7 @@ StringUtilsTest::to_number_test() ...@@ -93,7 +95,7 @@ StringUtilsTest::to_number_test()
void void
StringUtilsTest::split_string_test() StringUtilsTest::split_string_test()
{ {
constexpr auto data = "*fdg454()**{&xcx*"sv; auto data = "*fdg454()**{&xcx*"sv;
auto split_string_result = split_string(data, '*'); auto split_string_result = split_string(data, '*');
CPPUNIT_ASSERT(split_string_result.size() == 2); CPPUNIT_ASSERT(split_string_result.size() == 2);
CPPUNIT_ASSERT(split_string_result.at(0) == "fdg454()"sv CPPUNIT_ASSERT(split_string_result.at(0) == "fdg454()"sv
...@@ -114,6 +116,7 @@ StringUtilsTest::split_string_test() ...@@ -114,6 +116,7 @@ StringUtilsTest::split_string_test()
&& split_string_result.at(1) == "{&xcx"sv); && split_string_result.at(1) == "{&xcx"sv);
} }
}} // namespace jami_test } // namespace test
} // namespace jami
RING_TEST_RUNNER(jami::test::StringUtilsTest::name()); RING_TEST_RUNNER(jami::test::StringUtilsTest::name());
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment