[Openvpn-devel,v2,1/6] Avoid failing_test unused warning in example_test

Message ID 20210422152939.2134046-1-arne@rfc2549.org
State Accepted
Headers show
Series [Openvpn-devel,v2,1/6] Avoid failing_test unused warning in example_test | expand

Commit Message

Arne Schwabe April 22, 2021, 5:29 a.m. UTC
This warnings makes make check fail if Werror is exmaple on
LLVM/Clang on macOS for me.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
 tests/unit_tests/example_test/test.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gert Doering May 2, 2021, 8:53 p.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

Acked-by: Gert Doering <gert@greenie.muc.de>

This might break compilation of the example test on non-gcc/clang platforms.

I do not have one at hand, though - my OpenSolaris box has no Sun CC, so
is using gcc...  and on AIX, I do not compile the test suite anyway (no
cmocka).  So this might come back one day as a patch with #ifdef GCC
around the __attribute__

Your patch has been applied to the master branch.

commit 7f600bd39d6e2b034e5a16f65bc639623ff96ae0
Author: Arne Schwabe
Date:   Thu Apr 22 17:29:34 2021 +0200

     Avoid failing_test unused warning in example_test

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20210422152939.2134046-1-arne@rfc2549.org>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22205.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/tests/unit_tests/example_test/test.c b/tests/unit_tests/example_test/test.c
index bc3fdc17c..ea31b884d 100644
--- a/tests/unit_tests/example_test/test.c
+++ b/tests/unit_tests/example_test/test.c
@@ -38,6 +38,7 @@  int_test_success(void **state)
     assert_int_equal(*answer, 42);
 }
 
+__attribute__((unused))
 static void
 failing_test(void **state)
 {