2022-03-20 18:12:25 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2022-04-27 19:18:30 +02:00
|
|
|
#include <string.h>
|
2022-03-20 18:12:25 +01:00
|
|
|
|
|
|
|
#include "../../include/encrypter.h"
|
|
|
|
#include "../../include/decrypter.h"
|
|
|
|
|
2022-04-27 19:18:30 +02:00
|
|
|
#define TEST_TEXT "Pepa smrdí."
|
|
|
|
#define TEST_KEY "lZwOBFvjJEmaYRIaKsALKLkSeJvXhFPbZIRNFbjQRNyiOuLTexhgOpObHzyQgNT"
|
|
|
|
|
2022-03-20 18:12:25 +01:00
|
|
|
int
|
2022-04-29 17:49:51 +02:00
|
|
|
main(int argc, char *argv[])
|
2022-03-20 18:12:25 +01:00
|
|
|
{
|
2022-04-27 19:18:30 +02:00
|
|
|
char *text = encryptText(TEST_TEXT, TEST_KEY);
|
|
|
|
text = decryptText(text, TEST_KEY);
|
2022-03-20 18:12:25 +01:00
|
|
|
|
2022-04-27 19:18:30 +02:00
|
|
|
if (strcmp(text, TEST_TEXT) == 0)
|
|
|
|
{
|
|
|
|
printf("Test successful!\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf(stderr, "Test failed!\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
2022-03-20 18:12:25 +01:00
|
|
|
|
|
|
|
free(text);
|
|
|
|
return 0;
|
2022-04-26 19:05:57 +02:00
|
|
|
}
|