From 0e1449135d9de9fd05c393c4c85364a7241d98c1 Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Thu, 25 Sep 2014 00:14:22 -0400 Subject: 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. --- tests/unit_tests/dns_resolver.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'tests/unit_tests/dns_resolver.cpp') 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 records = tools::DNSResolver::instance().get_txt_record("donate.monero.cc"); + std::vector records = tools::DNSResolver::instance().get_txt_record("donate.monero.cc", avail, valid); EXPECT_NE(0, records.size()); -- cgit v1.2.3 From 30caebfce3a2445b809125a541cc9958b07d02f5 Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Thu, 25 Sep 2014 01:15:28 -0400 Subject: reload checkpoints file every ~hr and print if any fail also some other minor bug squashing and code formatting --- tests/unit_tests/dns_resolver.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/unit_tests/dns_resolver.cpp') diff --git a/tests/unit_tests/dns_resolver.cpp b/tests/unit_tests/dns_resolver.cpp index defce2c11..d4b0efe43 100644 --- a/tests/unit_tests/dns_resolver.cpp +++ b/tests/unit_tests/dns_resolver.cpp @@ -105,6 +105,7 @@ TEST(DNSResolver, IPv6Failure) TEST(DNSResolver, GetTXTRecord) { + bool avail, valid; std::vector records = tools::DNSResolver::instance().get_txt_record("donate.monero.cc", avail, valid); -- cgit v1.2.3