Skip to content

Commit 85e8d4d

Browse files
author
Damir Tomic
committed
socktoa.c:
added new function which replaces EXPECT_NE from gtest bk: 5580535aj-T_dALHNRy4XieqdNTHng
1 parent 8477920 commit 85e8d4d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/libntp/run-test-socktoa.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
5555
RUN_TEST(test_ScopedIPv6AddressWithPort, 40);
5656
RUN_TEST(test_HashEqual, 65);
5757
RUN_TEST(test_HashNotEqual, 73);
58-
RUN_TEST(test_IgnoreIPv6Fields, 82);
58+
RUN_TEST(test_IgnoreIPv6Fields, 84);
5959

6060
return (UnityEnd());
6161
}

tests/libntp/socktoa.c

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ void test_HashNotEqual(void) {
7777

7878
TEST_ASSERT_FALSE(IsEqual(input1, input2));
7979
//TODO : EXPECT_NE(sock_hash(&input1), sock_hash(&input2));
80+
//Damir's suggestion below:
81+
TEST_ASSERT_FALSE(sock_hash(&input1) == sock_hash(&input2));
82+
//NOTE: sock_hash returns u_short, so you can compare it with ==
83+
//for complex structures you have to write an additional function like bool compare(a,b)
8084
}
8185

8286
void test_IgnoreIPv6Fields(void) {

0 commit comments

Comments
 (0)