@@ -130,6 +130,45 @@ LT_BEGIN_AUTO_TEST(ws_start_stop_suite, start_stop)
130130 }
131131LT_END_AUTO_TEST (start_stop)
132132
133+
134+ LT_BEGIN_AUTO_TEST(ws_start_stop_suite, sweet_kill)
135+ webserver ws = create_webserver(8080 );
136+ ok_resource* ok = new ok_resource();
137+ ws.register_resource(" base" , ok);
138+ ws.start(false );
139+
140+ {
141+ curl_global_init (CURL_GLOBAL_ALL);
142+ std::string s;
143+ CURL *curl = curl_easy_init ();
144+ CURLcode res;
145+ curl_easy_setopt (curl, CURLOPT_URL, " localhost:8080/base" );
146+ curl_easy_setopt (curl, CURLOPT_HTTPGET, 1L );
147+ curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, writefunc);
148+ curl_easy_setopt (curl, CURLOPT_WRITEDATA, &s);
149+ res = curl_easy_perform (curl);
150+ LT_ASSERT_EQ (res, 0 );
151+ LT_CHECK_EQ (s, " OK" );
152+ curl_easy_cleanup (curl);
153+ }
154+
155+ ws.sweet_kill();
156+
157+ {
158+ curl_global_init (CURL_GLOBAL_ALL);
159+ std::string s;
160+ CURL *curl = curl_easy_init ();
161+ CURLcode res;
162+ curl_easy_setopt (curl, CURLOPT_URL, " localhost:8080/base" );
163+ curl_easy_setopt (curl, CURLOPT_HTTPGET, 1L );
164+ curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, writefunc);
165+ curl_easy_setopt (curl, CURLOPT_WRITEDATA, &s);
166+ res = curl_easy_perform (curl);
167+ LT_ASSERT_EQ (res, 7 );
168+ curl_easy_cleanup (curl);
169+ }
170+ LT_END_AUTO_TEST (sweet_kill)
171+
133172LT_BEGIN_AUTO_TEST(ws_start_stop_suite, disable_options)
134173 webserver ws = create_webserver(8080 )
135174 .no_ssl()
0 commit comments