You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
939 B

#include <unity.h>
#include <time.h>
#include <stdlib.h>
#include <Error.h>
void setUp(){}
void tearDown(){}
void test_error()
{
/*arrange*/
srand(time(0));
int bound = 1000;
int val1,val2,val3,val4,val5,val6,val7,val8,val9,val10;
/*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;
/*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));
}