Skip to content

Commit ed1fba0

Browse files
committed
Address peer review
1 parent 41c930d commit ed1fba0

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

tests/unittests.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,8 +2372,7 @@ static int test_static_routes(void) {
23722372

23732373
#ifdef WOLFSENTRY_THREADSAFE
23742374
/* if the shared lock leaked, this unlock would succeed. */
2375-
WOLFSENTRY_EXIT_ON_SUCCESS(
2376-
wolfsentry_context_unlock(WOLFSENTRY_CONTEXT_ARGS_OUT));
2375+
WOLFSENTRY_EXIT_ON_FALSE(wolfsentry->lock.state == WOLFSENTRY_LOCK_UNLOCKED);
23772376
#endif
23782377

23792378
/* likewise test that dispatch_by_id does not leak its shared lock
@@ -2391,8 +2390,7 @@ static int test_static_routes(void) {
23912390

23922391
#ifdef WOLFSENTRY_THREADSAFE
23932392
/* if the shared lock leaked, this unlock would succeed. */
2394-
WOLFSENTRY_EXIT_ON_SUCCESS(
2395-
wolfsentry_context_unlock(WOLFSENTRY_CONTEXT_ARGS_OUT));
2393+
WOLFSENTRY_EXIT_ON_FALSE(wolfsentry->lock.state == WOLFSENTRY_LOCK_UNLOCKED);
23962394
#endif
23972395

23982396
WOLFSENTRY_EXIT_ON_FAILURE(
@@ -2651,7 +2649,7 @@ static int test_static_routes(void) {
26512649
| WOLFSENTRY_ROUTE_FLAG_REMOTE_INTERFACE_WILDCARD;
26522650

26532651
/* 192.168.1.0/25 -- intentionally set a low bit that must be masked */
2654-
memcpy(exp_remote_addr, "\xC0\xA8\x01\x01", 4);
2652+
memcpy(exp_remote_addr, "\xC0\xA8\x01\x01", 4); /* NOLINT(bugprone-not-null-terminated-result) */
26552653
exp_route.remote_address = exp_remote_addr;
26562654
exp_route.remote.addr_len = 25;
26572655
exp_route.remote.sa_port = 0;

0 commit comments

Comments
 (0)