diff options
author | Thomas Winget <tewinget@gmail.com> | 2014-09-25 00:14:22 -0400 |
---|---|---|
committer | Thomas Winget <tewinget@gmail.com> | 2014-09-30 16:21:37 -0400 |
commit | 0e1449135d9de9fd05c393c4c85364a7241d98c1 (patch) | |
tree | bf863c75693c127b7ecccce1097c70df6d84195e /tests/unit_tests/dns_resolver.cpp | |
parent | Adding an identical existing checkpoint should not error (diff) | |
download | monero-0e1449135d9de9fd05c393c4c85364a7241d98c1.tar.xz |
updated DNSResolver/things that use it for DNSSEC
Note: DNSResolver does not yet *use* DNSSEC, but rather this commit is
preparation for including DNSSEC validation. The function in
src/wallet/wallet2.cpp that uses DNSResolver still needs its parameters
updated accordingly.
Diffstat (limited to 'tests/unit_tests/dns_resolver.cpp')
-rw-r--r-- | tests/unit_tests/dns_resolver.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/unit_tests/dns_resolver.cpp b/tests/unit_tests/dns_resolver.cpp index 27e981ef1..defce2c11 100644 --- a/tests/unit_tests/dns_resolver.cpp +++ b/tests/unit_tests/dns_resolver.cpp @@ -37,13 +37,15 @@ TEST(DNSResolver, IPv4Success) { tools::DNSResolver resolver; - auto ips = resolver.get_ipv4("example.com"); + bool avail, valid; + + auto ips = resolver.get_ipv4("example.com", avail, valid); ASSERT_EQ(1, ips.size()); ASSERT_STREQ("93.184.216.119", ips[0].c_str()); - ips = tools::DNSResolver::instance().get_ipv4("example.com"); + ips = tools::DNSResolver::instance().get_ipv4("example.com", avail, valid); ASSERT_EQ(1, ips.size()); @@ -55,11 +57,13 @@ TEST(DNSResolver, IPv4Failure) // guaranteed by IANA/ICANN/RFC to be invalid tools::DNSResolver resolver; - auto ips = resolver.get_ipv4("example.invalid"); + bool avail, valid; + + auto ips = resolver.get_ipv4("example.invalid", avail, valid); ASSERT_EQ(0, ips.size()); - ips = tools::DNSResolver::instance().get_ipv4("example.invalid"); + ips = tools::DNSResolver::instance().get_ipv4("example.invalid", avail, valid); ASSERT_EQ(0, ips.size()); } @@ -68,13 +72,15 @@ TEST(DNSResolver, IPv6Success) { tools::DNSResolver resolver; - auto ips = resolver.get_ipv6("example.com"); + bool avail, valid; + + auto ips = resolver.get_ipv6("example.com", avail, valid); ASSERT_EQ(1, ips.size()); ASSERT_STREQ("2606:2800:220:6d:26bf:1447:1097:aa7", ips[0].c_str()); - ips = tools::DNSResolver::instance().get_ipv6("example.com"); + ips = tools::DNSResolver::instance().get_ipv6("example.com", avail, valid); ASSERT_EQ(1, ips.size()); @@ -86,11 +92,13 @@ TEST(DNSResolver, IPv6Failure) // guaranteed by IANA/ICANN/RFC to be invalid tools::DNSResolver resolver; - auto ips = resolver.get_ipv6("example.invalid"); + bool avail, valid; + + auto ips = resolver.get_ipv6("example.invalid", avail, valid); ASSERT_EQ(0, ips.size()); - ips = tools::DNSResolver::instance().get_ipv6("example.invalid"); + ips = tools::DNSResolver::instance().get_ipv6("example.invalid", avail, valid); ASSERT_EQ(0, ips.size()); } @@ -98,7 +106,7 @@ TEST(DNSResolver, IPv6Failure) TEST(DNSResolver, GetTXTRecord) { - std::vector<std::string> records = tools::DNSResolver::instance().get_txt_record("donate.monero.cc"); + std::vector<std::string> records = tools::DNSResolver::instance().get_txt_record("donate.monero.cc", avail, valid); EXPECT_NE(0, records.size()); |