Browse Source

Revive FW unit test, add it to CI

PUBLISHED_FROM=9eeefcd4f42e5106773040725b1e5f9ef0479fea
Sergey Lyubka 9 years ago
parent
commit
70a898b78e
1 changed files with 7 additions and 0 deletions
  1. 7 0
      unit_test.c

+ 7 - 0
unit_test.c

@@ -287,6 +287,13 @@ static const char *test_json_printf(void) {
     ASSERT(strcmp(buf, "{\"a\": \"b\"}") == 0);
   }
 
+  {
+    struct json_out out = JSON_OUT_BUF(buf, sizeof(buf));
+    memset(buf, 0, sizeof(buf));
+    ASSERT(json_printf(&out, "%.*s %d", 2, "abc", 5) > 0);
+    ASSERT(strcmp(buf, "ab 5") == 0);
+  }
+
   return NULL;
 }