Skip to content

Commit 09a533c

Browse files
release300.3.1
1 parent f82ae1a commit 09a533c

10 files changed

+99
-83
lines changed

CMakeLists.txt

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ else()
101101
message(FATAL_ERROR "Failed to find uuid.")
102102
endif()
103103
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE pthread rt uuid)
104+
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION LESS 8)
105+
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -w)
106+
endif()
104107
endif()
105108

106109
if (MSVC)
@@ -126,12 +129,23 @@ if (WITH_UNITTEST)
126129
endif()
127130

128131
if (UNIX)
129-
file(GLOB HEADER_FILES "include/*.h")
130-
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}")
131132
include(GNUInstallDirs)
132-
install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}
133-
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dolphindb
134-
)
133+
if(CMAKE_VERSION VERSION_GREATER "3.23.0")
134+
file(GLOB_RECURSE HEADER_FILES "include/*")
135+
target_sources(${CMAKE_PROJECT_NAME} PUBLIC FILE_SET headers TYPE HEADERS
136+
BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
137+
FILES ${HEADER_FILES}
138+
)
139+
install(TARGETS ${CMAKE_PROJECT_NAME}
140+
FILE_SET headers DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dolphindb
141+
)
142+
else()
143+
install(DIRECTORY "include/"
144+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dolphindb
145+
FILES_MATCHING PATTERN "*"
146+
)
147+
install(TARGETS ${CMAKE_PROJECT_NAME})
148+
endif()
135149
endif()
136150

137151
add_subdirectory(src)

