Add the missing linkage of jsoncpp to autotest
This commit is contained in:
@@ -25,4 +25,4 @@ if(UNIX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${AT_TARGET_NAME} ${AT_SRCS})
|
add_executable(${AT_TARGET_NAME} ${AT_SRCS})
|
||||||
target_link_libraries(${AT_TARGET_NAME} webcc gtest ${TEST_LIBS})
|
target_link_libraries(${AT_TARGET_NAME} webcc jsoncpp gtest ${TEST_LIBS})
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ bool kSslVerify = false;
|
|||||||
bool kSslVerify = true;
|
bool kSslVerify = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void PrintSeparator() {
|
||||||
|
static const std::string s_line(80, '-');
|
||||||
|
std::cout << s_line << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
|
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
|
||||||
|
|
||||||
@@ -19,6 +24,8 @@ int main() {
|
|||||||
session.set_ssl_verify(kSslVerify);
|
session.set_ssl_verify(kSslVerify);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
PrintSeparator();
|
||||||
|
|
||||||
// Using request builder:
|
// Using request builder:
|
||||||
auto r = session.Request(webcc::HttpRequestBuilder{}.Get().
|
auto r = session.Request(webcc::HttpRequestBuilder{}.Get().
|
||||||
Url("http://httpbin.org/get").
|
Url("http://httpbin.org/get").
|
||||||
@@ -29,6 +36,8 @@ int main() {
|
|||||||
|
|
||||||
std::cout << r->content() << std::endl;
|
std::cout << r->content() << std::endl;
|
||||||
|
|
||||||
|
PrintSeparator();
|
||||||
|
|
||||||
// Using shortcut:
|
// Using shortcut:
|
||||||
r = session.Get("http://httpbin.org/get",
|
r = session.Get("http://httpbin.org/get",
|
||||||
{ "key1", "value1", "key2", "value2" },
|
{ "key1", "value1", "key2", "value2" },
|
||||||
@@ -38,6 +47,8 @@ int main() {
|
|||||||
|
|
||||||
#if WEBCC_ENABLE_SSL
|
#if WEBCC_ENABLE_SSL
|
||||||
|
|
||||||
|
PrintSeparator();
|
||||||
|
|
||||||
// HTTPS support.
|
// HTTPS support.
|
||||||
|
|
||||||
r = session.Get("https://httpbin.org/get");
|
r = session.Get("https://httpbin.org/get");
|
||||||
|
|||||||
@@ -169,7 +169,8 @@ public:
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
void PrintSeparator() {
|
void PrintSeparator() {
|
||||||
std::cout << std::string(80, '-') << std::endl;
|
static const std::string s_line(80, '-');
|
||||||
|
std::cout << s_line << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintBook(const Book& book) {
|
void PrintBook(const Book& book) {
|
||||||
|
|||||||
Reference in New Issue
Block a user