Lines Matching refs:std
39 using namespace std::chrono_literals;
54 std::vector<char> query;
55 std::vector<char> answer;
59 std::vector<std::string> servers;
60 std::vector<std::string> domains;
63 std::vector<int32_t> transportTypes;
68 std::vector<res_stats> stats;
72 std::vector<char> makeQuery(int op, const char* qname, int qclass, int qtype) { in makeQuery()
77 return std::vector<char>(buf, buf + len); in makeQuery()
80 std::vector<char> makeAnswer(const std::vector<char>& query, const char* rdata_str, in makeAnswer()
86 std::string rname(question.qname.name); in makeAnswer()
94 header.answers.push_back(std::move(record)); in makeAnswer()
99 return std::vector<char>(answer, answer_end); in makeAnswer()
104 return std::time(nullptr); in currentTime()
109 return std::tie(a.at, a.rtt, a.rcode) == std::tie(b.at, b.rtt, b.rcode); in operator ==()
114 if (std::tie(a.sample_count, a.sample_next) != std::tie(b.sample_count, b.sample_next)) { in operator ==()
125 return std::tie(a.sample_validity, a.success_threshold, a.min_samples, a.max_samples, in operator ==()
127 std::tie(b.sample_validity, b.success_threshold, b.min_samples, b.max_samples, in operator ==()
160 std::vector<char> answer(MAXPACKET); in cacheLookup()
192 int cacheAdd(uint32_t netId, const std::vector<char>& query, const std::vector<char>& answer) { in cacheAdd()
196 int cacheGetExpiration(uint32_t netId, const std::vector<char>& query, time_t* expiration) { in cacheGetExpiration()
216 void expectCacheStats(const std::string& msg, uint32_t netId, const CacheStats& expected) { in expectCacheStats()
236 EXPECT_EQ(std::string(domains[i]), expected.setup.domains[i]) << msg; in expectCacheStats()
257 std::chrono::seconds ttl = 10s) { in makeCacheEntry()
289 const std::vector<char> queryEmpty(MAXPACKET, 0); in TEST_F()
290 const std::vector<char> queryTooSmall(DNS_HEADER_SIZE - 1, 0); in TEST_F()
346 std::vector<char> answerFromCache; in TEST_F()
378 std::string rdata; in TEST_F()
387 std::string name = android::base::StringPrintf("cache.lookup.type.%s", t.rdata.c_str()); in TEST_F()
400 const std::vector<char> queryEmpty(MAXPACKET, 0); in TEST_F()
401 const std::vector<char> queryTooSmall(DNS_HEADER_SIZE - 1, 0); in TEST_F()
402 std::vector<char> answerTooSmall(DNS_HEADER_SIZE - 1, 0); in TEST_F()
404 auto cacheLookupFn = [](const std::vector<char>& query, in TEST_F()
405 std::vector<char> answer) -> ResolvCacheStatus { in TEST_F()
443 std::this_thread::sleep_for(1500ms); in TEST_F()
453 std::atomic_bool done(false); in TEST_F()
459 std::vector<std::thread> threads(5); in TEST_F()
460 for (std::thread& thread : threads) { in TEST_F()
461 thread = std::thread([&]() { in TEST_F()
472 std::this_thread::sleep_for(100ms); in TEST_F()
483 std::this_thread::sleep_for(100ms); in TEST_F()
489 for (std::thread& thread : threads) { in TEST_F()
498 std::atomic_bool done(false); in TEST_F()
502 std::vector<std::thread> threads(5); in TEST_F()
503 for (std::thread& thread : threads) { in TEST_F()
504 thread = std::thread([&]() { in TEST_F()
513 std::this_thread::sleep_for(100ms); in TEST_F()
519 for (std::thread& thread : threads) { in TEST_F()
529 std::atomic_bool done(false); in TEST_F()
533 std::vector<std::thread> threads(5); in TEST_F()
534 for (std::thread& thread : threads) { in TEST_F()
535 thread = std::thread([&]() { in TEST_F()
544 std::this_thread::sleep_for(100ms); in TEST_F()
550 std::this_thread::sleep_for(100ms); in TEST_F()
556 for (std::thread& thread : threads) { in TEST_F()
563 std::vector<CacheEntry> ces; in TEST_F()
566 std::string qname = android::base::StringPrintf("cache.%04d", i); in TEST_F()
575 std::string qname = android::base::StringPrintf("cache.%04d", i); in TEST_F()
600 std::string qname = android::base::StringPrintf("cache.%04d", i); in TEST_F()
608 std::this_thread::sleep_for(1500ms); in TEST_F()
642 const std::string invalidServers[]{ in TEST_F()
667 const std::vector<std::string> servers = {"127.0.0.1", "fe80::1"}; in TEST_F()
668 const std::string domainTooLong(MAXDNSRCHPATH, '1'); in TEST_F()
669 const std::string validDomain1(MAXDNSRCHPATH - 1, '2'); in TEST_F()
670 const std::string validDomain2(MAXDNSRCHPATH - 1, '3'); in TEST_F()
699 const std::vector<std::string> servers = {"127.0.0.1", "::127.0.0.2", "fe80::1", "fe80::2", in TEST_F()
701 const std::vector<std::string> domains = {"d1.com", "d2.com", "d3.com", "d4.com", in TEST_F()
713 .setup = {.servers = std::vector(servers.begin(), servers.begin() + MAXNS), in TEST_F()
714 .domains = std::vector(domains.begin(), domains.begin() + MAXDNSRCH), in TEST_F()
860 std::vector<IPSockAddr> nameserverSockAddrs = { in TEST_F()