From 7a8cd0bf0605433cd2d48370ddb8e4c9f3c1d70b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 12 Jan 2017 20:23:55 +0300 Subject: Add test for strprintf. --- src/utils/stringutils_unittest.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/utils/stringutils_unittest.cc b/src/utils/stringutils_unittest.cc index 9860d90c7..a866e68b6 100644 --- a/src/utils/stringutils_unittest.cc +++ b/src/utils/stringutils_unittest.cc @@ -132,6 +132,24 @@ TEST_CASE("stringuntils toString 1") REQUIRE(strprintf("%d", 123) == toString(CAST_U8(123))); } +TEST_CASE("stringuntils strprintf 1") +{ + REQUIRE(strprintf("%s very long string. 123456789012345678901234567890" + "+++++++++++++++++++++++++++++++++++++++" + "________________________________" + "***********************************" + "----------------------------------------" + "|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| %s", + "test", "end of test") == + "test very long string. 123456789012345678901234567890" + "+++++++++++++++++++++++++++++++++++++++" + "________________________________" + "***********************************" + "----------------------------------------" + "|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| " + "end of test"); +} + TEST_CASE("stringuntils toString 2") { for (int f = 0; f < 10000000; f += 123) -- cgit v1.2.3-70-g09d2