diff options
author | Yu Jiung <jiung.yu@samsung.com> | 2016-11-09 11:23:06 +0900 |
---|---|---|
committer | Yu Jiung <jiung.yu@samsung.com> | 2016-11-09 11:23:15 +0900 |
commit | 8e609b5f488d486a9e066ed494218d966f489938 (patch) | |
tree | 0a169eb7025401e0a14ab5d5e74db5b27954f591 /test/ares-test-misc.cc | |
parent | eb886f120599b2a184db20b527db6dfdfcb7852e (diff) | |
download | c-ares-8e609b5f488d486a9e066ed494218d966f489938.tar.gz c-ares-8e609b5f488d486a9e066ed494218d966f489938.tar.bz2 c-ares-8e609b5f488d486a9e066ed494218d966f489938.zip |
Imported Upstream version 1.12.0upstream/1.12.0
Change-Id: I6a571bddd24d1cb7d64b74bc66e878ccba2ce638
Diffstat (limited to 'test/ares-test-misc.cc')
-rw-r--r-- | test/ares-test-misc.cc | 13 |
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; |