aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-05-20 14:36:37 +0200
committerRiccardo Spagni <ric@spagni.net>2015-05-20 14:36:38 +0200
commit6f151940495323bdca449cf2f435501d27a29f79 (patch)
tree53645b2c7b585923d8fb1d9d6f4b9646a45bf271 /tests
parentMerge pull request #288 (diff)
parentAllow name@domain.tld for OpenAlias lookups (diff)
downloadmonero-6f151940495323bdca449cf2f435501d27a29f79.tar.xz
Merge pull request #290
fee8424 Allow name@domain.tld for OpenAlias lookups (warptangent) a0fe18f Revert "Allow name@domain.tld for OpenAlias lookups" (warptangent)
Diffstat (limited to 'tests')
-rw-r--r--tests/unit_tests/address_from_url.cpp8
-rw-r--r--tests/unit_tests/dns_resolver.cpp8
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit_tests/address_from_url.cpp b/tests/unit_tests/address_from_url.cpp
index fe2f072de..99df75d74 100644
--- a/tests/unit_tests/address_from_url.cpp
+++ b/tests/unit_tests/address_from_url.cpp
@@ -93,6 +93,14 @@ TEST(AddressFromURL, Success)
{
EXPECT_STREQ(addr.c_str(), addresses[0].c_str());
}
+
+ // OpenAlias address with an @ instead of first .
+ addresses = tools::wallet2::addresses_from_url("donate@getmonero.org", dnssec_result);
+ EXPECT_EQ(1, addresses.size());
+ if (addresses.size() == 1)
+ {
+ EXPECT_STREQ(addr.c_str(), addresses[0].c_str());
+ }
}
TEST(AddressFromURL, Failure)
diff --git a/tests/unit_tests/dns_resolver.cpp b/tests/unit_tests/dns_resolver.cpp
index 6717e990a..0709a773f 100644
--- a/tests/unit_tests/dns_resolver.cpp
+++ b/tests/unit_tests/dns_resolver.cpp
@@ -148,4 +148,12 @@ TEST(DNSResolver, GetTXTRecord)
{
std::cout << "TXT record for donate.getmonero.org: " << rec << std::endl;
}
+
+ // replace first @ with .
+ std::string addr = tools::DNSResolver::instance().get_dns_format_from_oa_address("donate@getmonero.org");
+ EXPECT_STREQ("donate.getmonero.org", addr.c_str());
+
+ // no change
+ addr = tools::DNSResolver::instance().get_dns_format_from_oa_address("donate.getmonero.org");
+ EXPECT_STREQ("donate.getmonero.org", addr.c_str());
}