[BACK]Return to t_kcov.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / tests / modules

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/tests/modules/t_kcov.c between version 1.9 and 1.10

version 1.9, 2019/04/04 10:53:20 version 1.10, 2019/05/26 01:44:34
Line 339  kcov_basic(bool fd_dup, int mode)
Line 339  kcov_basic(bool fd_dup, int mode)
         ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0,          ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0,
             "Unable to enable kcov ");              "Unable to enable kcov ");
   
         KCOV_STORE(buf[0], 0);          buf[0] = 0;
   
         sleep(0); /* XXX: Is it enough for all trace types? */          sleep(0); /* XXX: Is it enough for all trace types? */
         ATF_REQUIRE_MSG(KCOV_LOAD(buf[0]) != 0, "No records found");          ATF_REQUIRE_MSG(buf[0] != 0, "No records found");
   
         ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_DISABLE) == 0,          ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_DISABLE) == 0,
             "Unable to disable kcov");              "Unable to disable kcov");
Line 409  thread_buffer_access_test_helper(void *p
Line 409  thread_buffer_access_test_helper(void *p
         kcov_int_t *buf = ptr;          kcov_int_t *buf = ptr;
   
         /* Test mapped buffer access from a custom thread */          /* Test mapped buffer access from a custom thread */
         KCOV_STORE(buf[0], KCOV_LOAD(buf[0]));          buf[0] = buf[0];
   
         return NULL;          return NULL;
 }  }
Line 470  ATF_TC_BODY(kcov_thread, tc)
Line 470  ATF_TC_BODY(kcov_thread, tc)
         /* The thread does something, does not matter what exactly. */          /* The thread does something, does not matter what exactly. */
         pthread_create(&thread, NULL, thread_test_helper, __UNVOLATILE(buf));          pthread_create(&thread, NULL, thread_test_helper, __UNVOLATILE(buf));
   
         KCOV_STORE(buf[0], 0);          buf[0] = 0;
         for (i = 0; i < 10000; i++)          for (i = 0; i < 10000; i++)
                 continue;                  continue;
         ATF_REQUIRE_EQ_MSG(KCOV_LOAD(buf[0]), 0,          ATF_REQUIRE_EQ_MSG(buf[0], 0,
             "Records changed in blocked thread");              "Records changed in blocked thread");
   
         pthread_join(thread, NULL);          pthread_join(thread, NULL);
Line 496  multiple_threads_helper(void *ptr __unus
Line 496  multiple_threads_helper(void *ptr __unus
         ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0,          ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0,
             "Unable to enable kcov ");              "Unable to enable kcov ");
   
         KCOV_STORE(buf[0], 0);          buf[0] = 0;
   
         sleep(0);          sleep(0);
         ATF_REQUIRE_MSG(KCOV_LOAD(buf[0]) != 0, "No records found");          ATF_REQUIRE_MSG(buf[0] != 0, "No records found");
   
         ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_DISABLE) == 0,          ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_DISABLE) == 0,
             "Unable to disable kcov");              "Unable to disable kcov");

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

CVSweb <webmaster@jp.NetBSD.org>