[FEAT MERGE]vos merge into master
Co-authored-by: ZenoWang <wzybuaasoft@163.com> Co-authored-by: zhjc1124 <zhjc1124@gmail.com> Co-authored-by: JiahuaChen <garfieldjia@qq.com>
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
#ob_unittest(test_manage_tenant omt/test_manage_tenant.cpp)
|
||||
storage_unittest(test_worker_pool omt/test_worker_pool.cpp)
|
||||
storage_unittest(test_hfilter_parser table/test_hfilter_parser.cpp)
|
||||
storage_unittest(test_query_response_time mysql/test_query_response_time.cpp)
|
||||
storage_unittest(test_create_executor table/test_create_executor.cpp)
|
||||
|
||||
@ -1,64 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2021 OceanBase
|
||||
* OceanBase CE is licensed under Mulan PubL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PubL v2.
|
||||
* You may obtain a copy of Mulan PubL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPubL-2.0
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PubL v2 for more details.
|
||||
*/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "observer/omt/ob_worker_pool.h"
|
||||
#include "observer/omt/ob_worker_processor.h"
|
||||
#include "observer/ob_server_struct.h"
|
||||
|
||||
using namespace oceanbase::common;
|
||||
using namespace oceanbase::omt;
|
||||
using namespace oceanbase::observer;
|
||||
|
||||
class TestWorkerPool
|
||||
: public ::testing::Test
|
||||
{
|
||||
public:
|
||||
TestWorkerPool()
|
||||
: pool_()
|
||||
{}
|
||||
|
||||
virtual void SetUp()
|
||||
{
|
||||
ASSERT_EQ(OB_SUCCESS, pool_.init(1, 5));
|
||||
}
|
||||
|
||||
virtual void TearDown()
|
||||
{
|
||||
pool_.destroy();
|
||||
}
|
||||
|
||||
protected:
|
||||
ObGlobalContext gctx_;
|
||||
ObWorkerPool pool_;
|
||||
};
|
||||
|
||||
TEST_F(TestWorkerPool, TestName)
|
||||
{
|
||||
ObThWorker* ws[10] = {NULL};
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
ObThWorker *w = pool_.alloc();
|
||||
EXPECT_TRUE(w);
|
||||
ws[i] = w;
|
||||
}
|
||||
//EXPECT_FALSE(pool_.alloc());
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
pool_.free(ws[i]);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
Reference in New Issue
Block a user