include/DolphinDB.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ enum class ConnectionState {
9898

9999
class EXPORT_DECL DBConnection {
100100
public:
101+
explicit DBConnection(bool enableSSL = false, bool asyncTask = false, int keepAliveTime = 7200, bool compress = false, bool python = false, bool isReverseStreaming = false, bool enableSCRAM = false);
101102
DBConnection(const std::string &host, int port, const std::string &userName="", const std::string &password="")
102-
:DBConnection()
103+
:DBConnection(false)
103104
{
104105
if (!connect(host, port)) {
105106
throw RuntimeException("Failed to connect to server: " + host + ":" + std::to_string(port));
@@ -108,7 +109,6 @@ class EXPORT_DECL DBConnection {
108109
login(userName, password, HAS_OPENSSL);
109110
}
110111
}
111-
explicit DBConnection(bool enableSSL = false, bool asyncTask = false, int keepAliveTime = 7200, bool compress = false, bool python = false, bool isReverseStreaming = false, bool enableSCRAM = false);
112112
DBConnection(DBConnection&& oth) noexcept;
113113
DBConnection& operator=(DBConnection&& oth) noexcept;
114114
virtual ~DBConnection();

src/Util.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
namespace dolphindb{
5353

5454
#if __cplusplus < 201703L
55-
constexpr int Util::BUF_SIZE;
55+
const int Util::BUF_SIZE;
5656
#endif
5757

5858
using std::string;
5959
using std::vector;
6060

6161
static SmartPointer<ConstantFactory> s_constFactory(new ConstantFactory());
6262
const bool Util::LITTLE_ENDIAN_ORDER = isLittleEndian();
63-
std::string Util::VER = "3.00.3.0";
64-
int Util::VERNUM = 30030;
65-
std::string Util::BUILD = "2025.07.02";
63+
std::string Util::VER = "3.00.3.1";
64+
int Util::VERNUM = 30031;
65+
std::string Util::BUILD = "2025.08.22";
6666

6767
int Util::SEQUENCE_SEARCH_NUM_THRESHOLD = 10;
6868
int Util::MAX_LENGTH_FOR_ANY_VECTOR = 1048576;

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ else()
2121
target_compile_options(${TEST_BINARY_NAME} PRIVATE -w -pthread -g -O0)
2222
endif()
2323

24-
find_package(GTest 1.12.0 REQUIRED)
24+
find_package(GTest 1.10.0 REQUIRED)
2525
if (NOT DEFINED API_INSTALL_DIR)
2626
set(API_INSTALL_LIB ${CMAKE_PROJECT_NAME})
2727
else()

test/DataformVectorTest_gtest.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8303,28 +8303,28 @@ class DataformVectorTest_download : public DataformVectorTest, public testing::W
83038303
public:
83048304
static std::vector<std::tuple<std::string, std::string, dolphindb::DATA_TYPE>> getData(){
83058305
return {
8306-
{"x=true false NULL;x", "[1,0,]", dolphindb::DT_BOOL},
8307-
{"x=127c -128c NULL;x", "[127,,]", dolphindb::DT_CHAR},
8308-
{"x=2147483647 -2147483648 NULL;x", "[2147483647,,]", dolphindb::DT_INT},
8309-
{"x=32768h 32767h NULL;x", "[,32767,]", dolphindb::DT_SHORT},
8310-
{"x=9223372036854775807l NULL;x", "[9223372036854775807,]", dolphindb::DT_LONG},
8311-
{"x=3.14f NULL;x", "[3.14,]", dolphindb::DT_FLOAT},
8312-
{"x=3.1415926 NULL;x", "[3.141593,]", dolphindb::DT_DOUBLE},
8313-
{"x=`aaa`bbb`;x", "[\"aaa\",\"bbb\",]", dolphindb::DT_STRING},
8314-
{"x=symbol(`aaa`bbb`);x", "[\"aaa\",\"bbb\",]", dolphindb::DT_SYMBOL},
8315-
{"x=blob(`aaa`bbb`);x", "[\"aaa\",\"bbb\",]", dolphindb::DT_BLOB},
8316-
{"x=int128(`0123456789abcdef0123456789abcdef`);x", "[0123456789abcdef0123456789abcdef,]", dolphindb::DT_INT128},
8317-
{"x=ipaddr('192.168.1.1''');x", "[192.168.1.1,]", dolphindb::DT_IP},
8318-
{"x=uuid('5d212a78-cc48-e3b1-4235-b4d91473ee87''');x", "[5d212a78-cc48-e3b1-4235-b4d91473ee87,]", dolphindb::DT_UUID},
8319-
{"x=2022.01.01 NULL;x", "[2022.01.01,]", dolphindb::DT_DATE},
8320-
{"x=2022.01M NULL;x", "[2022.01M,]", dolphindb::DT_MONTH},
8321-
{"x=13:30:00.000 NULL;x", "[13:30:00.000,]", dolphindb::DT_TIME},
8322-
{"x=23:59m NULL;x", "[23:59m,]", dolphindb::DT_MINUTE},
8323-
{"x=01:08:54 NULL;x", "[01:08:54,]", dolphindb::DT_SECOND},
8324-
{"x=2022.01.01T13:30:00 NULL;x", "[2022.01.01T13:30:00,]", dolphindb::DT_DATETIME},
8325-
{"x=2022.01.01T13:30:00.123 NULL;x", "[2022.01.01T13:30:00.123,]", dolphindb::DT_TIMESTAMP},
8326-
{"x=13:30:00.123456789 NULL;x", "[13:30:00.123456789,]", dolphindb::DT_NANOTIME},
8327-
{"x=2022.01.01T13:30:00.123456789 NULL;x", "[2022.01.01T13:30:00.123456789,]", dolphindb::DT_NANOTIMESTAMP}
8306+
std::make_tuple(std::string("x=true false NULL;x"), std::string("[1,0,]"), dolphindb::DT_BOOL),
8307+
std::make_tuple(std::string("x=127c -128c NULL;x"), std::string("[127,,]"), dolphindb::DT_CHAR),
8308+
std::make_tuple(std::string("x=2147483647 -2147483648 NULL;x"), std::string("[2147483647,,]"), dolphindb::DT_INT),
8309+
std::make_tuple(std::string("x=32768h 32767h NULL;x"), std::string("[,32767,]"), dolphindb::DT_SHORT),
8310+
std::make_tuple(std::string("x=9223372036854775807l NULL;x"), std::string("[9223372036854775807,]"), dolphindb::DT_LONG),
8311+
std::make_tuple(std::string("x=3.14f NULL;x"), std::string("[3.14,]"), dolphindb::DT_FLOAT),
8312+
std::make_tuple(std::string("x=3.1415926 NULL;x"), std::string("[3.141593,]"), dolphindb::DT_DOUBLE),
8313+
std::make_tuple(std::string("x=`aaa`bbb`;x"), std::string("[\"aaa\",\"bbb\",]"), dolphindb::DT_STRING),
8314+
std::make_tuple(std::string("x=symbol(`aaa`bbb`);x"), std::string("[\"aaa\",\"bbb\",]"), dolphindb::DT_SYMBOL),
8315+
std::make_tuple(std::string("x=blob(`aaa`bbb`);x"), std::string("[\"aaa\",\"bbb\",]"), dolphindb::DT_BLOB),
8316+
std::make_tuple(std::string("x=int128(`0123456789abcdef0123456789abcdef`);x"), std::string("[0123456789abcdef0123456789abcdef,]"), dolphindb::DT_INT128),
8317+
std::make_tuple(std::string("x=ipaddr('192.168.1.1''');x"), std::string("[192.168.1.1,]"), dolphindb::DT_IP),
8318+
std::make_tuple(std::string("x=uuid('5d212a78-cc48-e3b1-4235-b4d91473ee87''');x"), std::string("[5d212a78-cc48-e3b1-4235-b4d91473ee87,]"), dolphindb::DT_UUID),
8319+
std::make_tuple(std::string("x=2022.01.01 NULL;x"), std::string("[2022.01.01,]"), dolphindb::DT_DATE),
8320+
std::make_tuple(std::string("x=2022.01M NULL;x"), std::string("[2022.01M,]"), dolphindb::DT_MONTH),
8321+
std::make_tuple(std::string("x=13:30:00.000 NULL;x"), std::string("[13:30:00.000,]"), dolphindb::DT_TIME),
8322+
std::make_tuple(std::string("x=23:59m NULL;x"), std::string("[23:59m,]"), dolphindb::DT_MINUTE),
8323+
std::make_tuple(std::string("x=01:08:54 NULL;x"), std::string("[01:08:54,]"), dolphindb::DT_SECOND),
8324+
std::make_tuple(std::string("x=2022.01.01T13:30:00 NULL;x"), std::string("[2022.01.01T13:30:00,]"), dolphindb::DT_DATETIME),
8325+
std::make_tuple(std::string("x=2022.01.01T13:30:00.123 NULL;x"), std::string("[2022.01.01T13:30:00.123,]"), dolphindb::DT_TIMESTAMP),
8326+
std::make_tuple(std::string("x=13:30:00.123456789 NULL;x"), std::string("[13:30:00.123456789,]"), dolphindb::DT_NANOTIME),
8327+
std::make_tuple(std::string("x=2022.01.01T13:30:00.123456789 NULL;x"), std::string("[2022.01.01T13:30:00.123456789,]"), dolphindb::DT_NANOTIMESTAMP)
83288328
};
83298329
}
83308330
};

test/ScalarTest_gtest.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2733,28 +2733,28 @@ class ScalarTest_download : public ScalarTest, public testing::WithParamInterfac
27332733
public:
27342734
static std::vector<std::tuple<std::string, std::string, dolphindb::DATA_TYPE>> getData(){
27352735
return {
2736-
{"x=false;x", "0", dolphindb::DT_BOOL},
2737-
{"x=127c;x", "127", dolphindb::DT_CHAR},
2738-
{"x=2147483647;x", "2147483647", dolphindb::DT_INT},
2739-
{"x=-32768h;x", "", dolphindb::DT_SHORT},
2740-
{"x=9223372036854775807l;x", "9223372036854775807", dolphindb::DT_LONG},
2741-
{"x=3.14f;x", "3.14", dolphindb::DT_FLOAT},
2742-
{"x=3.1415926;x", "3.141593", dolphindb::DT_DOUBLE},
2743-
{"x=\"hello,world!\";x", "hello,world!", dolphindb::DT_STRING},
2744-
{"x=symbol(`a`b`c)[0];x", "a", dolphindb::DT_SYMBOL},
2745-
{"x=blob(`a`b`c)[0];x", "a", dolphindb::DT_BLOB},
2746-
{"x=int128(`0123456789abcdef0123456789abcdef);x", "0123456789abcdef0123456789abcdef", dolphindb::DT_INT128},
2747-
{"x=ipaddr('192.168.1.1');x", "192.168.1.1", dolphindb::DT_IP},
2748-
{"x=uuid('5d212a78-cc48-e3b1-4235-b4d91473ee87');x", "5d212a78-cc48-e3b1-4235-b4d91473ee87", dolphindb::DT_UUID},
2749-
{"x=date(2022.01.01);x", "2022.01.01", dolphindb::DT_DATE},
2750-
{"x=month('2022.01');x", "2022.01M", dolphindb::DT_MONTH},
2751-
{"x=13:30:00.000;x", "13:30:00.000", dolphindb::DT_TIME},
2752-
{"x=minute(534);x", "08:54m", dolphindb::DT_MINUTE},
2753-
{"x=second(534);x", "00:08:54", dolphindb::DT_SECOND},
2754-
{"x=datetime(2022.01.01T13:30:00);x", "2022.01.01T13:30:00", dolphindb::DT_DATETIME},
2755-
{"x=timestamp(2022.01.01T13:30:00.123);x", "2022.01.01T13:30:00.123", dolphindb::DT_TIMESTAMP},
2756-
{"x=nanotime(13:30:00.123456789);x", "13:30:00.123456789", dolphindb::DT_NANOTIME},
2757-
{"x=nanotimestamp(2022.01.01T13:30:00.123456789);x", "2022.01.01T13:30:00.123456789", dolphindb::DT_NANOTIMESTAMP}
2736+
std::make_tuple(std::string("x=false;x"), std::string("0"), dolphindb::DT_BOOL),
2737+
std::make_tuple(std::string("x=127c;x"), std::string("127"), dolphindb::DT_CHAR),
2738+
std::make_tuple(std::string("x=2147483647;x"), std::string("2147483647"), dolphindb::DT_INT),
2739+
std::make_tuple(std::string("x=-32768h;x"), std::string(""), dolphindb::DT_SHORT),
2740+
std::make_tuple(std::string("x=9223372036854775807l;x"), std::string("9223372036854775807"), dolphindb::DT_LONG),
2741+
std::make_tuple(std::string("x=3.14f;x"), std::string("3.14"), dolphindb::DT_FLOAT),
2742+
std::make_tuple(std::string("x=3.1415926;x"), std::string("3.141593"), dolphindb::DT_DOUBLE),
2743+
std::make_tuple(std::string("x=\"hello,world!\";x"), std::string("hello,world!"), dolphindb::DT_STRING),
2744+
std::make_tuple(std::string("x=symbol(`a`b`c)[0];x"), std::string("a"), dolphindb::DT_SYMBOL),
2745+
std::make_tuple(std::string("x=blob(`a`b`c)[0];x"), std::string("a"), dolphindb::DT_BLOB),
2746+
std::make_tuple(std::string("x=int128(`0123456789abcdef0123456789abcdef);x"), std::string("0123456789abcdef0123456789abcdef"), dolphindb::DT_INT128),
2747+
std::make_tuple(std::string("x=ipaddr('192.168.1.1');x"), std::string("192.168.1.1"), dolphindb::DT_IP),
2748+
std::make_tuple(std::string("x=uuid('5d212a78-cc48-e3b1-4235-b4d91473ee87');x"), std::string("5d212a78-cc48-e3b1-4235-b4d91473ee87"), dolphindb::DT_UUID),
2749+
std::make_tuple(std::string("x=date(2022.01.01);x"), std::string("2022.01.01"), dolphindb::DT_DATE),
2750+
std::make_tuple(std::string("x=month('2022.01');x"), std::string("2022.01M"), dolphindb::DT_MONTH),
2751+
std::make_tuple(std::string("x=13:30:00.000;x"), std::string("13:30:00.000"), dolphindb::DT_TIME),
2752+
std::make_tuple(std::string("x=minute(534);x"), std::string("08:54m"), dolphindb::DT_MINUTE),
2753+
std::make_tuple(std::string("x=second(534);x"), std::string("00:08:54"), dolphindb::DT_SECOND),
2754+
std::make_tuple(std::string("x=datetime(2022.01.01T13:30:00);x"), std::string("2022.01.01T13:30:00"), dolphindb::DT_DATETIME),
2755+
std::make_tuple(std::string("x=timestamp(2022.01.01T13:30:00.123);x"), std::string("2022.01.01T13:30:00.123"), dolphindb::DT_TIMESTAMP),
2756+
std::make_tuple(std::string("x=nanotime(13:30:00.123456789);x"), std::string("13:30:00.123456789"), dolphindb::DT_NANOTIME),
2757+
std::make_tuple(std::string("x=nanotimestamp(2022.01.01T13:30:00.123456789);x"), std::string("2022.01.01T13:30:00.123456789"), dolphindb::DT_NANOTIMESTAMP)
27582758
};
27592759
}
27602760
};

test/StreamingPollingClientTest_gtest.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,10 +1130,10 @@ namespace SPCT
11301130
std::string case_=getCaseName();
11311131
std::string st = case_;
11321132
conn.run("share streamTable(1:0, `sym`val, [SYMBOL, INT]) as "+st+";tableInsert("+st+", `sym1, 1)");
1133-
std::unordered_set<dolphindb::SubscribeState> states;
1133+
std::vector<dolphindb::SubscribeState> states;
11341134

11351135
scfg->callback = [&](const dolphindb::SubscribeState state, const dolphindb::SubscribeInfo &info) {
1136-
states.insert(state);
1136+
states.emplace_back(state);
11371137
EXPECT_EQ(info.tableName, st);
11381138
EXPECT_EQ(info.actionName, "resubTest");
11391139
EXPECT_EQ(info.hostName, HOST);
@@ -1163,21 +1163,22 @@ namespace SPCT
11631163
else{msgs.push_back(msg);}
11641164
};
11651165
ASSERT_EQ(msgs.size(), 2);
1166-
ASSERT_EQ(states.size(), 3);
1167-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Connected), 1);
1168-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Disconnected), 1);
1169-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Resubscribing), 1);
1166+
ASSERT_EQ(states.size(), 4);
1167+
ASSERT_EQ(states[0],dolphindb::SubscribeState::Connected);
1168+
ASSERT_EQ(states[1],dolphindb::SubscribeState::Disconnected);
1169+
ASSERT_EQ(states[2],dolphindb::SubscribeState::Resubscribing);
1170+
ASSERT_EQ(states[3],dolphindb::SubscribeState::Connected);
11701171
}
11711172

