summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtestapp/c_cpp_files/main.cpp4
-rwxr-xr-xtestapp/c_cpp_files/main2.c6
-rwxr-xr-xtestapp/c_cpp_files/main_array_sum.cpp8
-rwxr-xr-xtestapp/c_cpp_files/main_fact.cpp4
-rwxr-xr-xtestapp/c_cpp_files/main_greatest.cpp14
-rwxr-xr-xtestapp/c_cpp_files/main_palindrome.cpp4
-rwxr-xr-xtestapp/code_server.py2
7 files changed, 31 insertions, 11 deletions
diff --git a/testapp/c_cpp_files/main.cpp b/testapp/c_cpp_files/main.cpp
index ffd110e..ebe1f08 100755
--- a/testapp/c_cpp_files/main.cpp
+++ b/testapp/c_cpp_files/main.cpp
@@ -9,7 +9,7 @@ void check(T expect, T result)
{
if (expect == result)
{
- //printf("Correct:\n Expected %d got %d \n",expect,result);
+ printf("\nCorrect:\n Expected %d got %d \n",expect,result);
}
else
{
@@ -22,8 +22,10 @@ int main(void)
{
int result;
result = add(0,0);
+ printf("Input submitted to the function: 0, 0");
check(0, result);
result = add(2,3);
+ printf("Input submitted to the function: 2 3");
check(5,result);
printf("All Correct\n");
return 0;
diff --git a/testapp/c_cpp_files/main2.c b/testapp/c_cpp_files/main2.c
index 3d28ff6..ccd1768 100755
--- a/testapp/c_cpp_files/main2.c
+++ b/testapp/c_cpp_files/main2.c
@@ -8,11 +8,11 @@ void check(T expect,T result)
{
if (expect == result)
{
- printf("Correct:\n Expected %d got %d \n",expect,result);
+ printf("\nCorrect:\n Expected %d got %d \n",expect,result);
}
else
{
- printf("Incorrect:\n Expected %d got %d \n",expect,result);
+ printf("\nIncorrect:\n Expected %d got %d \n",expect,result);
exit (0);
}
}
@@ -21,8 +21,10 @@ int main(void)
{
int result;
result = add(0,0,0);
+ printf("Input submitted to the function: 0, 0, 0");
check(0, result);
result = add(2,3,3);
+ printf("Input submitted to the function: 2, 3, 3");
check(8,result);
printf("All Correct\n");
}
diff --git a/testapp/c_cpp_files/main_array_sum.cpp b/testapp/c_cpp_files/main_array_sum.cpp
index 72eee46..55b2ebf 100755
--- a/testapp/c_cpp_files/main_array_sum.cpp
+++ b/testapp/c_cpp_files/main_array_sum.cpp
@@ -9,7 +9,7 @@ void check(T expect,T result)
{
if (expect == result)
{
- //printf("Correct:\n Expected %d got %d \n",expect,result);
+ printf("\nCorrect:\n Expected %d got %d \n",expect,result);
}
else
{
@@ -21,11 +21,13 @@ void check(T expect,T result)
int main(void)
{
int result;
- int a[55555] = {1,2,3,0,0};
+ int a[] = {1,2,3,0,0};
result = array_sum(a);
+ printf("Input submitted to the function: {1, 2, 3, 0, 0}");
check(6, result);
int b[] = {1,2,3,4,5};
- result = array_sum(b);
+ result = array_sum(b);
+ printf("Input submitted to the function: {1, 2, 3, 4, 5}");
check(15,result);
printf("All Correct\n");
return 0;
diff --git a/testapp/c_cpp_files/main_fact.cpp b/testapp/c_cpp_files/main_fact.cpp
index ff65456..a4ff230 100755
--- a/testapp/c_cpp_files/main_fact.cpp
+++ b/testapp/c_cpp_files/main_fact.cpp
@@ -9,7 +9,7 @@ void check(T expect, T result)
{
if (expect == result)
{
- //printf("Correct:\n Expected %d got %d \n",expect,result);
+ printf("\nCorrect:\n Expected %d got %d \n",expect,result);
}
else
{
@@ -22,8 +22,10 @@ int main(void)
{
int result;
result = factorial(0);
+ printf("Input submitted to the function: 0");
check(1, result);
result = factorial(3);
+ printf("Input submitted to the function: 3");
check(6, result);
printf("All Correct\n");
return 0;
diff --git a/testapp/c_cpp_files/main_greatest.cpp b/testapp/c_cpp_files/main_greatest.cpp
index fe9ff5b..6d0a7c2 100755
--- a/testapp/c_cpp_files/main_greatest.cpp
+++ b/testapp/c_cpp_files/main_greatest.cpp
@@ -9,7 +9,7 @@ void check(T expect, T result)
{
if (expect == result)
{
- //printf("Correct:\n Expected %d got %d \n",expect,result);
+ printf("\nCorrect:\n Expected %d got %d \n",expect,result);
}
else
{
@@ -22,11 +22,23 @@ int main(void)
{
int result;
result = greatest(1, 2, 3);
+ printf("Input submitted to the function: 1, 2, 3");
check(3, result);
result = greatest(5, 9, 2);
+ printf("Input submitted to the function: 5, 9, 2");
check(9, result);
result = greatest(7, 2, 4);
+ printf("Input submitted to the function: 7, 2, 4");
check(7, result);
+ result = greatest(11, 2, 45);
+ printf("Input submitted to the function: 11, 2, 45");
+ check(45, result);
+ result = greatest(2, 7, 0);
+ printf("Input submitted to the function: 2, 7, 0");
+ check(7, result);
+ result = greatest(9, 6, 5);
+ printf("Input submitted to the function: 9, 6, 5");
+ check(9, result);
printf("All Correct\n");
return 0;
}
diff --git a/testapp/c_cpp_files/main_palindrome.cpp b/testapp/c_cpp_files/main_palindrome.cpp
index a5d67b5..0e66928 100755
--- a/testapp/c_cpp_files/main_palindrome.cpp
+++ b/testapp/c_cpp_files/main_palindrome.cpp
@@ -9,7 +9,7 @@ void check(T expect, T result)
{
if (expect == result)
{
- //printf("Correct:\n Expected %d got %d \n",expect,result);
+ printf("\nCorrect:\n Expected %d got %d \n",expect,result);
}
else
{
@@ -22,8 +22,10 @@ int main(void)
{
bool result;
result = palindrome(123);
+ printf("Input submitted to the function: 123");
check(false, result);
result = palindrome(121);
+ printf("Input submitted to the function: 121");
check(true, result);
printf("All Correct\n");
return 0;
diff --git a/testapp/code_server.py b/testapp/code_server.py
index d6ae75d..19c70b1 100755
--- a/testapp/code_server.py
+++ b/testapp/code_server.py
@@ -204,8 +204,6 @@ class CodeServer(object):
except TimeoutException:
# Runaway code, so kill it.
proc.kill()
- # Re-raise exception.
- #raise
stderr = self.timeout_msg
stdout = ''
return proc, stdout, stderr