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

  1. #include <unity.h>
  2. #include <limits.h>
  3. #include "createCustomer.h"
  4. void setUp(){}
  5. void tearDown(){}
  6. void test_generateID(){
  7. const int test_values = USHRT_MAX;
  8. /*initialize blocks by calling generateID()*/
  9. int *numbers = calloc(test_values, sizeof(int));
  10. for(int i=0;i<test_values;++i)
  11. {
  12. *(numbers+i) = generateID();
  13. printf("%d\n", *(numbers+i));
  14. }
  15. /*assertions, range checking*/
  16. int delta = 5000000, expected = 5000000;
  17. for(int i=0;i<test_values;++i)
  18. {
  19. TEST_ASSERT_INT_WITHIN(delta, expected,*(numbers+i));
  20. }
  21. }