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.
29 lines
627 B
29 lines
627 B
#include <unity.h>
|
|
#include <limits.h>
|
|
#include <math.h>
|
|
#include "../src/helperFunctions.c"
|
|
#include "../src/error.c"
|
|
#include "../src/createCustomer.c"
|
|
|
|
void setUp(){}
|
|
void tearDown(){}
|
|
|
|
void test_generateID(){
|
|
|
|
const int test_values = USHRT_MAX;
|
|
|
|
/*initialize blocks by calling generateID()*/
|
|
int *numbers = calloc(test_values, sizeof(int));
|
|
for(int i=0;i<test_values;++i)
|
|
{
|
|
*(numbers+i) = generateID();
|
|
//printf("%d\n", *(numbers+i));
|
|
}
|
|
|
|
/*assertions, range checking*/
|
|
int delta = 5000000, expected = 5000000;
|
|
for(int i=0;i<test_values;++i)
|
|
{
|
|
TEST_ASSERT_INT_WITHIN(delta, expected,*(numbers+i));
|
|
}
|
|
}
|