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