From 252373e540e7b159f2593365da14b627dea1bcf9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Jan 2021 02:30:43 +0100 Subject: [PATCH] Allow a simple way to rest requesting the given URL in the test This does nothing more than just running a GET request for the given URL for testing purposes. --- tests/net/webrequest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index 6f0f442442..d97eb2bc53 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -287,6 +287,23 @@ TEST_CASE_METHOD(RequestFixture, } } +// This test is not run by default and has to be explicitly selected to run. +TEST_CASE_METHOD(RequestFixture, + "WebRequest::Manual", "[net][webrequest][auth][.]") +{ + // Allow getting 8-bit strings from the environment correctly. + setlocale(LC_ALL, ""); + + wxString url; + if ( !wxGetEnv("WX_TEST_WEBREQUEST_URL", &url) ) + { + FAIL("Specify WX_TEST_WEBREQUEST_URL"); + } + + CreateAbs(url); + Run(wxWebRequest::State_Completed, 0); +} + WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); namespace wxPrivate