This arranges for nngfini to be called via atexit in the test version of the library. It also cleans up some of the actual tests to reduce extraneous (and in some cases incorrect) calls to nngfini.
Showing 1 of 26 files from the diff.
src/core/init.c
changed.
Other files ignored by Codecov
tests/udp.c
has changed.
tests/device.c
has changed.
tests/tcp.c
has changed.
tests/httpserver.c
has changed.
tests/stats.c
has changed.
tests/multistress.c
has changed.
tests/tls.c
has changed.
tests/CMakeLists.txt
has changed.
tests/tcpsupp.c
has changed.
tests/tcp6.c
has changed.
tests/inproc.c
has changed.
tests/reqctx.c
has changed.
tests/pipe.c
has changed.
tests/ipcwinsec.c
has changed.
tests/ipc.c
has changed.
tests/reqstress.c
has changed.
tests/zt.c
has changed.
tests/httpclient.c
has changed.
tests/nonblock.c
has changed.
tests/wss.c
has changed.
tests/compat_testutil.c
has changed.
tests/bus.c
has changed.
tests/scalability.c
has changed.
tests/ipcsupp.c
has changed.
tests/ws.c
has changed.
@@ -1,5 +1,5 @@
Loading
1 | 1 | // |
|
2 | - | // Copyright 2020 Staysail Systems, Inc. <info@staysail.tech> |
|
2 | + | // Copyright 2021 Staysail Systems, Inc. <info@staysail.tech> |
|
3 | 3 | // Copyright 2018 Capitar IT Group BV <info@capitar.com> |
|
4 | 4 | // |
|
5 | 5 | // This software is supplied under the terms of the MIT License, a |
@@ -29,6 +29,13 @@
Loading
29 | 29 | nni_mtx_init(&nni_init_mtx); |
|
30 | 30 | NNI_LIST_INIT(&nni_init_list, nni_initializer, i_node); |
|
31 | 31 | nni_inited = true; |
|
32 | + | #ifdef NNG_TEST_LIB |
|
33 | + | static bool cleanup = false; |
|
34 | + | if (!cleanup) { |
|
35 | + | atexit(nng_fini); |
|
36 | + | cleanup = true; |
|
37 | + | } |
|
38 | + | #endif |
|
32 | 39 | ||
33 | 40 | if (((rv = nni_stat_sys_init()) != 0) || |
|
34 | 41 | ((rv = nni_taskq_sys_init()) != 0) || |
Files | Coverage |
---|---|
src | 78.84% |
Project Totals (90 files) | 78.84% |
459874301
459874301
459890093
459890093
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.