Lines Matching refs:std
45 typedef std::vector<uint8_t> bytevec;
65 std::string SERVERNAME1 = "dns.example.com";
66 std::string SERVERNAME2 = "dns.example.org";
110 std::unique_ptr<IDnsTlsSocket> createDnsTlsSocket( in createDnsTlsSocket()
115 return std::make_unique<T>(observer); in createDnsTlsSocket()
134 std::thread(&IDnsTlsSocketObserver::onResponse, mObserver, make_echo(id, query)).detach(); in query()
169 std::thread(&IDnsTlsSocketObserver::onResponse, mObserver, response).detach(); in query()
183 std::future<DnsTlsTransport::Result> f = transport.query(makeSlice(QUERY)); in TEST_F()
200 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F()
219 ~FakeSocketDelay() { std::lock_guard guard(mLock); } in ~FakeSocketDelay()
225 std::lock_guard guard(mLock); in query()
235 std::thread(&FakeSocketDelay::sendResponses, this).detach(); in query()
242 std::lock_guard guard(mLock); in sendResponses()
244 std::reverse(std::begin(mResponses), std::end(mResponses)); in sendResponses()
253 std::mutex mLock;
255 std::set<uint16_t> mIds GUARDED_BY(mLock);
256 std::vector<bytevec> mResponses GUARDED_BY(mLock);
267 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F()
286 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F()
306 std::vector<bytevec> queries(FakeSocketDelay::sDelay); in TEST_F()
307 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F()
326 std::vector<bytevec> queries(FakeSocketDelay::sDelay); in TEST_F()
327 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F()
351 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F()
365 EXPECT_EQ(std::future_status::timeout, in TEST_F()
366 result.wait_for(std::chrono::duration<int>::zero())); in TEST_F()
378 std::vector<bytevec> queries(FakeSocketDelay::sDelay); in TEST_F()
379 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F()
398 std::vector<bytevec> queries(FakeSocketDelay::sDelay); in TEST_F()
399 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F()
417 std::unique_ptr<IDnsTlsSocket> createDnsTlsSocket( in createDnsTlsSocket()
449 std::thread mCloser;
475 std::lock_guard guard(mLock); in ~FakeSocketLimited()
493 std::lock_guard guard(mLock); in query()
505 mCloser = std::make_unique<std::thread>(&FakeSocketLimited::sendClose, this); in query()
514 std::lock_guard guard(mLock); in sendClose()
525 std::mutex mLock;
528 std::vector<std::thread> mThreads GUARDED_BY(mLock);
529 std::unique_ptr<std::thread> mCloser GUARDED_BY(mLock);
544 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F()
568 std::vector<bytevec> queries(num_queries); in TEST_F()
569 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F()
596 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F()
620 std::lock_guard guard(mLock); in ~FakeSocketGarbage()
626 std::lock_guard guard(mLock); in query()
637 std::mutex mLock;
638 std::vector<std::thread> mThreads GUARDED_BY(mLock);
662 auto factory = std::make_unique<FakeSocketFactory<FakeSocketEcho>>(); in TEST_F()
663 DnsTlsDispatcher dispatcher(std::move(factory)); in TEST_F()
685 auto factory = std::make_unique<FakeSocketFactory<FakeSocketEcho>>(); in TEST_F()
686 DnsTlsDispatcher dispatcher(std::move(factory)); in TEST_F()
698 std::unique_ptr<IDnsTlsSocket> createDnsTlsSocket( in createDnsTlsSocket()
703 std::lock_guard guard(mLock); in createDnsTlsSocket()
705 return std::make_unique<T>(observer); in createDnsTlsSocket()
707 std::multiset<std::pair<unsigned, DnsTlsServer>> keys;
710 std::mutex mLock;
716 auto factory = std::make_unique<TrackingFakeSocketFactory<FakeSocketDelay>>(); in TEST_F()
718 DnsTlsDispatcher dispatcher(std::move(factory)); in TEST_F()
722 std::vector<std::pair<unsigned, DnsTlsServer>> keys; in TEST_F()
729 std::vector<std::thread> threads; in TEST_F()
852 s1.connectTimeout = std::chrono::milliseconds(4000); in TEST_F()
854 s2.connectTimeout = std::chrono::milliseconds(4000); in TEST_F()
929 std::vector<std::unique_ptr<DnsTlsQueryMap::QueryFuture>> futures(UINT16_MAX + 1); in TEST()
965 void onResponse(std::vector<uint8_t>) override {} in onResponse()
986 auto socket = std::make_unique<DnsTlsSocket>(server, MARK, &observer, &cache); in TEST()
990 auto before = std::chrono::steady_clock::now(); in TEST()
992 auto after = std::chrono::steady_clock::now(); in TEST()
994 LOG(DEBUG) << "Shutdown took " << delay / std::chrono::nanoseconds{1} << "ns"; in TEST()
998 EXPECT_LT(delay, std::chrono::seconds{5}); in TEST()