patch 4.0
This commit is contained in:
@ -17,35 +17,37 @@
|
||||
#include "lib/restore/ob_storage.h"
|
||||
|
||||
using namespace oceanbase::common;
|
||||
class TestObDynamicThreadPool : public ::testing::Test {
|
||||
class TestObDynamicThreadPool: public ::testing::Test
|
||||
{
|
||||
public:
|
||||
TestObDynamicThreadPool()
|
||||
{}
|
||||
virtual ~TestObDynamicThreadPool()
|
||||
{}
|
||||
TestObDynamicThreadPool() {}
|
||||
virtual ~TestObDynamicThreadPool(){}
|
||||
virtual void SetUp()
|
||||
{}
|
||||
{
|
||||
}
|
||||
virtual void TearDown()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
static void SetUpTestCase()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
static void TearDownTestCase()
|
||||
{}
|
||||
|
||||
{
|
||||
}
|
||||
private:
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(TestObDynamicThreadPool);
|
||||
|
||||
protected:
|
||||
// function members
|
||||
protected:
|
||||
};
|
||||
|
||||
class SimpleTask : public ObDynamicThreadTask {
|
||||
class SimpleTask: public ObDynamicThreadTask
|
||||
{
|
||||
public:
|
||||
int process(const bool& is_stop)
|
||||
int process(const bool &is_stop)
|
||||
{
|
||||
UNUSED(is_stop);
|
||||
ATOMIC_INC(&count_);
|
||||
@ -56,6 +58,7 @@ public:
|
||||
|
||||
int64_t SimpleTask::count_ = 0;
|
||||
|
||||
|
||||
TEST_F(TestObDynamicThreadPool, normal)
|
||||
{
|
||||
ObDynamicThreadPool pool;
|
||||
@ -95,13 +98,15 @@ TEST_F(TestObDynamicThreadPool, test_change_thread_num)
|
||||
pool.stop();
|
||||
pool.destroy();
|
||||
ASSERT_EQ(task_count, SimpleTask::count_);
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
mallopt(M_ARENA_MAX, 1); // disable malloc multiple arena pool
|
||||
OB_LOGGER.set_log_level("INFO");
|
||||
OB_LOGGER.set_file_name("test_dynamic_thread_pool.log", true);
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
::testing::InitGoogleTest(&argc,argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user