X Tutup
Skip to content

Commit 6dda9e2

Browse files
author
Sebastiano Merlino
committed
Solved some problems with tests
1 parent a4112b8 commit 6dda9e2

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

test/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ check_PROGRAMS = basic
2424
basic_SOURCES = basic.cpp
2525

2626
noinst_HEADERS = littletest.hpp
27-
AM_CXXFLAGS += -lcurl
27+
AM_CXXFLAGS += -lcurl -Wall -fPIC
2828

2929
TESTS = $(check_PROGRAMS)

test/basic.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ class complete_test_resource : public http_resource<complete_test_resource>
6767
{
6868
*res = new http_string_response("OK", 200, "text/plain");
6969
}
70-
void render_HEAD(const http_request& req, http_response** res)
71-
{
72-
*res = new http_string_response("OK", 200, "text/plain");
73-
}
7470
void render_CONNECT(const http_request& req, http_response** res)
7571
{
7672
*res = new http_string_response("OK", 200, "text/plain");
@@ -133,7 +129,7 @@ LT_BEGIN_AUTO_TEST(basic_suite, read_header)
133129
LT_END_AUTO_TEST(read_header)
134130

135131
LT_BEGIN_AUTO_TEST(basic_suite, complete)
136-
simple_resource* resource = new simple_resource();
132+
complete_test_resource* resource = new complete_test_resource();
137133
ws->register_resource("base", resource);
138134
curl_global_init(CURL_GLOBAL_ALL);
139135
std::string s;
@@ -161,13 +157,6 @@ LT_BEGIN_AUTO_TEST(basic_suite, complete)
161157
LT_ASSERT_EQ(res, 0);
162158
curl_easy_cleanup(curl);
163159

164-
curl = curl_easy_init();
165-
curl_easy_setopt(curl, CURLOPT_URL, "localhost:8080/base");
166-
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "HEAD");
167-
res = curl_easy_perform(curl);
168-
LT_ASSERT_EQ(res, 0);
169-
curl_easy_cleanup(curl);
170-
171160
curl = curl_easy_init();
172161
curl_easy_setopt(curl, CURLOPT_URL, "localhost:8080/base");
173162
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "CONNECT");

0 commit comments

Comments
 (0)
X Tutup