diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-24 20:22:12 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-24 20:22:12 +0200 |
commit | 7988979a722b4cdf287b2093956a76a3f19b9897 (patch) | |
tree | d35e251d0472ceca55a2eef61cff261c8ee68fab /test/crypt/md5c-test.c |
add uClibc-ng test directory
Diffstat (limited to 'test/crypt/md5c-test.c')
-rw-r--r-- | test/crypt/md5c-test.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/crypt/md5c-test.c b/test/crypt/md5c-test.c new file mode 100644 index 0000000..3c61540 --- /dev/null +++ b/test/crypt/md5c-test.c @@ -0,0 +1,19 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <crypt.h> + +int +main (int argc, char *argv[]) +{ + const char salt[] = "$1$saltstring"; + char *cp; + + cp = crypt ("Hello world!", salt); + if (strcmp ("$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1", cp)) { + fprintf(stderr, "Failed md5 crypt test!\n"); + return EXIT_FAILURE; + } + fprintf(stderr, "Passed md5 crypt test!\n"); + return EXIT_SUCCESS; +} |