This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
sys_prog/sortstrings/tests/test1.c
2019-10-09 10:18:40 +02:00

15 lines
332 B
C

#include <assert.h>
#include <string.h>
extern void sort_strings(const char * input, char * output, unsigned int n);
int main() {
char buf[100];
sort_strings("ciao", buf, 1);
assert(memcmp(buf, "ciao", 5) == 0);
sort_strings("ciao\0blah", buf, 2);
assert(memcmp(buf, "blah\0ciao", 10) == 0);
return 0;
}