aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2021-07-07 13:41:54 -0700
committerGarrett D'Amore <garrett@damore.org>2021-07-07 13:41:54 -0700
commit34ff91cdbaec8559aad84aacac96541c18288ebc (patch)
tree8706a7971b6c57302653652e6c03364f44e898bf /src
parent04cf36a355ac40a26bbdac3e4d9e10c258a7ea0d (diff)
downloadnng-34ff91cdbaec8559aad84aacac96541c18288ebc.tar.gz
nng-34ff91cdbaec8559aad84aacac96541c18288ebc.tar.bz2
nng-34ff91cdbaec8559aad84aacac96541c18288ebc.zip
Fix LeakAnalyzer complaints due to deferred reap.
Diffstat (limited to 'src')
-rw-r--r--src/sp/protocol/pair1/pair1_poly_test.c4
-rw-r--r--src/testing/nuts.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/sp/protocol/pair1/pair1_poly_test.c b/src/sp/protocol/pair1/pair1_poly_test.c
index f26f7809..dd59e29c 100644
--- a/src/sp/protocol/pair1/pair1_poly_test.c
+++ b/src/sp/protocol/pair1/pair1_poly_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2017 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -128,7 +128,7 @@ test_poly_cooked(void)
CHECK_STR(msg, "DOS");
nng_msg_free(msg);
- NUTS_PASS(nng_close(c1));
+ NUTS_CLOSE(c1);
NUTS_PASS(nng_msg_alloc(&msg, 0));
nng_msg_set_pipe(msg, p1);
diff --git a/src/testing/nuts.h b/src/testing/nuts.h
index 36fb4612..ce75fc66 100644
--- a/src/testing/nuts.h
+++ b/src/testing/nuts.h
@@ -17,6 +17,9 @@
#ifndef NNG_TESTING_NUTS_H
#define NNG_TESTING_NUTS_H
+// Call nng_fini during test finalization -- this avoids leak warnings.
+extern void nng_fini(void);
+#define TEST_FINI nng_fini()
#include "acutest.h"
#include <stdbool.h>