diff --git a/gen_lcov.sh b/gen_lcov.sh old mode 100644 new mode 100755 index 988795b..a04a384 --- a/gen_lcov.sh +++ b/gen_lcov.sh @@ -8,8 +8,8 @@ rm UTResport.tar mkdir -p build cd build -cmake -DENABLE_COVERAGE=ON .. -gmake all +cmake -DENABLE_COVERAGE=ON -DBUILD_UNITTEST=ON .. +gmake all -j 4 # init cd .. @@ -18,10 +18,14 @@ lcov -d build -b . --no-external --initial -c -o sevenyou_init.info # run cd build/bin -./auth_tool_test -./object_request_test -./object_op_test -./bucket_op_test +./all-test +#./async-op-test +#./bucket-op-test +#./live-channel-test +#./object-op-test +#./object-request-test +#./object-response-test +#./util-test # second cd ../.. diff --git a/include/response/bucket_resp.h b/include/response/bucket_resp.h index e8bd2de..c835a51 100644 --- a/include/response/bucket_resp.h +++ b/include/response/bucket_resp.h @@ -613,12 +613,14 @@ class GetBucketRefererResp : public BaseResp { std::string GetRefererType() const { return m_referer_type; } std::vector GetDomainList() const { return m_domain_list; } std::string GetEmptyReferConf() const { return m_empty_refer_conf; } + std::string GetVerifySignatureUrl() const {return m_verify_signature_url; } private: std::string m_status; std::string m_referer_type; std::vector m_domain_list; std::string m_empty_refer_conf; + std::string m_verify_signature_url; }; } // namespace qcloud_cos diff --git a/src/op/base_op.cpp b/src/op/base_op.cpp index 66cf0a6..9eead65 100644 --- a/src/op/base_op.cpp +++ b/src/op/base_op.cpp @@ -313,14 +313,16 @@ std::string BaseOp::GetRealUrl(const std::string& host, const std::string& path, dest_path = "/" + dest_path; } - if (m_config->GetSetIntranetOnce() && + if (m_config && + m_config->GetSetIntranetOnce() && m_config->IsUseIntranet() && !m_config->GetIntranetAddr().empty()) { dest_host = m_config->GetIntranetAddr(); } else if (CosSysConfig::IsUseIntranet() && !CosSysConfig::GetIntranetAddr().empty()) { dest_host = CosSysConfig::GetIntranetAddr(); - } else if (!m_config->GetDestDomain().empty()) { + } else if (m_config && + (!m_config->GetDestDomain().empty())) { dest_host = m_config->GetDestDomain(); } else if (!CosSysConfig::GetDestDomain().empty()) { dest_host = CosSysConfig::GetDestDomain(); diff --git a/src/response/bucket_resp.cpp b/src/response/bucket_resp.cpp index 6fe1153..f9ad906 100644 --- a/src/response/bucket_resp.cpp +++ b/src/response/bucket_resp.cpp @@ -1294,10 +1294,12 @@ bool GetBucketRefererResp::ParseFromXmlString(const std::string& body) { m_referer_type = refer_node->value(); } else if ("EmptyReferConfiguration" == node_name) { m_empty_refer_conf = refer_node->value(); + } else if ("VerifySignatureURL" == node_name) { + m_verify_signature_url = refer_node->value(); } else { SDK_LOG_WARN("Unknown field in RefererConfiguration, field_name=%s", node_name.c_str()); - return false; + //return false; } } return true; diff --git a/unittest/src/async_op_test.cpp b/unittest/src/async_op_test.cpp index 61abdfe..499c99f 100644 --- a/unittest/src/async_op_test.cpp +++ b/unittest/src/async_op_test.cpp @@ -196,7 +196,6 @@ enum OpType { ASYNC_OP = 1, MULTI_ASYNC_OP }; #define CHECK_DEL_RESP(resp) ASSERT_EQ(resp.GetContentLength(), 0); -#if 1 TEST_F(AsyncOpTest, AsyncOpWithoutCallback) { std::vector base_file_size_v = { @@ -517,6 +516,7 @@ TEST_F(AsyncOpTest, AsyncOpWithWithDoneCallback) { } } +#if 0 TEST_F(AsyncOpTest, AsyncOpWithConcurrent) { const int concurrent_size = 5; // 并发文件个数为5 std::vector base_file_size_v = { @@ -720,7 +720,7 @@ TEST_F(AsyncOpTest, AsyncOpWithConcurrent) { } } } - +#endif TEST_F(AsyncOpTest, AsyncPutWithException) { // cancel op @@ -978,8 +978,8 @@ TEST_F(AsyncOpTest, AsyncGetWithException) { TestUtils::RemoveFile(local_file_download); } } -#endif +#if 0 TEST_F(AsyncOpTest, AsyncConcurrentWithException) { const int concurrent_size = 5; // 并发数为5 std::vector op_type_v = {ASYNC_OP, MULTI_ASYNC_OP}; @@ -1084,5 +1084,6 @@ TEST_F(AsyncOpTest, AsyncConcurrentWithException) { TestUtils::RemoveFile(local_file_download); } } +#endif } // namespace qcloud_cos diff --git a/unittest/src/bucket_op_test.cpp b/unittest/src/bucket_op_test.cpp index 7626280..20bb55f 100644 --- a/unittest/src/bucket_op_test.cpp +++ b/unittest/src/bucket_op_test.cpp @@ -179,7 +179,7 @@ TEST_F(BucketOpTest, HeadBucketTest) { HeadBucketResp resp; CosResult result = m_client->HeadBucket(req, &resp); EXPECT_TRUE(!result.IsSucc()); - EXPECT_EQ(result.GetHttpStatus(), 400); + EXPECT_EQ(result.GetHttpStatus(), 404); } }