From 8e609b5f488d486a9e066ed494218d966f489938 Mon Sep 17 00:00:00 2001 From: Yu Jiung Date: Wed, 9 Nov 2016 11:23:06 +0900 Subject: Imported Upstream version 1.12.0 Change-Id: I6a571bddd24d1cb7d64b74bc66e878ccba2ce638 --- test/ares-test-misc.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ares-test-misc.cc') 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 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; -- cgit v1.2.3