Skip to content

Commit

Permalink
Removed redundant test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Adarsh Anand <[email protected]>
  • Loading branch information
adarshan-intel committed Oct 25, 2023
1 parent 9cab137 commit 193ccdc
Showing 1 changed file with 3 additions and 128 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ public class ManufacturingInfoTest {
public void Test() throws DecoderException, IOException {

ManufacturingInfoDeserializer obj = new ManufacturingInfoDeserializer();
String[] invalidStrings = { "", "null", "none", "true", "false", "undefined", "NaN", "nil" };

String[] moreInvalidStrings = {
String[] invalidStrings = {
"",
"none",
"NaN",
"undefined",
"undef",
"null",
Expand All @@ -39,16 +40,9 @@ public void Test() throws DecoderException, IOException {
"TRUE",
"FALSE",
"None",
"����8������?",
"�?�?i�¯?�",
"����?��?���?",
"����?����?��",
"`/���??������",
"????",
"???????????????????????????????????????????????????????????????????????????????",
"??????????",
"�45",
"�45012",
"??? ??? ???",
"'",
"\"",
Expand All @@ -57,10 +51,6 @@ public void Test() throws DecoderException, IOException {
"'\"'",
"\"''''\"'\"",
"\"'\"'\"''''\"",
"<foo val=�bar� />",
"<foo val=�bar� />",
"<foo val=�bar� />",
"<foo val=`bar' />",
"1;DROP TABLE users",
"1'; DROP TABLE users-- 1",
"'; EXEC sp_MSForEachTable 'DROP TABLE ?'; --",
Expand Down Expand Up @@ -92,125 +82,10 @@ public void Test() throws DecoderException, IOException {
"%.2048d",
"%.4096d",
"%.8200d",
"%99999999999s",
"%99999999999d",
"%99999999999x",
"%99999999999n",
"%p%p%p%p",
"%p%p%p%p%p%p%p%p%p%p",
"%p * 55",
"%p * 129",
"%p * 257",
"%p * 513",
"%x%x%x%x",
"%x%x%x%x%x%x%x%x%x%x",
"%x * 55",
"%x * 129",
"%x * 257",
"%s * 513",
"%n%n%n%n",
"%n%n%n%n%n%n%n%n%n%n",
"%n * 55",
"%n * 129",
"%n * 257",
"%n * 513",
"%u%u%u%u",
"%u%u%u%u%u%u%u%u%u%u",
"%u * 55",
"%u * 129",
"%u * 257",
"%u * 513",
"%%%%%%%%",
"%%%%%%%%%%%%%%%%%%%%",
"%% * 55",
"%% * 129",
"%% * 257",
"%% * 513",
"%s%p%x%d",
"%s%p%x%d%s%p%x%d%s%p%x%d",
"%s%p%x%d * 55",
"%s%p%x%d * 129",
"%s%p%x%d * 257",
"%s%p%x%d * 513",
".1024d",
"%.2049d",
"%99999999999s",
"%08x",
"%%20d",
"%%20n",
"%%20x",
"%%20s",
"%#0123456x%08x%x%s%p%d%n%o%u%c%h%l%q%j%z%Z%t%i%e%g%f%a%C%S%08x%%",
"%s%p%x%d",
".1024d",
"%.2049d",
"%p%p%p%p",
"%x%x%x%x",
"%d%d%d%d",
"%s%s%s%s",
"%99999999999s",
"%08x",
"%%20d",
"%%20n",
"%%20x",
"%%20s",
"%s%s%s%s%s%s%s%s%s%s",
"%p%p%p%p%p%p%p%p%p%p",
"%#0123456x%08x%x%s%p%d%n%o%u%c%h%l%q%j%z%Z%t%i%e%g%f%a%C%S%08x%%",
"%s x 129",
"%x x 257",
"\"A\" x 33",
"\"A\" x 254",
"\"A\" x 255",
"\"A\" x 511",
"\"A\" x 1023",
"\"A\" x 1024",
"\"A\" x 2047",
"\"A\" x 2048",
"\"A\" x 4096",
"\"A\" x 5000",
"\"A\" x 10000",
"\"A\" x 20000",
"\"A\" x 30000",
"\"A\" x 40000",
"\"A\" x 65530",
"\"A\" x 65536",
"\"A\" x 75536",
"\"%s\" x 4",
"\"%s\" x 8",
"\"%s\" x 15",
"\"%s\" x 30",
"\"%x\" x 1024",
"\"%n\" x 1025",
"\"%s\" x 2048",
"\"%s%n%x%d\" x 5000",
"\"%s\" x 30000",
"\"%s\" x 40000",
"\"%.1024d\"",
"\"%.2048d\"",
"\"%.4096d\"",
"\"%.8200d\"",
"\"%99999999999s\"",
"\"%99999999999d\"",
"\"%99999999999x\"",
"\"%99999999999n\"",
"\"%99999999999s\" x 1000",
"\"%99999999999d\" x 1000",
"\"%99999999999x\" x 1000",
"\"%99999999999n\" x 1000",
"\"%08x\" x 100",
"\"%%20s\" x 1000",
"\"%%20x\" x 1000",
"\"%%20n\" x 1000",
"\"%%20d\" x 1000",
"\"%#0123456x%08x%x%s%p%n%d%o%u%c%h%l%q%j%z%Z%t%i%e%g%f%a%C%S%08x%%#0123456x%%x%%s%%p%%n%%d%%o%%u%%c%%h%%l%%q%%j%%z%%Z%%t%%i%%e%%g%%f%%a%%C%%S%%08x\""
};

for (String invalid : invalidStrings) {
assertFalse(obj.isValidString(invalid), "Expected false for invalid string: " + invalid);
}
for(String invalid : moreInvalidStrings){
assertFalse(obj.isValidString(invalid), "Expected false for invalid string: " + invalid);
}
}
}

0 comments on commit 193ccdc

Please sign in to comment.