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.

28 lines
604 B

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