Skip to content

Commit

Permalink
Add debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Jan 16, 2025
1 parent 7d43a4d commit 17d167c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/z_api_matching_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void on_drop(void* context) {
}

void test_matching_sub(bool background) {
printf("test_matching_sub: background=%d\n", background);
fprintf(stderr, "test_matching_sub: background=%d\n", background);

context_t context = {0};
_context_init(&context);
Expand Down Expand Up @@ -161,23 +161,30 @@ void test_matching_sub(bool background) {

z_publisher_drop(z_publisher_move(&pub));

fprintf(stderr, "test_matching_sub 0\n");
z_sleep_s(10);
_context_wait(&context, DROP, 10);

fprintf(stderr, "test_matching_sub 1\n");
if (!background) {
z_matching_listener_drop(z_matching_listener_move(&matching_listener));
}
fprintf(stderr, "test_matching_sub 2\n");

z_sleep_s(10);
fprintf(stderr, "test_matching_sub \n");
assert_ok(zp_stop_read_task(z_loan_mut(s1)));
assert_ok(zp_stop_read_task(z_loan_mut(s2)));
assert_ok(zp_stop_lease_task(z_loan_mut(s1)));
assert_ok(zp_stop_lease_task(z_loan_mut(s2)));

fprintf(stderr, "test_matching_sub 3\n");
z_session_drop(z_session_move(&s1));
z_session_drop(z_session_move(&s2));

fprintf(stderr, "test_matching_sub 4\n");
_context_drop(&context);
fprintf(stderr, "test_matching_sub 5\n");
}

static void _check_status(z_owned_publisher_t* pub, bool expected) {
Expand Down

0 comments on commit 17d167c

Please sign in to comment.