]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
socktoa.c:
authorDamir Tomic <viperus@ntp.org>
Tue, 16 Jun 2015 16:48:26 +0000 (18:48 +0200)
committerDamir Tomic <viperus@ntp.org>
Tue, 16 Jun 2015 16:48:26 +0000 (18:48 +0200)
  added new function which replaces EXPECT_NE from gtest

bk: 5580535aj-T_dALHNRy4XieqdNTHng

tests/libntp/run-test-socktoa.c
tests/libntp/socktoa.c

index 894404a8f88e22239e41ac120b2ec9e7535bad02..39f56e241c09c450b6301cba16c6fabb95c90f24 100644 (file)
@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
   RUN_TEST(test_ScopedIPv6AddressWithPort, 40);
   RUN_TEST(test_HashEqual, 65);
   RUN_TEST(test_HashNotEqual, 73);
-  RUN_TEST(test_IgnoreIPv6Fields, 82);
+  RUN_TEST(test_IgnoreIPv6Fields, 84);
 
   return (UnityEnd());
 }
index dca973ea97750d269aa3d88c4d2124da952b3ee2..e6f76a5f5f90b908fe6ef58e826c4d35cd14150a 100644 (file)
@@ -77,6 +77,10 @@ void test_HashNotEqual(void) {
 
        TEST_ASSERT_FALSE(IsEqual(input1, input2));
        //TODO : EXPECT_NE(sock_hash(&input1), sock_hash(&input2));
+       //Damir's suggestion below:
+       TEST_ASSERT_FALSE(sock_hash(&input1) == sock_hash(&input2)); 
+       //NOTE: sock_hash returns u_short, so you can compare it with ==
+       //for complex structures you have to write an additional function like bool compare(a,b) 
 }
 
 void test_IgnoreIPv6Fields(void) {