11721173
TEST_F(StreamingPollingClientTester, test_new_subscribe_resub_false)
11731174
{
11741175
std::string case_=getCaseName();
11751176
std::string st = case_;
11761177
conn.run("share streamTable(1:0, `sym`val, [SYMBOL, INT]) as "+st+";tableInsert("+st+", `sym1, 1)");
1177-
std::unordered_set<dolphindb::SubscribeState> states;
1178+
std::vector<dolphindb::SubscribeState> states;
11781179

11791180
scfg->callback = [&](const dolphindb::SubscribeState state, const dolphindb::SubscribeInfo &info) {
1180-
states.insert(state);
1181+
states.emplace_back(state);
11811182
EXPECT_EQ(info.tableName, st);
11821183
EXPECT_EQ(info.actionName, "resubTest");
11831184
EXPECT_EQ(info.hostName, HOST);
@@ -1212,8 +1213,7 @@ namespace SPCT
12121213
};
12131214
ASSERT_EQ(msgs.size(), 1);
12141215
ASSERT_EQ(states.size(), 2);
1215-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Connected), 1);
1216-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Disconnected), 1);
1217-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Resubscribing), 0);
1216+
ASSERT_EQ(states[0],dolphindb::SubscribeState::Connected);
1217+
ASSERT_EQ(states[1],dolphindb::SubscribeState::Disconnected);
12181218
}
12191219
}

