aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2014-10-02 16:48:01 +0200
committerRiccardo Spagni <ric@spagni.net>2014-10-02 16:48:05 +0200
commit1cf22b27a6b95e1e44c35157f5c5ccb73efec9da (patch)
tree770a470c84cd8c7c7ef816dd2c34078d5aebbc7a /tests/unit_tests
parentsimplewallet ignoring testnet port in RPC mode (diff)
parentDaemon should now exit on conflicting checkpoints (diff)
downloadmonero-1cf22b27a6b95e1e44c35157f5c5ccb73efec9da.tar.xz
Merge pull request #165
c0bdd51 Daemon should now exit on conflicting checkpoints (Thomas Winget) f0b4138 various changes to runtime checkpoint updating (Thomas Winget) 7568f89 Fixed segfault with checkpoints loading (Thomas Winget) b261d92 DNS checkpoint updating added, and daemon flag to enforce them (Thomas Winget) 30caebf reload checkpoints file every ~hr and print if any fail (Thomas Winget) 0e14491 updated DNSResolver/things that use it for DNSSEC (Thomas Winget) 6f2c2e1 Adding an identical existing checkpoint should not error (Thomas Winget)
Diffstat (limited to 'tests/unit_tests')
-rw-r--r--tests/unit_tests/dns_resolver.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/unit_tests/dns_resolver.cpp b/tests/unit_tests/dns_resolver.cpp
index 27e981ef1..d4b0efe43 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,19 +92,22 @@ 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());
}
TEST(DNSResolver, GetTXTRecord)
{
+ bool avail, valid;
- 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());