diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit_tests/address_from_url.cpp | 17 | ||||
-rw-r--r-- | tests/unit_tests/http_auth.cpp | 8 |
2 files changed, 13 insertions, 12 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); diff --git a/tests/unit_tests/http_auth.cpp b/tests/unit_tests/http_auth.cpp index e37ded34a..7158850b6 100644 --- a/tests/unit_tests/http_auth.cpp +++ b/tests/unit_tests/http_auth.cpp @@ -241,7 +241,7 @@ TEST(HTTP_Auth, MD5) epee::net_utils::http::http_auth::login user{"foo", "bar"}; epee::net_utils::http::http_auth auth{user}; - const auto response = auth.get_response(make_request({})); + const auto response = auth.get_response(make_request(fields{})); ASSERT_TRUE(bool(response)); EXPECT_TRUE(is_unauthorized(*response)); @@ -290,7 +290,7 @@ TEST(HTTP_Auth, MD5_sess) epee::net_utils::http::http_auth::login user{"foo", "bar"}; epee::net_utils::http::http_auth auth{user}; - const auto response = auth.get_response(make_request({})); + const auto response = auth.get_response(make_request(fields{})); ASSERT_TRUE(bool(response)); EXPECT_TRUE(is_unauthorized(*response)); @@ -342,7 +342,7 @@ TEST(HTTP_Auth, MD5_auth) epee::net_utils::http::http_auth::login user{"foo", "bar"}; epee::net_utils::http::http_auth auth{user}; - const auto response = auth.get_response(make_request({})); + const auto response = auth.get_response(make_request(fields{})); ASSERT_TRUE(bool(response)); EXPECT_TRUE(is_unauthorized(*response)); @@ -410,7 +410,7 @@ TEST(HTTP_Auth, MD5_sess_auth) epee::net_utils::http::http_auth::login user{"foo", "bar"}; epee::net_utils::http::http_auth auth{user}; - const auto response = auth.get_response(make_request({})); + const auto response = auth.get_response(make_request(fields{})); ASSERT_TRUE(bool(response)); EXPECT_TRUE(is_unauthorized(*response)); |