Added test with large offset

This commit is contained in:
2018-05-14 21:49:13 -04:00
parent 3d340762de
commit d141ec61c8

View File

@@ -292,6 +292,21 @@ bool caesarTest(std::string& errorString){
passed = false; passed = false;
} }
inputString = "you";
outputString = "iye";
//Try it forwards
cipherString = cipher.encode(10, inputString);
if(cipherString != outputString){
errorString += testingError(ENCODE, inputString, outputString, cipherString);
passed = false;
}
//Try it backwards
cipherString = cipher.decode(10, outputString);
if(cipherString != inputString){
errorString += testingError(DECODE, outputString, inputString, cipherString);
passed = false;
}
return passed; return passed;
} }
#endif //CAESAR_TEST #endif //CAESAR_TEST