@@ -2827,19 +2827,27 @@ LT_BEGIN_AUTO_TEST(basic_suite, get_arg_flat_first_value)
28272827LT_END_AUTO_TEST (get_arg_flat_first_value)
28282828
28292829// Test access and error log callbacks
2830- static std::string access_log_msg;
2831- static std::string error_log_msg;
2830+ struct LogCapture {
2831+ static std::string& access_log_msg () {
2832+ static std::string msg;
2833+ return msg;
2834+ }
2835+ static std::string& error_log_msg () {
2836+ static std::string msg;
2837+ return msg;
2838+ }
2839+ };
28322840
28332841void test_access_logger (const std::string& msg) {
2834- access_log_msg = msg;
2842+ LogCapture:: access_log_msg() = msg;
28352843}
28362844
28372845void test_error_logger (const std::string& msg) {
2838- error_log_msg = msg;
2846+ LogCapture:: error_log_msg() = msg;
28392847}
28402848
28412849LT_BEGIN_AUTO_TEST (basic_suite, log_access_callback)
2842- access_log_msg.clear();
2850+ LogCapture:: access_log_msg() .clear();
28432851
28442852 webserver ws2 = create_webserver(PORT + 70 )
28452853 .log_access(test_access_logger);
@@ -2861,8 +2869,8 @@ LT_BEGIN_AUTO_TEST(basic_suite, log_access_callback)
28612869 LT_CHECK_EQ (s, " OK" );
28622870
28632871 // The access log should have been called with the request info
2864- LT_CHECK_EQ (access_log_msg.find(" /logtest" ) != std::string::npos, true);
2865- LT_CHECK_EQ (access_log_msg.find(" METHOD" ) != std::string::npos, true);
2872+ LT_CHECK_EQ (LogCapture:: access_log_msg() .find(" /logtest" ) != std::string::npos, true);
2873+ LT_CHECK_EQ (LogCapture:: access_log_msg() .find(" METHOD" ) != std::string::npos, true);
28662874
28672875 curl_easy_cleanup (curl);
28682876 ws2.stop();
@@ -2964,7 +2972,7 @@ LT_BEGIN_AUTO_TEST(basic_suite, default_render_method)
29642972 {
29652973 curl_global_init (CURL_GLOBAL_ALL);
29662974 string s;
2967- long http_code = 0 ;
2975+ int64_t http_code = 0 ;
29682976 CURL *curl = curl_easy_init ();
29692977 CURLcode res;
29702978 std::string url = " http://localhost:" + std::to_string (PORT + 73 ) + " /empty" ;
@@ -3144,7 +3152,7 @@ LT_BEGIN_AUTO_TEST(basic_suite, custom_internal_error_resource)
31443152
31453153 curl_global_init (CURL_GLOBAL_ALL);
31463154 string s;
3147- long http_code = 0 ;
3155+ int64_t http_code = 0 ;
31483156 CURL *curl = curl_easy_init();
31493157 CURLcode res;
31503158 std::string url = " http://localhost:" + std::to_string(PORT + 76 ) + " /throw" ;
0 commit comments