Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

fix: weak constraint of ipv4 and incorrect code logic in hostname_from_ip #406

Merged
merged 41 commits into from
Feb 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
1
唐彦昭 committed Feb 27, 2020
commit e3161b9006571dba61b5bff783707273833b082b
3 changes: 2 additions & 1 deletion src/core/tests/hostname_test.cpp
Original file line number Diff line number Diff line change
@@ -27,7 +27,8 @@ TEST(ip_to_hostname, ipv4_validate)
{"172.16.254.1.8080", 0},
{"172.16.254.1:8080.", 0},
{"127.0.0.11:123!", 0},
{"127.0.0.11:123", 1}};
{"127.0.0.11:123", 1},
{"localhost:34601",1}};

for (auto test : tests) {
ASSERT_EQ(rpc_test_ipv4.from_string_ipv4(test.ip.c_str()), test.result);