test/StreamingThreadedClientTest_gtest.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,10 +1935,10 @@ namespace STCT
19351935
};
19361936
std::string st = case_;
19371937
conn.run("share streamTable(1:0, `sym`val, [SYMBOL, INT]) as "+st+";tableInsert("+st+", `sym1, 1)");
1938-
std::unordered_set<dolphindb::SubscribeState> states;
1938+
std::vector<dolphindb::SubscribeState> states;
19391939

19401940
scfg->callback = [&](const dolphindb::SubscribeState state, const dolphindb::SubscribeInfo &info) {
1941-
states.insert(state);
1941+
states.emplace_back(state);
19421942
EXPECT_EQ(info.tableName, st);
19431943
EXPECT_EQ(info.actionName, "resubTest");
19441944
EXPECT_EQ(info.hostName, HOST);
@@ -1958,10 +1958,11 @@ namespace STCT
19581958
threadedClient.unsubscribe(HOST, PORT, st, "resubTest");
19591959

19601960
ASSERT_EQ(msgs.size(), 2);
1961-
ASSERT_EQ(states.size(), 3);
1962-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Connected), 1);
1963-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Disconnected), 1);
1964-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Resubscribing), 1);
1961+
ASSERT_EQ(states.size(), 4);
1962+
ASSERT_EQ(states[0],dolphindb::SubscribeState::Connected);
1963+
ASSERT_EQ(states[1],dolphindb::SubscribeState::Disconnected);
1964+
ASSERT_EQ(states[2],dolphindb::SubscribeState::Resubscribing);
1965+
ASSERT_EQ(states[3],dolphindb::SubscribeState::Connected);
19651966
}
19661967

