chiark / gitweb /
test-network: fix off-by-one error in test
authorTom Gundersen <teg@jklm.no>
Sun, 31 Aug 2014 17:22:33 +0000 (19:22 +0200)
committerTom Gundersen <teg@jklm.no>
Sun, 31 Aug 2014 17:22:33 +0000 (19:22 +0200)
src/network/test-network.c

index 3dc051d..ea9f938 100644 (file)
@@ -96,9 +96,9 @@ static void test_deserialize_dhcp_routes(void) {
                 assert_se(routes[0].gw_addr.s_addr == inet_addr("192.168.0.1"));
                 assert_se(routes[0].dst_prefixlen == 16);
 
-                assert_se(routes[2].dst_addr.s_addr == inet_addr("0.0.0.0"));
-                assert_se(routes[2].gw_addr.s_addr == inet_addr("10.0.1.1"));
-                assert_se(routes[2].dst_prefixlen == 0);
+                assert_se(routes[1].dst_addr.s_addr == inet_addr("0.0.0.0"));
+                assert_se(routes[1].gw_addr.s_addr == inet_addr("10.0.1.1"));
+                assert_se(routes[1].dst_prefixlen == 0);
         }
 
         {