SNEAK Test Cases

2005-February

The following is a series of test cases for each function in SNEAK.

asciiToBinary

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " hello" "01101000 01100101 01101100 01101100 01101111" Current version doesn't do this.. oops. ;)
String w/ Trailing White Space "hello " "01101000 01100101 01101100 01101100 01101111" Current version doesn't do this.. oops. ;)
Short Value "a" "01100001"  
Long Value "a" (x10,000) "01100001 " (x10,000) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" "00100001 01000000 00100011 00100100 00100101 01011110 00100110 00101010 00101000 00101001"  
Foreign Characters "§ñëàk" "10100111 11110001 11101011 11100000 01101011"  
UTF-16 Characters "ŜŅỄẨҜ"

"0000000101011100 0000000101000101 0001111011000100 0001111010101000 0000010010011100" (I think!)

Current version of SNEAK has trouble with ASCII values > 255 (11111111). It will convert these to their HTML entities equivalent (i.e. &#264;&#256;) and convert *that* value to ASCII (00100110 = &, 00100011 = 2, etc.)
Zero 0 "00110000" Note that all numeric values are translated to their *ASCII* value, not their binary equivalent value (2 != 00000010)
Positive Number 1337 "00110001 00110011 00110011 00110111"  
Negative Number -1337 "00101101 00110001 00110011 00110011 00110111" Negative symbol converted to "-" ASCII value
Mixed (numbers and letters) "Where's the b33f?" "01010111 01101000 01100101 01110010 01100101 00100111 01110011 00100000 01110100 01101000 01100101 00100000 01100010 00110011 00110011 01100110 00111111"  

[Top]

binaryToAscii

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " 01100001" "a"  
String w/ Trailing White Space "01100001 " "a"  
Short Value "01100001" "a"  
Long Value "01100001" (x10,000) "a" (x10,000) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" (display error) Current version just displays an empty string
Foreign Characters "§ñëàk" (display error) Current version just displays an empty string
UTF-16 Characters "ŜŅỄẨҜ"

(display error)

Current results here are inconsistent; if the converted HTML entities value has a 0 or 1 in it, SNEAK will try and convert this into a value which usually results in output along the lines of 
Zero 0 (display error) Current version just displays an empty string
Positive Number 01100001 "a"  
Negative Number -01100001 (display error) Current version doesn't do this; tries conversion and ends up with output of 0
Mixed (numbers and letters) "Where's the b01f?" (display error) Current version doesn't do this; tries conversion and ends up with output of 

[Top]

asciiToHex

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " hello" "68 65 6c 6c 6f" Current version doesn't do this.. oops. ;)
String w/ Trailing White Space "hello " "68 65 6c 6c 6f" Current version doesn't do this.. oops. ;)
Short Value "a" "61"  
Long Value "a" (x10,000) "61 " (x10,000) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" "21 40 23 24 25 5e 26 2a 28 29"  
Foreign Characters "§ñëàk" "a7 f1 eb e0 6b"  
UTF-16 Characters "ŜŅỄẨҜ"

"015c 0145 1ec4 1ea8 049c"

Current version of SNEAK has trouble with ASCII values > 255 (FF). It will convert these to their HTML entities equivalent (i.e. &#264;&#256;) and convert *that* value to ASCII (26 = &, 32 = 2, etc.)
Zero 0 "30" Note that all numeric values are translated to their *ASCII* value, not their hex equivalent value (12 != C)
Positive Number 1337 "31 33 33 37"  
Negative Number -1337 "2d 31 33 33 37" Negative symbol converted to "-" ASCII value
Mixed (numbers and letters) "Where's the b33f?" "57 68 65 72 65 27 73 20 74 68 65 20 62 33 33 66 3f"  

[Top]

hexToAscii

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " 68 65 6c 6c 6f" "hello" Current version doesn't do this.. oops. ;)
String w/ Trailing White Space "68 65 6c 6c 6f " "hello" Current version doesn't do this.. oops. ;)
Short Value "61" "a"  
Long Value "61" (x10,000) "a" (x10,000) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" (display error) Current version just displays an empty string
Foreign Characters "§ñëàk" (display error) Current version just displays an empty string
UTF-16 Characters "ŜŅỄẨҜ"

(display error)

Post-HTML entities conversion, the current version tries to convert the characters it does recognize, resulting in output like: 42xv„€
Zero 0 (display error) Current version just displays an empty string
Positive Number 1337 "7" Maybe put in check for values <= 20?
Negative Number -1337 (display error) Current version attempts translation and comes up with 3
Mixed (numbers and letters) "Where's the b33f?" (display error) Current version attempts translation and comes up with ³?

[Top]

binaryToHex

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " 01100001" "61" Current version doesn't do this.. oops. ;)
String w/ Trailing White Space "01100001 " "61" Current version doesn't do this.. oops. ;)
Short Value "01100001" "61"  
Long Value "01100001" (x10,000) "61 " (x10,000) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" (display error) Current version attempts conversion and comes up with 00 00
Foreign Characters "§ñëàk" (display error) Current version attempts conversion and comes up with 00
UTF-16 Characters "ŜŅỄẨҜ"

(display error)

Current version attempts conversion and comes up with 00 00 00 06 00
Zero 0 "00"  
Positive Number 01100001 "61"  
Negative Number -01100001 "-61" Current version doesn't do this; tries conversion and ends up with output of 30 01
Mixed (numbers and letters) "Where's the b01f?" (display error) Current version attempts conversion and comes up with 00 01

[Top]

hexToBinary

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " 68 65 6c 6c 6f" "01101000 01100101 01101100 01101100 01101111" Current version doesn't do this.. oops. ;)
String w/ Trailing White Space "68 65 6c 6c 6f " "01101000 01100101 01101100 01101100 01101111" Current version doesn't do this.. oops. ;)
Short Value "61" "01100001"  
Long Value "61" (x10,000) "01100001 " (x10,000) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" (display error) Current version attempts conversion and comes up with a bunch of 0s
Foreign Characters "§ñëàk" (display error) Current version attempts conversion and comes up with a bunch of 0s
UTF-16 Characters "ŜŅỄẨҜ"

(display error)

Post-HTML entities conversion, the current version tries to convert the characters it does recognize, resulting in skewed ouput
Zero 0 "00000000" Current version truncates at 00000 due to flaw in string padding implementation
Positive Number 1337 "00010011 00110111"  
Negative Number -1337 "-00010011 00110111" Current version attempts translation and comes up with 00001001 10011000 0111
Mixed (numbers and letters) "Where's the b33f?" (display error) Current version attempts translation and comes up with skewed output

[Top]

backwards

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " hello" "olleh" Current version doesn't do this.. oops. ;)
String w/ Trailing White Space "hello " "olleh" Current version doesn't do this.. oops. ;)
Short Value "a" "a"  
Long Value "a" (x10,000) "a" (x10,000) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" ")(*&^%$#@!"  
Foreign Characters "§ñëàk" "kàëñ§"  
UTF-16 Characters "ŜŅỄẨҜ"

"ҜẨỄŅŜ"

Current version of SNEAK has trouble with ASCII values > 255. It will convert these to their HTML entities equivalent (i.e. &#264;&#256;) and then convert those backwards
Zero 0 "0"  
Positive Number 1337 "7331"  
Negative Number -1337 "7331-"  
Mixed (numbers and letters) "Where's the b33f?" "?f33b eht s'erehW"  

[Top]

base64Encode

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " hello" "aGVsbG8=" Current version doesn't do this.. oops. ;)
String w/ Trailing White Space "hello " "aGVsbG8=" Current version doesn't do this.. oops. ;)
Short Value "a" "YQ=="  
Long Value "a" (x10,000) "YWFh" (x3,334) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" "IUAjJCVeJiooKQ=="  
Foreign Characters "§ñëàk" "p/Hr4Gs="  
UTF-16 Characters "ŜŅỄẨҜ"

?

Sorry, not able to find a proper base64 function that supports UTF-16 with which to test. :(
Zero 0 "MA=="  
Positive Number 1337 "MTMzNw=="  
Negative Number -1337 "LTEzMzc="  
Mixed (numbers and letters) "Where's the b33f?" "V2hlcmUncyB0aGUgYjMzZj8="  

[Top]

base64Decode

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " aGVsbG8=" "hello" Current version doesn't do this.. oops. ;)
String w/ Trailing White Space "aGVsbG8=" "hello" Current version doesn't do this.. oops. ;)
Short Value "YQ==" "a"  
Long Value "YWFh" (x3,334) "a" (x10,000) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" (display error) Current version returns empty string
Foreign Characters "§ñëàk" (display error) Current version returns empty string
UTF-16 Characters "ŜŅỄẨҜ"

(display error)

Current version tries to do conversion of HTML entities output and comes up with ߏ7Ûžüï®üãÍuó
Zero 0 (display error) Current version returns empty string
Positive Number 1337 "×}û" (I guess?)  
Negative Number -1337 "×}û" (I guess?)  
Mixed (numbers and letters) "Where's the b33f?" (display error) Current version attempts conversion and ends up with Z«zËay½÷

[Top]

l33t5p34kEncode

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " hello" "h3ll0" Current version doesn't do this.. oops. ;)
String w/ Trailing White Space "hello " "h3ll0" Current version doesn't do this.. oops. ;)
Short Value "a" "4"  
Long Value "a" (x10,000) "4" (x10,000) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" "!@#$%^&*()"  
Foreign Characters "§ñëàk" "§ñëàk"  
UTF-16 Characters "ŜŅỄẨҜ"

"ŜŅỄẨҜ"

Current version of SNEAK has trouble with ASCII values > 255 (11111111). It will convert these to their HTML entities equivalent (i.e. &#264;&#256;)
Zero 0 "0"  
Positive Number 1337 "1337"  
Negative Number -1337 "-1337"  
Mixed (numbers and letters) "Where's the b33f?" "Wh3r3'5 7h3 b33f?"  

[Top]

l33t5p34kDecode

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " h3ll0" "hello" Current version doesn't do this.. oops. ;)
String w/ Trailing White Space "h3ll0 " "hello" Current version doesn't do this.. oops. ;)
Short Value "4" "a"  
Long Value "4" (x10,000) "a" (x10,000) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" "!@#$%^&*()"  
Foreign Characters "§ñëàk" "§ñëàk"  
UTF-16 Characters "ŜŅỄẨҜ"

"ŜŅỄẨҜ"

Current version of SNEAK has trouble with ASCII values > 255. It will convert these to their HTML entities equivalent (i.e. &#264;&#256;)
Zero 0 "o"  
Positive Number 1337 "leet" Current version translates to "ieet" .. would be neat to check for strings containig "1337" and catch those as transforming 1 into "L" instead.
Negative Number -1337 "-leet" Current version translates to "-ieet" .. would be neat to check for strings containig "1337" and catch those as transforming 1 into "L" instead.
Mixed (numbers and letters) "Wh3r3'5 7h3 b33f?" "Where's the beef?"  

[Top]

rot13

  Input Expected Output Comments
Empty String (NULL) (display error) This is true of all functions
White Space Only <space>, <space>, <enter> (display error) Current version doesn't do this.. oops. ;)
String w/ Leading White Space " hello" "uryyb" Current version doesn't do this.. oops. ;)
String w/ Trailing White Space "hello " "uryyb" Current version doesn't do this.. oops. ;)
Short Value "a" "n"  
Long Value "a" (x10,000) "n" (x10,000) Never thought to put a cap on this initially, but probably should.
Special Characters "!@#$%^&*()" "!@#$%^&*()"  
Foreign Characters "§ñëàk" "§ñëàk"  
UTF-16 Characters "ŜŅỄẨҜ"

"ŜŅỄẨҜ"

Current version of SNEAK has trouble with ASCII values > 255. It will convert these to their HTML entities equivalent (i.e. &#264;&#256;)
Zero 0 "0"  
Positive Number 1337 "1337"  
Negative Number -1337 "-1337"  
Mixed (numbers and letters) "Where's the b33f?" "Jurer'f gur o33s?"  

[Top]