chiark / gitweb /
sd-rtnl: test - improve test of MTU a bit
authorTom Gundersen <teg@jklm.no>
Mon, 10 Feb 2014 12:28:39 +0000 (13:28 +0100)
committerTom Gundersen <teg@jklm.no>
Mon, 10 Feb 2014 13:53:19 +0000 (14:53 +0100)
We are more likely to catch errors if we don't use '0' as test value.

src/libsystemd/sd-rtnl/test-rtnl.c

index dc2e36c503b4313551a57ca660917f42fe789a70..24015147cda99b21f47ba87bba05bd5b4bd65dc2 100644 (file)
@@ -61,7 +61,7 @@ static void test_link_configure(sd_rtnl *rtnl, int ifindex) {
 static void test_link_get(sd_rtnl *rtnl, int ifindex) {
         sd_rtnl_message *m;
         sd_rtnl_message *r;
 static void test_link_get(sd_rtnl *rtnl, int ifindex) {
         sd_rtnl_message *m;
         sd_rtnl_message *r;
-        unsigned int mtu = 0;
+        unsigned int mtu = 1500;
         unsigned int *mtu_reply;
         void *data;
         uint16_t type;
         unsigned int *mtu_reply;
         void *data;
         uint16_t type;
@@ -96,7 +96,7 @@ static void test_link_get(sd_rtnl *rtnl, int ifindex) {
         /* u32 read back */
         assert(sd_rtnl_message_read(m, &type, (void **) &mtu_reply) == 1);
         assert(type == IFLA_MTU);
         /* u32 read back */
         assert(sd_rtnl_message_read(m, &type, (void **) &mtu_reply) == 1);
         assert(type == IFLA_MTU);
-        assert(*mtu_reply == 0);
+        assert(*mtu_reply == mtu);
 
         assert(sd_rtnl_message_read(m, &type, &data) == 1);
         assert(type == IFLA_GROUP);
 
         assert(sd_rtnl_message_read(m, &type, &data) == 1);
         assert(type == IFLA_GROUP);