19671968

@@ -1978,10 +1979,10 @@ namespace STCT
19781979
};
19791980
std::string st = case_;
19801981
conn.run("share streamTable(1:0, `sym`val, [SYMBOL, INT]) as "+st+";tableInsert("+st+", `sym1, 1)");
1981-
std::unordered_set<dolphindb::SubscribeState> states;
1982+
std::vector<dolphindb::SubscribeState> states;
19821983

19831984
scfg->callback = [&](const dolphindb::SubscribeState state, const dolphindb::SubscribeInfo &info) {
1984-
states.insert(state);
1985+
states.emplace_back(state);
19851986
EXPECT_EQ(info.tableName, st);
19861987
EXPECT_EQ(info.actionName, "resubTest");
19871988
EXPECT_EQ(info.hostName, HOST);
@@ -2004,9 +2005,7 @@ namespace STCT
20042005
ASSERT_TRUE(threadedClient.isExit());
20052006
ASSERT_EQ(msgs.size(), 1);
20062007
ASSERT_EQ(states.size(), 2);
2007-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Connected), 1);
2008-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Disconnected), 1);
2009-
ASSERT_EQ(states.count(dolphindb::SubscribeState::Resubscribing), 0);
2008+
ASSERT_EQ(states[0],dolphindb::SubscribeState::Connected);
2009+
ASSERT_EQ(states[1],dolphindb::SubscribeState::Disconnected);
20102010
}
2011-
20122011
}

