X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=mware%2Fsprintf_test.c;h=60958fc5308d4df93b308ce5e31171d47f9c78db;hb=HEAD;hp=b793f97b0138eb982b52972eae08c88f0b0bc052;hpb=955809a5fea19ac29e086605a2338ec6d3e3e32d;p=bertos.git diff --git a/mware/sprintf_test.c b/mware/sprintf_test.c deleted file mode 100755 index b793f97b..00000000 --- a/mware/sprintf_test.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "sprintf.c" -#include "formatwr.c" - -#include /* assert() */ -#include /* strcmp() */ - - -int main(UNUSED_ARG(int, argc), UNUSED_ARG(char **,argv)) -{ - char buf[256]; - static const char test_string[] = "Hello, world!\n"; - static const pgm_char test_string_pgm[] = "Hello, world!\n"; - - snprintf(buf, sizeof buf, "%s", test_string); - assert(strcmp(buf, test_string) == 0); - - snprintf(buf, sizeof buf, "%S", test_string_pgm); - assert(strcmp(buf, test_string_pgm) == 0); - - snprintf(buf, sizeof buf, "%s", NULL); - assert(strcmp(buf, "") == 0); - - snprintf(buf, sizeof buf, "%d", 12345); - assert(strcmp(buf, "12345") == 0); - - snprintf(buf, sizeof buf, "%ld", 123456789L); - assert(strcmp(buf, "123456789") == 0); - - snprintf(buf, sizeof buf, "%lu", 4294967295UL); - assert(strcmp(buf, "4294967295") == 0); - - return 0; -}