@@ -3200,9 +3200,10 @@ class ServerTest : public ::testing::Test {
32003200 [&](const Request & /* req*/ , Response &res) {
32013201 res.set_content (" abcdefg" , " text/plain" );
32023202 })
3203- .Get (" /custom " ,
3203+ .Get (" /test-start-time " ,
32043204 [&](const Request &req, Response &res) {
3205- if (custom_fn) { custom_fn (req, res); }
3205+ EXPECT_NE (req.start_time_ ,
3206+ std::chrono::steady_clock::time_point::min ());
32063207 })
32073208 .Get (" /with-range-customized-response" ,
32083209 [&](const Request & /* req*/ , Response &res) {
@@ -3598,7 +3599,6 @@ class ServerTest : public ::testing::Test {
35983599#endif
35993600 thread t_;
36003601 std::vector<thread> request_threads_;
3601- std::function<void (const Request &, Response &)> custom_fn;
36023602};
36033603
36043604TEST_F (ServerTest, GetMethod200) {
@@ -5806,10 +5806,7 @@ TEST_F(ServerTest, TooManyRedirect) {
58065806}
58075807
58085808TEST_F (ServerTest, StartTime) {
5809- custom_fn = [](const Request &req, Response &res) {
5810- EXPECT_NE (req.start_time_ , std::chrono::steady_clock::time_point::min ());
5811- };
5812- auto res = cli_.Get (" /custom" );
5809+ auto res = cli_.Get (" /test-start-time" );
58135810}
58145811
58155812#ifdef CPPHTTPLIB_ZLIB_SUPPORT
0 commit comments