Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1342?usp=email
to review the following change.
Change subject: test_networking: use appropriate assert helpers
......................................................................
test_networking: use appropriate assert helpers
Inall unit tests we rely on CMocka's provided assert
helpers.
However, test_networking.c was still on the default
assert() call, which we try to avoid in favour of more
appropriate helpers.
Substitute them all with assert_*() from CMocka.
Change-Id: Ie153b3d5bf19200f225cd09131de8583645110be
Reported-by: Marc Heuse <[email protected]>
Signed-off-by: Antonio Quartulli <[email protected]>
---
M tests/unit_tests/openvpn/test_networking.c
1 file changed, 7 insertions(+), 6 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/42/1342/1
diff --git a/tests/unit_tests/openvpn/test_networking.c
b/tests/unit_tests/openvpn/test_networking.c
index 6a2d09f..1c9cac1 100644
--- a/tests/unit_tests/openvpn/test_networking.c
+++ b/tests/unit_tests/openvpn/test_networking.c
@@ -2,7 +2,8 @@
#include "syshead.h"
#include "networking.h"
-#include <assert.h>
+#include <setjmp.h>
+#include <cmocka.h>
static char *iface = "ovpn-dummy0";
@@ -27,7 +28,7 @@
int ret = net_iface_type(NULL, name, ret_type);
if (ret == 0)
{
- assert(strcmp(type, ret_type) == 0);
+ assert_string_equal(type, ret_type);
}
return ret;
@@ -265,10 +266,10 @@
/* following tests are standalone and do not print any CMD= */
case 8:
- assert(net__iface_new("dummy0815", "dummy") == 0);
- assert(net__iface_type("dummy0815", "dummy") == 0);
- assert(net__iface_del("dummy0815") == 0);
- assert(net__iface_type("dummy0815", NULL) == -ENODEV);
+ assert_int_equal(net__iface_new("dummy0815", "dummy"), 0);
+ assert_int_equal(net__iface_type("dummy0815", "dummy"), 0);
+ assert_int_equal(net__iface_del("dummy0815"), 0);
+ assert_int_equal(net__iface_type("dummy0815", NULL), -ENODEV);
return 0;
default:
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1342?usp=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie153b3d5bf19200f225cd09131de8583645110be
Gerrit-Change-Number: 1342
Gerrit-PatchSet: 1
Gerrit-Owner: ordex <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel