fix null mod_name

This commit is contained in:
obdev
2023-04-13 06:46:35 +00:00
committed by ob-robot
parent fdc59d1d46
commit 36e28a5f79
89 changed files with 175 additions and 183 deletions

View File

@ -33,7 +33,7 @@ public:
virtual void SetUp()
{
ASSERT_EQ(0, queue_.init(1024));
ASSERT_EQ(0, queue_.init(1024, ObMemAttr(OB_SERVER_TENANT_ID, ObNewModIds::TEST)));
produce_seq_ = 0;
consume_seq_ = 0;
consume_thread_counter_ = 0;
@ -70,7 +70,7 @@ TEST_F(TestConSeqQueue, basic)
ObConcurrentSeqQueue queue;
void *data = 0;
EXPECT_EQ(0, queue.init(1024));
EXPECT_EQ(0, queue.init(1024, ObMemAttr(OB_SERVER_TENANT_ID, ObNewModIds::TEST)));
EXPECT_EQ(0, queue.push((void*)0, 0, 0));
EXPECT_EQ(0, queue.push((void*)1, 1, 0));

View File

@ -68,7 +68,7 @@ public:
void TestObLogDlist::generate_data(const int64_t count, Type *&datas)
{
datas = (Type *)ob_malloc(sizeof(Type) * count);
datas = (Type *)ob_malloc(sizeof(Type) * count, ObNewModIds::TEST);
OB_ASSERT(NULL != datas);
for (int64_t idx = 0; idx < count; idx++) {
new (datas + idx) Type();

View File

@ -159,7 +159,7 @@ TEST_F(TestObMapQueue, push_pop_test)
EXPECT_TRUE(map_queue.is_inited());
// malloc array
Type *array = (Type *)ob_malloc(sizeof(Type) * VALUE_COUNT);
Type *array = (Type *)ob_malloc(sizeof(Type) * VALUE_COUNT, ObNewModIds::TEST);
OB_ASSERT(NULL != array);
for (int64_t test_type = 0, test_cnt = 4; test_type < test_cnt; ++test_type) {
@ -344,7 +344,7 @@ TEST_F(TestObMapQueue, DISABLED_performance)
TestPopWorker pop_workers[POP_THREAD_NUM];
// malloc array
Type *array = (Type *)ob_malloc(sizeof(Type) * VALUE_COUNT);
Type *array = (Type *)ob_malloc(sizeof(Type) * VALUE_COUNT, ObNewModIds::TEST);
OB_ASSERT(NULL != array);
memset(array, 0, sizeof(Type) * VALUE_COUNT);

View File

@ -71,7 +71,7 @@ public:
void TestObMapQueueThread::generate_data(const int64_t count, Type *&datas)
{
datas = (Type *)ob_malloc(sizeof(Type) * count);
datas = (Type *)ob_malloc(sizeof(Type) * count, ObNewModIds::TEST);
OB_ASSERT(NULL != datas);
for (int64_t idx = 0; idx < count; idx++) {
datas[idx].reset(idx, idx % THREAD_NUM);

View File

@ -48,11 +48,12 @@ public:
TEST_F(TestSeqThread, basic)
{
CThread thread;
ObMemAttr attr(OB_SERVER_TENANT_ID, ObNewModIds::TEST);
// Parameter not legal
EXPECT_EQ(OB_INVALID_ARGUMENT, thread.init(257, 100));
EXPECT_EQ(OB_INVALID_ARGUMENT, thread.init(0, 0));
EXPECT_EQ(OB_INVALID_ARGUMENT, thread.init(257, 100, attr));
EXPECT_EQ(OB_INVALID_ARGUMENT, thread.init(0, 0, attr));
EXPECT_EQ(OB_SUCCESS, thread.init(256, 10000));
EXPECT_EQ(OB_SUCCESS, thread.init(256, 10000, attr));
EXPECT_EQ(OB_SUCCESS, thread.start());
for (int64_t index = 0; index < 1000; index++) {
EXPECT_EQ(OB_SUCCESS, thread.push((void*)(index + 1), index, 0));