mirror of
https://bitbucket.org/Mattrixwv/cipherstream.git
synced 2025-12-06 18:33:58 -05:00
Adjusted to change testmain to regular funct to maintain single main()
This commit is contained in:
25
main.cpp
25
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 <iostream>
|
||||
#include <string>
|
||||
|
||||
|
||||
///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 <fstream>
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user