forked from oceanbase/oceanbase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_physical_plan.cpp
More file actions
53 lines (49 loc) · 1.52 KB
/
Copy pathtest_physical_plan.cpp
File metadata and controls
53 lines (49 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* 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 "share/ob_define.h"
#include "sql/engine/ob_physical_plan.h"
using namespace oceanbase::common;
using namespace oceanbase::share::schema;
namespace oceanbase
{
namespace sql
{
class TestPhysicalPlan : public ::testing::Test
{
public:
TestPhysicalPlan() {}
virtual ~TestPhysicalPlan() {}
virtual void SetUp() {}
virtual void TearDown() {}
};
TEST_F(TestPhysicalPlan, test_get_view_table)
{
ObPhysicalPlan plan;
const int64_t VIEW_COUNT = 5;
EXPECT_EQ(OB_SUCCESS, plan.get_dependency_table().init(VIEW_COUNT));
for (int64_t i = 0; i < VIEW_COUNT; i++) {
ObSchemaObjVersion version;
version.object_id_ = i;
version.object_type_ = DEPENDENCY_VIEW;
version.version_ = i;
EXPECT_EQ(OB_SUCCESS, plan.get_dependency_table().push_back(version));
}
EXPECT_EQ(VIEW_COUNT, plan.get_dependency_table_size());
}
} //namespace sql
} //namespace oceanbase
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}