diff --git a/README.md b/README.md index 66884879..dba61df0 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ cmake --build . --target [Python](binding/python/example) * Python API is nearly identical to C++ API and covers nearly all the functionalities from C++ API. * Build and install the Python binding as shown [above](#python). -* Run python3 main.py. +* Run `python3 main.py`. ## Documentations diff --git a/include/ccapi_cpp/ccapi_ws_connection.h b/include/ccapi_cpp/ccapi_ws_connection.h index a7a550e6..9ca11bbf 100644 --- a/include/ccapi_cpp/ccapi_ws_connection.h +++ b/include/ccapi_cpp/ccapi_ws_connection.h @@ -91,7 +91,7 @@ class WsConnection CCAPI_FINAL { : url(url), group(group), subscriptionList(subscriptionList), credential(credential), streamPtr(streamPtr) { this->id = this->url + "||" + this->group + "||" + ccapi::toString(this->subscriptionList) + "||" + ccapi::toString(this->credential); this->correlationIdList.reserve(subscriptionList.size()); - std::transform(subscriptionList.cbegin(), subscriptionList.cend(), this->correlationIdList.begin(), + std::transform(subscriptionList.cbegin(), subscriptionList.cend(), std::back_inserter(this->correlationIdList), [](Subscription subscription) { return subscription.getCorrelationId(); }); this->setUrlParts(); } diff --git a/include/ccapi_cpp/service/ccapi_market_data_service.h b/include/ccapi_cpp/service/ccapi_market_data_service.h index cfefae6b..9b8c4677 100644 --- a/include/ccapi_cpp/service/ccapi_market_data_service.h +++ b/include/ccapi_cpp/service/ccapi_market_data_service.h @@ -136,7 +136,7 @@ class MarketDataService : public Service { CCAPI_LOGGER_TRACE("fail"); std::vector correlationIdList; correlationIdList.reserve(subscriptionListGivenInstrumentGroup.size()); - std::transform(subscriptionListGivenInstrumentGroup.cbegin(), subscriptionListGivenInstrumentGroup.cend(), correlationIdList.begin(), + std::transform(subscriptionListGivenInstrumentGroup.cbegin(), subscriptionListGivenInstrumentGroup.cend(), std::back_inserter(correlationIdList), [](Subscription subscription) { return subscription.getCorrelationId(); }); that->onError(Event::Type::SUBSCRIPTION_STATUS, Message::Type::SUBSCRIPTION_FAILURE, ec, "create stream", correlationIdList); return; diff --git a/test/test_unit/src/common/util/ccapi_util_test.cpp b/test/test_unit/src/common/util/ccapi_util_test.cpp index b4315d5e..47e8b334 100644 --- a/test/test_unit/src/common/util/ccapi_util_test.cpp +++ b/test/test_unit/src/common/util/ccapi_util_test.cpp @@ -112,6 +112,14 @@ TEST(UtilStringTest, normalizeDecimalString_5) { EXPECT_EQ(UtilString::normalizeDecimalString(original), "1.1"); EXPECT_EQ(UtilString::normalizeDecimalString(original.c_str()), "1.1"); } +TEST(UtilStringTest, toUpper) { + std::string original("ab"); + EXPECT_EQ(UtilString::toUpper(original), "AB"); +} +TEST(UtilStringTest, toLower) { + std::string original("AB"); + EXPECT_EQ(UtilString::toLower(original), "ab"); +} TEST(UtilTimeTest, divideSecondsStr_1) { std::string str("1634929946"); EXPECT_EQ(UtilTime::divide(str), (std::make_pair(1634929946, 0)));