From 43ea16b59617cc43075e9cc9e8714beb761cb56a Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sun, 8 May 2022 20:02:47 +0200 Subject: [PATCH] removed TEST_KEY & added more info for successful test --- include/flags.h | 1 - src/lib/test/main.c | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/flags.h b/include/flags.h index 7f0ccb9..c6f5827 100644 --- a/include/flags.h +++ b/include/flags.h @@ -13,7 +13,6 @@ #define VERSIONS_NAME "versions.json" //do I have to explain this? #define TEST_TEXT "Pepa smrdí." //TEST TEXT FOR ENCRYPTION IN why2-test BINARY -#define TEST_KEY "lZwOBFvjJEmaYRIaKsALKLkSeJvXhFPbZIRNFbjQRNyiOuLTexhgOpObHzyQgNT" //TEST KEY FOR ENCRYPTION IN why2-test BINARY #define TEXT_TO_ENCRYPT "Some text yk" //THIS TEXT WILL BE ENCRYPTED IN why2-app BINARY diff --git a/src/lib/test/main.c b/src/lib/test/main.c index e7bfd62..6243368 100644 --- a/src/lib/test/main.c +++ b/src/lib/test/main.c @@ -9,18 +9,23 @@ int main(void) { + char *buffer; + inputFlags flags = { 1, //SKIP CHECK 0, //NO OUTPUT }; - outputFlags encrypted = encryptText(TEST_TEXT, TEST_KEY, flags); - encrypted = decryptText(encrypted.outputText, TEST_KEY, flags); + outputFlags encrypted = encryptText(TEST_TEXT, NULL, flags); + + buffer = encrypted.outputText; //GET ENCRYPTED TEXT + + encrypted = decryptText(encrypted.outputText, encrypted.usedKey, flags); if (strcmp(encrypted.outputText, TEST_TEXT) == 0) { - printf("Test successful!\n"); + printf("Test successful!\n\nTEXT: %s\nOUTPUT: %s\nKEY: %s\n", TEST_TEXT, buffer, encrypted.usedKey); } else {