From 99580adf66b7d2f9d744f8d8a162de1b88955ddf Mon Sep 17 00:00:00 2001 From: kenshi84 Date: Fri, 16 Dec 2016 12:06:50 +0900 Subject: make openalias also available for solo miner; introduce namespace tools::dns_utils; support integrated address with dns lookup --- tests/unit_tests/address_from_url.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/unit_tests/address_from_url.cpp b/tests/unit_tests/address_from_url.cpp index ff163dab9..ad3aca6b4 100644 --- a/tests/unit_tests/address_from_url.cpp +++ b/tests/unit_tests/address_from_url.cpp @@ -31,6 +31,7 @@ #include "gtest/gtest.h" #include "wallet/wallet2.h" +#include "common/dns_utils.h" #include TEST(AddressFromTXT, Success) @@ -42,7 +43,7 @@ TEST(AddressFromTXT, Success) txtr += addr; txtr += ";"; - std::string res = tools::wallet2::address_from_txt_record(txtr); + std::string res = tools::dns_utils::address_from_txt_record(txtr); EXPECT_STREQ(addr.c_str(), res.c_str()); @@ -52,7 +53,7 @@ TEST(AddressFromTXT, Success) txtr2 += "more foobar"; - res = tools::wallet2::address_from_txt_record(txtr2); + res = tools::dns_utils::address_from_txt_record(txtr2); EXPECT_STREQ(addr.c_str(), res.c_str()); @@ -61,7 +62,7 @@ TEST(AddressFromTXT, Success) txtr3 += addr; txtr3 += "; foobar"; - res = tools::wallet2::address_from_txt_record(txtr3); + res = tools::dns_utils::address_from_txt_record(txtr3); EXPECT_STREQ(addr.c_str(), res.c_str()); } @@ -70,13 +71,13 @@ TEST(AddressFromTXT, Failure) { std::string txtr = "oa1:xmr recipient_address=not a real address"; - std::string res = tools::wallet2::address_from_txt_record(txtr); + std::string res = tools::dns_utils::address_from_txt_record(txtr); ASSERT_STREQ("", res.c_str()); txtr += ";"; - res = tools::wallet2::address_from_txt_record(txtr); + res = tools::dns_utils::address_from_txt_record(txtr); ASSERT_STREQ("", res.c_str()); } @@ -86,7 +87,7 @@ TEST(AddressFromURL, Success) bool dnssec_result = false; - std::vector addresses = tools::wallet2::addresses_from_url("donate.getmonero.org", dnssec_result); + std::vector addresses = tools::dns_utils::addresses_from_url("donate.getmonero.org", dnssec_result); EXPECT_EQ(1, addresses.size()); if (addresses.size() == 1) @@ -95,7 +96,7 @@ TEST(AddressFromURL, Success) } // OpenAlias address with an @ instead of first . - addresses = tools::wallet2::addresses_from_url("donate@getmonero.org", dnssec_result); + addresses = tools::dns_utils::addresses_from_url("donate@getmonero.org", dnssec_result); EXPECT_EQ(1, addresses.size()); if (addresses.size() == 1) { @@ -107,7 +108,7 @@ TEST(AddressFromURL, Failure) { bool dnssec_result = false; - std::vector addresses = tools::wallet2::addresses_from_url("example.invalid", dnssec_result); + std::vector addresses = tools::dns_utils::addresses_from_url("example.invalid", dnssec_result); // for a non-existing domain such as "example.invalid", the non-existence is proved with NSEC records ASSERT_TRUE(dnssec_result); -- cgit v1.2.3