示例#1
0
文件: StringTest.cpp 项目: 54lman/znc
	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");
	}
示例#2
0
    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);
    }
示例#3
0
int main(int argc, char **argv)
{
	(void) argc;
	(void) argv;

	TRACE_LEVEL_SET(TRACE_ALL);
	TEST_INITIALIZE();

	testEncode();
	testDecode();
	testDecodeCorruptLength();

	TEST_FINALIZE();
	return 0;
}
示例#4
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;
 }
示例#5
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 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;
}