diff --git a/main.cpp b/main.cpp index fe82234..fb2ccf9 100644 --- a/main.cpp +++ b/main.cpp @@ -22,7 +22,7 @@ */ -///The header files +//The header files #include "Headers/Caesar.hpp" #include "Headers/Playfair.hpp" #include "Headers/Vigenere.hpp" @@ -31,26 +31,26 @@ #include #include - -///Test definitions -//#define TEST_VERSION - - -//Main functions +//If this is the test version include the appropriate functions from the file #ifdef TEST_VERSION -#include "testMain.hpp" //This inserts the main function with all of the test functions -#else //TEST_VERSION main function - +#include "testHandler.hpp" //This inserts the main function with all of the test functions +#else +//We need these files for normal opperations #include "helperFunctions.hpp" #include +#endif //TEST_VERSION int main(int argc, char** argv){ + //If this is the test version of the program run the test function + #ifdef TEST_VERSION + testHandler(argc, argv); + //Otherwise handle the program normally + #else //TEST_VERSION bool cipherFlags[SIZE]; std::string inputFileName, outputFileName, cipherString; std::ifstream inputFile; std::ofstream outputFile; - setFlagStrings(); //Make sure the flags are all false by default for(int cnt = 0;cnt < SIZE;++cnt){ @@ -101,7 +101,6 @@ int main(int argc, char** argv){ inputFile.close(); outputFile.close(); + #endif //TEST_VERSION return 0; } - -#endif //TEST_VERSION