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.
 
 
 
 

23 lines
489 B

#include "unity.h"
#include <limits.h>
#include "CreateCustomer.h"
void test_generateID(){
srand(time(0));
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));
}
int delta = 5000000, expected = 5000000;
for(int i=0;i<test_values;++i)
{
TEST_ASSERT_INT_WITHIN(delta, expected,*(numbers+i));
}
}