aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_suite.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp
index 8aaf67a..c2fd0f2 100644
--- a/test/test_suite.cpp
+++ b/test/test_suite.cpp
@@ -83,6 +83,24 @@ TEST_CASE("snprintf", "[]" ) {
}
+TEST_CASE("vsnprintf", "[]" ) {
+ char buffer[100];
+
+ // mock argument list
+ const struct tag_args {
+ int a;
+ int b;
+ char* s;
+ } args = { -1, -1000, "test" };
+
+ test::vsnprintf(buffer, 100U, "%d %d %s", (char*)&args);
+ REQUIRE(!strcmp(buffer, "-1 -1000 test"));
+
+ test::vsnprintf(buffer, 3U, "%d", (char*)&args);
+ REQUIRE(!strcmp(buffer, "-1"));
+}
+
+
TEST_CASE("space flag", "[]" ) {
char buffer[100];