summaryrefslogtreecommitdiff
path: root/test/ares-test-misc.cc
diff options
context:
space:
mode:
authorYu Jiung <jiung.yu@samsung.com>2016-11-09 11:24:14 +0900
committerYu Jiung <jiung.yu@samsung.com>2016-11-09 11:24:20 +0900
commit04b1a8c051547b221a3bdd74d68ab02df3e3f752 (patch)
tree68d564a70d38771969fc9f946fb16792e8d4f7f7 /test/ares-test-misc.cc
parentf57d349bba373ddb713a249cb2866198346ae011 (diff)
parent8e609b5f488d486a9e066ed494218d966f489938 (diff)
downloadc-ares-04b1a8c051547b221a3bdd74d68ab02df3e3f752.tar.gz
c-ares-04b1a8c051547b221a3bdd74d68ab02df3e3f752.tar.bz2
c-ares-04b1a8c051547b221a3bdd74d68ab02df3e3f752.zip
Merge branch 'upstream' into tizen
Change-Id: If7b14a6bca2079b3cc58a0432a9eb05a41ea5ceb
Diffstat (limited to 'test/ares-test-misc.cc')
-rw-r--r--test/ares-test-misc.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ares-test-misc.cc b/test/ares-test-misc.cc
index bde4678..5e5bc0b 100644
--- a/test/ares-test-misc.cc
+++ b/test/ares-test-misc.cc
@@ -193,6 +193,19 @@ TEST_F(LibraryTest, CreateQuery) {
EXPECT_EQ(expected, actual);
}
+TEST_F(LibraryTest, CreateQueryTrailingEscapedDot) {
+ byte* p;
+ int len;
+ EXPECT_EQ(ARES_SUCCESS,
+ ares_create_query("example.com\\.", ns_c_in, ns_t_a, 0x1234, 0,
+ &p, &len, 0));
+ std::vector<byte> data(p, p + len);
+ ares_free_string(p);
+
+ std::string actual = PacketToString(data);
+ EXPECT_EQ("REQ QRY Q:{'example.com\\.' IN A}", actual);
+}
+
TEST_F(LibraryTest, CreateQueryFailures) {
byte* p;
int len;