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
630 B

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