github.com/bytedance/sonic@v1.11.7-0.20240517092252-d2edb31b167b/native/unittest/test_to_lower.c (about) 1 #include "../to_lower.c" 2 #include <assert.h> 3 #include <string.h> 4 5 void test_to_lower(const char* input, const char* expect) { 6 unsigned long len = strlen(input); 7 char* dst = (char*)malloc(len); 8 to_lower(dst, input, len); 9 assert(strncmp(expect, dst, len) == 0); 10 free(dst); 11 } 12 13 int main() { 14 test_to_lower("Hello, World!", "hello, world!"); 15 test_to_lower("12345", "12345"); 16 test_to_lower("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz"); 17 }