diff options
author | axtloss <axtlos@getcryst.al> | 2024-06-24 21:50:48 +0200 |
---|---|---|
committer | axtloss <axtlos@getcryst.al> | 2024-06-24 21:50:48 +0200 |
commit | a084dfa02d28a9372a7e406c9b101a43308a4937 (patch) | |
tree | 620d7fe5f55fa76572f5666465997f397b8bbd2a /test.c | |
parent | 1d4b6499993050876a453a3f96e2428fdfd42610 (diff) | |
download | extlib-a084dfa02d28a9372a7e406c9b101a43308a4937.tar.gz extlib-a084dfa02d28a9372a7e406c9b101a43308a4937.tar.bz2 |
Add new function memvcmp and unit tests
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 27 |
1 files changed, 0 insertions, 27 deletions
@@ -1,27 +0,0 @@ -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <extlib.h> -#include <assert.h> - -void print_hex(const char *s) -{ - while(*s) - printf("%02x", (unsigned int) *s++); - printf("\n"); -} - -int -main(void) { - char *test = malloc_secure (9); - sprintf (test, "meowmeow"); - assert (strcmp (test, "meowmeow") == 0); - puts ("Test 1 passed"); - char *upper = strupr (test); - assert (strcmp (upper, "MEOWMEOW") == 0); - puts ("Test 2 passed"); - char *lower = strlwr (test); - assert (strcmp (lower, "meowmeow") == 0); - puts ("Test 3 passed"); - free_secure (lower, strlen (lower)); -} |