patch 4.0

This commit is contained in:
wangzelin.wzl
2022-10-24 10:34:53 +08:00
parent 4ad6e00ec3
commit 93a1074b0c
10533 changed files with 2588271 additions and 2299373 deletions

View File

@ -15,18 +15,18 @@
#include "sql/ob_sql_init.h"
using namespace oceanbase;
// using namespace oceanbase::sql;
//using namespace oceanbase::sql;
using namespace oceanbase::sql;
using namespace oceanbase::common;
namespace test {
namespace test
{
const int64_t SER_BUF_LEN = 10001;
const int64_t ITEM_CNT = 5;
class TestRowkey : public ::testing::Test {
class TestRowkey: public ::testing::Test
{
public:
TestRowkey()
{}
~TestRowkey()
{}
TestRowkey() {}
~TestRowkey() {}
};
TEST_F(TestRowkey, test_serialize)
@ -36,27 +36,27 @@ TEST_F(TestRowkey, test_serialize)
int64_t pos = 0;
// serialize
ObObj objs[ITEM_CNT];
for (int64_t i = 0; i < ITEM_CNT; i++) {
for (int64_t i = 0; i < ITEM_CNT ; i++) {
objs[i].set_int(i);
row_key[i].assign(&objs[i], 1);
pos = 0;
ASSERT_EQ(OB_SUCCESS, row_key[i].serialize(buf[i], SER_BUF_LEN, pos));
}
// deserialize
//deserialize
ObRowkey de_row_key;
for (int i = 0; i < ITEM_CNT; ++i) {
for (int i = 0 ; i < ITEM_CNT; ++i) {
pos = 0;
ASSERT_EQ(OB_SUCCESS, de_row_key.deserialize(buf[i], SER_BUF_LEN, pos));
ASSERT_EQ(true, de_row_key == row_key[i]);
}
}
} // namespace test
}
int main(int argc, char** argv)
int main(int argc, char **argv)
{
init_sql_factories();
OB_LOGGER.set_log_level("TRACE");
::testing::InitGoogleTest(&argc, argv);
::testing::InitGoogleTest(&argc,argv);
return RUN_ALL_TESTS();
}