Infinite loop when executing test cases
fushar opened this issue · comments
Copying from heiba's post:
I've downloaded your plugin (I like it) and I've set it up and all is working fine, but when I tried to run it, there's an infinite loop of answers i.e.
"Testing PointErasingTwo (250.0 points)
#0: Failed (0.00 secs)
Expected: 2
Received: 1
#1: Passed (0.00 secs)
#2: Passed (0.00 secs)
#3: Passed (0.00 secs)
#4: Passed (0.00 secs)
#5: Runtime Error
#6: Runtime Error
#7: Runtime Error
#8: Runtime Error
#9: Runtime Error
#10: Runtime Error
#11: Runtime Error
#12: Runtime Error
#13: Runtime Error
#14: Runtime Error
#15: Runtime Error
#16: Runtime Error
#17: Runtime Error
#18: Runtime Error
#19: Runtime Error
#20: Runtime Error
#21: Runtime Error
#22: Runtime Error
#23: Runtime Error
#24: Runtime Error
#25: Runtime Error
#26: Runtime Error
#27: Runtime Error
#28: Runtime Error
#29: Runtime Error
#30: Runtime Error
#31: Runtime Error
#32: Runtime Error
#33: Runtime Error
#34: Runtime Error
#35: Runtime Error
#36: Runtime Error
#37: Runtime Error
#38: Runtime Error
#39: Runtime Error
#40: Runtime Error
#41: Runtime Error
#42: Runtime Error
#43: Runtime Error
#44: Runtime Error
#45: Runtime Error
#46: Runtime Error
^CPress any key to continue . . ."
Somewhere in your code, there's a for loop with no end conditions,
int main(int argc, char* argv[])
{
if (argc == 1)
{
cout << "Testing PointErasingTwo (250.0 points)" << endl << endl;
for (int i = 0; ; i++)
{
ostringstream s; s << argv[0] << " " << i;
int exitCode = system(s.str().c_str());
if (exitCode == 1024)
break;
if (exitCode)
cout << "#" << i << ": Runtime Error" << endl;
}
Please check this problem and respond to me as soon as you can, thanks very much