test/config.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <gtest/gtest.h>
2-
#include <regex>
32
#include "config.h"
3+
#include <algorithm>
44

55
#ifdef _WIN32
66
#include <windows.h>
@@ -45,15 +45,19 @@ std::string getRandString(int len){
4545
std::string getCaseName(){
4646
const auto* test_info = testing::UnitTest::GetInstance()->current_test_info();
4747
std::string case_suite = test_info->test_suite_name();
48+
std::replace(case_suite.begin(), case_suite.end(), '/', '_');
4849
std::string case_name = test_info->name();
49-
return std::regex_replace(case_suite, std::regex("/"), "_") + "_" + std::regex_replace(case_name, std::regex("/"), "_");
50+
std::replace(case_name.begin(), case_name.end(), '/', '_');
51+
return case_suite + "_" + case_name;
5052
}
5153

5254
std::string getCaseNameHash(){
5355
const auto* test_info = testing::UnitTest::GetInstance()->current_test_info();
5456
std::string case_suite = test_info->test_suite_name();
57+
std::replace(case_suite.begin(), case_suite.end(), '/', '_');
5558
std::string case_name = test_info->name();
56-
std::string input = std::regex_replace(case_suite, std::regex("/"), "_") + "_" + std::regex_replace(case_name, std::regex("/"), "_");
59+
std::replace(case_name.begin(), case_name.end(), '/', '_');
60+
std::string input = case_name + "_" + case_name;
5761
std::hash<std::string> hasher;
5862
size_t hashValue = hasher(input);
5963
std::stringstream ss;

test/config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
22
#include <string>
3-
#include <unordered_set>
43
#include <vector>
54
#include "Logger.h"
65
#include "DolphinDB.h"

0 commit comments

Comments
 (0)