coverage: add schUtil.c and schedulerTest

This commit is contained in:
Alex Duan 2024-02-18 11:35:08 +08:00
parent bd0bd62625
commit 524ebca16a
3 changed files with 16 additions and 4 deletions

View File

@ -263,6 +263,7 @@ void schCloseJobRef(void) {
uint64_t schGenTaskId(void) { return atomic_add_fetch_64(&schMgmt.taskId, 1); }
#ifdef BUILD_NO_CALL
uint64_t schGenUUID(void) {
static uint64_t hashId = 0;
static int32_t requestSerialId = 0;
@ -284,6 +285,7 @@ uint64_t schGenUUID(void) {
uint64_t id = ((hashId & 0x0FFF) << 52) | ((pid & 0x0FFF) << 40) | ((ts & 0xFFFFFF) << 16) | (val & 0xFFFF);
return id;
}
#endif
void schFreeRpcCtxVal(const void *arg) {
if (NULL == arg) {

View File

@ -1005,6 +1005,16 @@ TEST(multiThread, forceFree) {
taosSsleep(3);
}
TEST(otherTest, otherCase) {
// excpet test
schReleaseJob(0);
schFreeRpcCtx(NULL);
EXPECT_EQ(schDumpEpSet(NULL), NULL);
EXPECT_EQ(schGetOpStr(SCH_OP_NULL), "NULL");
EXPECT_EQ(schGetOpStr((SCH_OP_TYPE)100, "UNKNOWN");
}
int main(int argc, char **argv) {
taosSeedRand(taosGetTimestampSec());
testing::InitGoogleTest(&argc, argv);

View File

@ -34,7 +34,7 @@ add_test(
COMMAND streamUpdateTest
)
# add_test(
# NAME checkpointTest
# COMMAND checkpointTest
# )
add_test(
NAME checkpointTest
COMMAND checkpointTest
)