Skip to content

Commit

Permalink
test: use newer ASSERT_MEM_EQ macro (libuv#4346)
Browse files Browse the repository at this point in the history
Should hopefully make it easier to debug CI flakiness because
currently the test sometimes fails without a clear indication why.

Refs: libuv#4106
  • Loading branch information
bnoordhuis authored Mar 31, 2024
1 parent 46c0e17 commit 17219b8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/test-fs-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,13 @@ static void fs_event_cb_dir_multi_file(uv_fs_event_t* handle,
ASSERT_PTR_EQ(handle, &fs_event);
ASSERT_OK(status);
ASSERT(events == UV_CHANGE || events == UV_RENAME);
#if defined(__APPLE__) || defined(_WIN32) || defined(__linux__)
ASSERT_OK(strncmp(filename, file_prefix, sizeof(file_prefix) - 1));
#else
ASSERT_NE(filename == NULL ||
strncmp(filename, file_prefix, sizeof(file_prefix) - 1) == 0, 0);
#endif
#if defined(__APPLE__) || defined(_WIN32) || defined(__linux__)
ASSERT_NOT_NULL(filename);
ASSERT_MEM_EQ(filename, file_prefix, sizeof(file_prefix) - 1);
#else
if (filename != NULL)
ASSERT_MEM_EQ(filename, file_prefix, sizeof(file_prefix) - 1);
#endif

if (fs_event_created + fs_event_removed == fs_event_file_count) {
/* Once we've processed all create events, delete all files */
Expand Down

0 comments on commit 17219b8

Please sign in to comment.