aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_suite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_suite.cpp')
-rw-r--r--test/test_suite.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp
index 27efa4e..a113db0 100644
--- a/test/test_suite.cpp
+++ b/test/test_suite.cpp
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
// \author (c) Marco Paland (info@paland.com)
-// 2017-2018, PALANDesign Hannover, Germany
+// 2017-2019, PALANDesign Hannover, Germany
//
// \license The MIT License (MIT)
//
@@ -361,6 +361,10 @@ TEST_CASE("# flag", "[]" ) {
test::sprintf(buffer, "%#.0x", 0);
REQUIRE(!strcmp(buffer, ""));
+ test::sprintf(buffer, "%#.1x", 0);
+ REQUIRE(!strcmp(buffer, "0"));
+ test::sprintf(buffer, "%#.0llx", (long long)0);
+ REQUIRE(!strcmp(buffer, ""));
test::sprintf(buffer, "%#.8x", 0x614e);
REQUIRE(!strcmp(buffer, "0x0000614e"));
test::sprintf(buffer,"%#b", 6);
@@ -1067,6 +1071,15 @@ TEST_CASE("float", "[]" ) {
test::sprintf(buffer, "%.0f", 34.1415354);
REQUIRE(!strcmp(buffer, "34"));
+ test::sprintf(buffer, "%.0f", 1.3);
+ REQUIRE(!strcmp(buffer, "1"));
+
+ test::sprintf(buffer, "%.0f", 1.55);
+ REQUIRE(!strcmp(buffer, "2"));
+
+ test::sprintf(buffer, "%.1f", 1.64);
+ REQUIRE(!strcmp(buffer, "1.6"));
+
test::sprintf(buffer, "%.2f", 42.8952);
REQUIRE(!strcmp(buffer, "42.90"));
@@ -1113,6 +1126,9 @@ TEST_CASE("float", "[]" ) {
test::sprintf(buffer, "%.0f", 3.5);
REQUIRE(!strcmp(buffer, "4"));
+ test::sprintf(buffer, "%.0f", 4.5);
+ REQUIRE(!strcmp(buffer, "4"));
+
test::sprintf(buffer, "%.0f", 3.49);
REQUIRE(!strcmp(buffer, "3"));