Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions iotdb-client/client-cpp/src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ ELSE()
SET(THRIFT_STATIC_LIB "${CMAKE_SOURCE_DIR}/../../thrift/lib/libthrift.a")
ENDIF()

IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT MSVC)
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
add_link_options(-fsanitize=address)
ENDIF()

# Add the generated source files to the sources for the library.
AUX_SOURCE_DIRECTORY(./generated-sources-cpp SESSION_SRCS)
IF(MSVC)
Expand Down
5 changes: 5 additions & 0 deletions iotdb-client/client-cpp/src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ ELSE()
SET(THRIFT_STATIC_LIB "${CMAKE_SOURCE_DIR}/../../thrift/lib/libthrift.a")
ENDIF()

IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT MSVC)
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
add_link_options(-fsanitize=address)
ENDIF()

ADD_EXECUTABLE(${TARGET_NAME} main.cpp cpp/sessionIT.cpp)
ADD_EXECUTABLE(${TARGET_NAME_RELATIONAL} main_Relational.cpp cpp/sessionRelationalIT.cpp)

Expand Down
16 changes: 8 additions & 8 deletions iotdb-client/client-cpp/src/test/cpp/sessionIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ TEST_CASE("Test insertRecord by string", "[testInsertRecord]") {
while (sessionDataSet->hasNext()) {
long index = 1;
count++;
for (const Field &f: sessionDataSet->next()->fields) {
auto fields = sessionDataSet->next()->fields;
for (const Field &f: fields) {
REQUIRE(f.longV.value() == index);
index++;
}
Expand Down Expand Up @@ -186,7 +187,8 @@ TEST_CASE("Test insertRecords ", "[testInsertRecords]") {
while (sessionDataSet->hasNext()) {
long index = 1;
count++;
for (const Field &f: sessionDataSet->next()->fields) {
auto fields = sessionDataSet->next()->fields;
for (const Field &f: fields) {
REQUIRE(f.longV.value() == index);
index++;
}
Expand Down Expand Up @@ -386,7 +388,8 @@ TEST_CASE("Test insertTablet ", "[testInsertTablet]") {
while (sessionDataSet->hasNext()) {
long index = 0;
count++;
for (const Field& f: sessionDataSet->next()->fields) {
auto fields = sessionDataSet->next()->fields;
for (const Field &f: fields) {
REQUIRE(f.longV.value() == index);
index++;
}
Expand Down Expand Up @@ -436,7 +439,8 @@ TEST_CASE("Test insertTablets ", "[testInsertTablets]") {
while (sessionDataSet->hasNext()) {
long index = 0;
count++;
for (const Field& f: sessionDataSet->next()->fields) {
auto fields = sessionDataSet->next()->fields;
for (const Field &f: fields) {
REQUIRE(f.longV.value() == index);
index++;
}
Expand Down Expand Up @@ -614,10 +618,6 @@ TEST_CASE("Test executeRawDataQuery ", "[executeRawDataQuery]") {
sessionDataSet->setFetchSize(10);
vector<string> columns = sessionDataSet->getColumnNames();
columns = sessionDataSet->getColumnNames();
for (const string &column : columns) {
cout << column << " " ;
}
cout << endl;
REQUIRE(columns[0] == "Time");
REQUIRE(columns[1] == paths[0]);
REQUIRE(columns[2] == paths[1]);
Expand Down
Loading