From afc3c2617aa116dc5498ffbfaaa34907279d0502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20=C5=A0imerda?= Date: Sat, 27 Jul 2013 00:42:10 +0200 Subject: [PATCH] platform: cosmetic changes --- src/platform/nm-linux-platform.c | 8 +++++--- src/platform/tests/Makefile.am | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 85ce20adaf..385c789955 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -141,11 +141,13 @@ typedef enum { static ObjectType object_type_from_nl_object (const struct nl_object *object) { + const char *type_str = nl_object_get_type (object); + g_assert (object); - if (!strcmp (nl_object_get_type (object), "route/link")) + if (!strcmp (type_str, "route/link")) return LINK; - else if (!strcmp (nl_object_get_type (object), "route/addr")) { + else if (!strcmp (type_str, "route/addr")) { switch (rtnl_addr_get_family ((struct rtnl_addr *) object)) { case AF_INET: return IP4_ADDRESS; @@ -154,7 +156,7 @@ object_type_from_nl_object (const struct nl_object *object) default: g_assert_not_reached (); } - } else if (!strcmp (nl_object_get_type (object), "route/route")) { + } else if (!strcmp (type_str, "route/route")) { switch (rtnl_route_get_family ((struct rtnl_route *) object)) { case AF_INET: return IP4_ROUTE; diff --git a/src/platform/tests/Makefile.am b/src/platform/tests/Makefile.am index 713d12fdf9..1e5b3b8648 100644 --- a/src/platform/tests/Makefile.am +++ b/src/platform/tests/Makefile.am @@ -111,10 +111,12 @@ test_cleanup_linux_LDADD = $(PLATFORM_LDADD) # correctly. @VALGRIND_RULES@ -TESTS = ./test-link-fake ./test-address-fake ./test-route-fake ./test-cleanup-fake -ROOTTESTS = ./test-link-linux ./test-address-linux ./test-route-linux ./test-cleanup-linux +USERTESTS = test-link-fake test-address-fake test-route-fake test-cleanup-fake +ROOTTESTS = test-link-linux test-address-linux test-route-linux test-cleanup-linux # If explicitly enabled, we can run the root tests if RUN_ROOT_TESTS -TESTS += $(ROOTTESTS) +TESTS = $(USERTESTS) $(ROOTTESTS) +else +TESTS = $(USERTESTS) endif