From: Damir Tomic Date: Tue, 16 Jun 2015 16:48:26 +0000 (+0200) Subject: socktoa.c: X-Git-Tag: NTP_4_3_42~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d729b4fe7f513cc91f6e5eeb43ce5ce2d23b6a6e;p=thirdparty%2Fntp.git socktoa.c: added new function which replaces EXPECT_NE from gtest bk: 5580535aj-T_dALHNRy4XieqdNTHng --- diff --git a/tests/libntp/run-test-socktoa.c b/tests/libntp/run-test-socktoa.c index 894404a8f..39f56e241 100644 --- a/tests/libntp/run-test-socktoa.c +++ b/tests/libntp/run-test-socktoa.c @@ -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()); } diff --git a/tests/libntp/socktoa.c b/tests/libntp/socktoa.c index dca973ea9..e6f76a5f5 100644 --- a/tests/libntp/socktoa.c +++ b/tests/libntp/socktoa.c @@ -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) {