created test code
This commit is contained in:
parent
6f38a68020
commit
3f5724dc0b
@ -1,17 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../include/encrypter.h"
|
||||
#include "../../include/decrypter.h"
|
||||
|
||||
#define TEST_TEXT "Pepa smrdí."
|
||||
#define TEST_KEY "lZwOBFvjJEmaYRIaKsALKLkSeJvXhFPbZIRNFbjQRNyiOuLTexhgOpObHzyQgNT"
|
||||
|
||||
int
|
||||
main(int args, char *argv[])
|
||||
{
|
||||
char *text = encryptText("Pepa smrdí.", "lZwOBFvjJEmaYRIaKsALKLkSeJvXhFPbZIRNFbjQRNyiOuLTexhgOpObHzyQgNT");
|
||||
printf("%s\n", text);
|
||||
char *text = encryptText(TEST_TEXT, TEST_KEY);
|
||||
text = decryptText(text, TEST_KEY);
|
||||
|
||||
text = decryptText(text, "lZwOBFvjJEmaYRIaKsALKLkSeJvXhFPbZIRNFbjQRNyiOuLTexhgOpObHzyQgNT");
|
||||
printf("%s\n", text);
|
||||
if (strcmp(text, TEST_TEXT) == 0)
|
||||
{
|
||||
printf("Test successful!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Test failed!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
free(text);
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user