diff options
author | aqua <aqua@iserlohn-fortress.net> | 2022-11-06 14:48:41 +0200 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2022-11-06 15:03:06 +0200 |
commit | 6d53f16aa508c445309aa4ebe965baa9e17401a1 (patch) | |
tree | bf42dc7dc1105d819a83c1e5a8c8595df19401b6 /lib/tst/string.c | |
parent | lib/malloc: add linked list implementation (diff) | |
download | kernel-6d53f16aa508c445309aa4ebe965baa9e17401a1.tar.xz |
lib: migrate tests to gtest
Diffstat (limited to 'lib/tst/string.c')
-rw-r--r-- | lib/tst/string.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/tst/string.c b/lib/tst/string.c deleted file mode 100644 index 725d547..0000000 --- a/lib/tst/string.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "../string.h" -#include <assert.h> - -static const char *dec = "12341234"; -static const char *neg_dec = "-12341234"; -static const char *u32_hex = "decafade"; -static const char *i32_hex = "7fffffff"; -static char buffer[64]; - -int -main() -{ - { // utoa - char *r; - - r = utoa(buffer, 12341234u, 10); - for (unsigned i = 0; dec[i] != '\0'; ++i) assert(r[i] == dec[i]); - - r = utoa(buffer, 0xdecafade, 16); - for (unsigned i = 0; u32_hex[i] != '\0'; ++i) assert(r[i] == u32_hex[i]); - } - { // itoa - char *r; - - r = itoa(buffer, 12341234, 10); - for (unsigned i = 0; dec[i] != '\0'; ++i) assert(r[i] == dec[i]); - - r = itoa(buffer, -12341234, 10); - for (unsigned i = 0; neg_dec[i] != '\0'; ++i) assert(r[i] == neg_dec[i]); - - r = itoa(buffer, 0x7fffffff, 16); - for (unsigned i = 0; i32_hex[i] != '\0'; ++i) assert(r[i] == i32_hex[i]); - } -} |