void testString(const CString& in, const CString& url, const CString& html, const CString& sql) { SCOPED_TRACE("String: " + in); testEncode(in, url, "URL"); testEncode(in, html, "HTML"); testEncode(in, sql, "SQL"); }
void testString(const NoString& in, const NoString& url, const NoString& html, const NoString& sql, const NoString& tag) { SCOPED_TRACE("String: " + in); testEncode(in, url, No::UrlFormat); testEncode(in, html, No::HtmlFormat); testEncode(in, sql, No::SqlFormat); testEncode(in, tag, No::MsgTagFormat); }
int main(int argc, char **argv) { (void) argc; (void) argv; TRACE_LEVEL_SET(TRACE_ALL); TEST_INITIALIZE(); testEncode(); testDecode(); testDecodeCorruptLength(); TEST_FINALIZE(); return 0; }
int main (int argc, char *argv[]) { testEncode(); char permutation[ALPHABET_SIZE]; scanf ("%s", permutation); // getchar() reads and returns one character from the keyboard // returns -1 when it reads end-of-file character (^D in linux) int plainCharacter = getchar(); while (plainCharacter != STOP) { int encodedCharacter = encode (plainCharacter, permutation); printf ("%c", encodedCharacter); plainCharacter = getchar(); } return EXIT_SUCCESS; }
int main (int argc, char *argv[]) { testEncode(); char permutation[ALPHABET_SIZE]; scanf ("%s", permutation); // getchar() reads and returns one character from the keyboard // returns -1 when the input is finished / end-of-file is reached // signal this from the keyboard by pressing ^D in linux /^Z windows int plainCharacter = getchar(); while (plainCharacter != STOP) { int encodedCharacter = encode (plainCharacter, permutation); printf ("%c", encodedCharacter); plainCharacter = getchar(); } return EXIT_SUCCESS; }