Add the missing linkage of jsoncpp to autotest

This commit is contained in:
Chunting Gu
2019-04-18 09:49:39 +08:00
parent ba9f6c4c23
commit c8409dbdf2
3 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -25,4 +25,4 @@ if(UNIX)
endif()
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
View File
@@ -11,6 +11,11 @@ bool kSslVerify = false;
bool kSslVerify = true;
#endif
static void PrintSeparator() {
static const std::string s_line(80, '-');
std::cout << s_line << std::endl;
}
int main() {
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
@@ -19,6 +24,8 @@ int main() {
session.set_ssl_verify(kSslVerify);
try {
PrintSeparator();
// Using request builder:
auto r = session.Request(webcc::HttpRequestBuilder{}.Get().
Url("http://httpbin.org/get").
@@ -29,6 +36,8 @@ int main() {
std::cout << r->content() << std::endl;
PrintSeparator();
// Using shortcut:
r = session.Get("http://httpbin.org/get",
{ "key1", "value1", "key2", "value2" },
@@ -38,6 +47,8 @@ int main() {
#if WEBCC_ENABLE_SSL
PrintSeparator();
// HTTPS support.
r = session.Get("https://httpbin.org/get");
+2 -1
View File
@@ -169,7 +169,8 @@ public:
// -----------------------------------------------------------------------------
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) {