Skip to content

Commit

Permalink
fixed unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Jan 6, 2024
1 parent 8b764ef commit 26a615c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/app/backend/pcmanager/test_known_hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ void tearDown(void) {
}

void test_parse() {
char buf[64];
known_host_t *hosts = known_hosts_parse(FIXTURES_PATH_PREFIX "hosts_read.ini");
TEST_ASSERT_EQUAL_STRING("192.168.1.100", hosts->address);
TEST_ASSERT_EQUAL(0, hosts->port);
sockaddr_get_ip_str(hosts->address, buf, sizeof(buf));
TEST_ASSERT_EQUAL_STRING("192.168.1.100", buf);
TEST_ASSERT_EQUAL(0, sockaddr_get_port(hosts->address));

known_host_t *next = hosts->next;
TEST_ASSERT_EQUAL_STRING("192.168.1.101", next->address);
TEST_ASSERT_EQUAL(47985, next->port);
sockaddr_get_ip_str(next->address, buf, sizeof(buf));
TEST_ASSERT_EQUAL_STRING("192.168.1.101", buf);
TEST_ASSERT_EQUAL(47985, sockaddr_get_port(next->address));

known_hosts_free(hosts, known_hosts_node_free);
}
Expand Down

0 comments on commit 26a615c

Please sign in to comment.