diff --git a/tests/test_Error.c b/tests/test_Error.c index ba28ac2..c4afd6d 100644 --- a/tests/test_Error.c +++ b/tests/test_Error.c @@ -12,29 +12,39 @@ void test_error() /*arrange*/ srand(time(0)); int bound = 1000; - int val1,val2,val3,val4,val5,val6,val7,val8,val9,val10; + int invalidErrorCodes_1[bound]; + int invalidErrorCodesLarge_2[bound]; + int invalidErrorCodesLargest_3[bound]; - /*act*/ - val1 = rand() % 1000 + 1; - val2 = rand() % 1000 + 1; - val3 = rand() % 1000 + 1; - val4 = rand() % 1000 + 1; - val5 = rand() % 1000 + 1; - val6 = rand() % 1000 + 1; - val7 = rand() % 1000 + 1; - val8 = rand() % 1000 + 1; - val9 = rand() % 1000 + 1; - val10 = rand() % 1000 + 1; + int validErrorCodeUnsuccessfulLogin[bound]; + int validErrorCodeMaximumNumberOfAttempts[bound]; + int validErrorCodeNoMenuEntryForNumber[bound]; - /*assertions*/ - TEST_ASSERT_EQUAL_INT(0,error(val1)); - TEST_ASSERT_EQUAL_INT(0,error(val2)); - TEST_ASSERT_EQUAL_INT(0,error(val3)); - TEST_ASSERT_EQUAL_INT(0,error(val4)); - TEST_ASSERT_EQUAL_INT(0,error(val5)); - TEST_ASSERT_EQUAL_INT(0,error(val6)); - TEST_ASSERT_EQUAL_INT(0,error(val7)); - TEST_ASSERT_EQUAL_INT(0,error(val8)); - TEST_ASSERT_EQUAL_INT(0,error(val9)); - TEST_ASSERT_EQUAL_INT(0,error(val10)); + for(int i=0;i