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.

27 lines
622 B

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "timequiz.h"
  4. // Test setup function
  5. void setUp(void) {
  6. // This function will be called before each test
  7. }
  8. // Test teardown function
  9. void tearDown(void) {
  10. // This function will be called after each test
  11. }
  12. void test_getRandomQuestionIndex(void) {
  13. int askedQuestions[10] = {0};
  14. int totalQuestions = 10;
  15. // Call the function to get a random question index
  16. int index = getRandomQuestionIndex(askedQuestions, totalQuestions);
  17. // Assert that the index is within the valid range
  18. TEST_ASSERT_TRUE(index >= 0 && index < totalQuestions);
  19. }
  20. #endif //TEST