summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-02-25 20:23:41 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-02-26 00:00:16 +0100
commit97b5d752d7af198d0b2881b5a3b2e61f2b4921e5 (patch)
tree1b29dd2d5a576a130532ebd349e66994ae196853 /tests/lib
parent*: remove unnecessary semicolon from switches (diff)
downloadfrr-97b5d752d7af198d0b2881b5a3b2e61f2b4921e5.tar.xz
frr-97b5d752d7af198d0b2881b5a3b2e61f2b4921e5.zip
*: use array_size instead of raw division
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/test_privs.c2
-rw-r--r--tests/lib/test_table.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/lib/test_privs.c b/tests/lib/test_privs.c
index e203da8f6..fc3d90866 100644
--- a/tests/lib/test_privs.c
+++ b/tests/lib/test_privs.c
@@ -37,7 +37,7 @@ struct zebra_privs_t test_privs = {
.vty_group = VTY_GROUP,
#endif
.caps_p = _caps_p,
- .cap_num_p = sizeof(_caps_p) / sizeof(_caps_p[0]),
+ .cap_num_p = array_size(_caps_p),
.cap_num_i = 0};
struct option longopts[] = {{"help", no_argument, NULL, 'h'},
diff --git a/tests/lib/test_table.c b/tests/lib/test_table.c
index 2b6504062..90d6c76bf 100644
--- a/tests/lib/test_table.c
+++ b/tests/lib/test_table.c
@@ -478,7 +478,7 @@ static void test_iter_pause(void)
const char *prefixes[] = {"1.0.1.0/24", "1.0.1.0/25", "1.0.1.128/25",
"1.0.2.0/24", "2.0.0.0/8"};
- num_prefixes = sizeof(prefixes) / sizeof(prefixes[0]);
+ num_prefixes = array_size(prefixes);
printf("\n\nTesting that route_table_iter_pause() works as expected\n");
table = route_table_init();