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.
26 lines
538 B
26 lines
538 B
#include <unity.h>
|
|
#include <limits.h>
|
|
#include "createCustomer.h"
|
|
|
|
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));
|
|
}
|
|
}
|