platform: cosmetic changes

This commit is contained in:
Pavel Šimerda
2013-07-27 00:42:10 +02:00
parent 00b63b975f
commit afc3c2617a
2 changed files with 10 additions and 6 deletions

View File

@@ -141,11 +141,13 @@ typedef enum {
static ObjectType static ObjectType
object_type_from_nl_object (const struct nl_object *object) object_type_from_nl_object (const struct nl_object *object)
{ {
const char *type_str = nl_object_get_type (object);
g_assert (object); g_assert (object);
if (!strcmp (nl_object_get_type (object), "route/link")) if (!strcmp (type_str, "route/link"))
return 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)) { switch (rtnl_addr_get_family ((struct rtnl_addr *) object)) {
case AF_INET: case AF_INET:
return IP4_ADDRESS; return IP4_ADDRESS;
@@ -154,7 +156,7 @@ object_type_from_nl_object (const struct nl_object *object)
default: default:
g_assert_not_reached (); 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)) { switch (rtnl_route_get_family ((struct rtnl_route *) object)) {
case AF_INET: case AF_INET:
return IP4_ROUTE; return IP4_ROUTE;

View File

@@ -111,10 +111,12 @@ test_cleanup_linux_LDADD = $(PLATFORM_LDADD)
# correctly. # correctly.
@VALGRIND_RULES@ @VALGRIND_RULES@
TESTS = ./test-link-fake ./test-address-fake ./test-route-fake ./test-cleanup-fake 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 ROOTTESTS = test-link-linux test-address-linux test-route-linux test-cleanup-linux
# If explicitly enabled, we can run the root tests # If explicitly enabled, we can run the root tests
if RUN_ROOT_TESTS if RUN_ROOT_TESTS
TESTS += $(ROOTTESTS) TESTS = $(USERTESTS) $(ROOTTESTS)
else
TESTS = $(USERTESTS)
endif endif