aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/address_from_url.cpp
diff options
context:
space:
mode:
authorkenshi84 <kenshi84@protonmail.ch>2016-12-16 12:06:50 +0900
committerkenshi84 <kenshi84@protonmail.ch>2016-12-21 23:12:15 +0900
commit99580adf66b7d2f9d744f8d8a162de1b88955ddf (patch)
treed5da012e2f8bc28d2a3fdff7d4759bd16a46bea0 /tests/unit_tests/address_from_url.cpp
parentMerge pull request #1479 (diff)
downloadmonero-99580adf66b7d2f9d744f8d8a162de1b88955ddf.tar.xz
make openalias also available for solo miner; introduce namespace tools::dns_utils; support integrated address with dns lookup
Diffstat (limited to 'tests/unit_tests/address_from_url.cpp')
-rw-r--r--tests/unit_tests/address_from_url.cpp17
1 files changed, 9 insertions, 8 deletions
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 <string>
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<std::string> addresses = tools::wallet2::addresses_from_url("donate.getmonero.org", dnssec_result);
+ std::vector<std::string> 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<std::string> addresses = tools::wallet2::addresses_from_url("example.invalid", dnssec_result);
+ std::vector<std::string> 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);