patch 4.0
This commit is contained in:
@ -14,38 +14,41 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include "sql/engine/expr/ob_expr_lrpad.h"
|
||||
#include "ob_expr_test_utils.h"
|
||||
#include "share/ob_worker.h"
|
||||
#include "lib/worker.h"
|
||||
|
||||
using namespace oceanbase::common;
|
||||
using namespace oceanbase::sql;
|
||||
using namespace oceanbase::share;
|
||||
|
||||
class ObExprLRpadTest : public ::testing::Test {
|
||||
class ObExprLRpadTest : public ::testing::Test
|
||||
{
|
||||
public:
|
||||
ObExprLRpadTest();
|
||||
virtual ~ObExprLRpadTest();
|
||||
virtual void SetUp();
|
||||
virtual void TearDown();
|
||||
|
||||
private:
|
||||
// disallow copy
|
||||
ObExprLRpadTest(const ObExprLRpadTest& other);
|
||||
ObExprLRpadTest& operator=(const ObExprLRpadTest& other);
|
||||
|
||||
ObExprLRpadTest(const ObExprLRpadTest &other);
|
||||
ObExprLRpadTest& operator=(const ObExprLRpadTest &other);
|
||||
private:
|
||||
// data members
|
||||
};
|
||||
ObExprLRpadTest::ObExprLRpadTest()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
ObExprLRpadTest::~ObExprLRpadTest()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
void ObExprLRpadTest::SetUp()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
void ObExprLRpadTest::TearDown()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
#define T(obj, t1, v1, ref_type, ref_value) EXPECT_RESULT1(obj, &buf, calc_result1, t1, v1, ref_type, ref_value)
|
||||
#define F(obj, t1, v1, ref_type, ref_value) EXPECT_FAIL_RESULT1(obj, &buf, calc_result1, t1, v1, ref_type, ref_value)
|
||||
@ -54,8 +57,9 @@ TEST_F(ObExprLRpadTest, lpad_oracle_test)
|
||||
{
|
||||
ObArenaAllocator allocator;
|
||||
ObExprOracleLpad lpad(allocator);
|
||||
// LPAD('〝〔',3)
|
||||
char str[] = "〝〔";
|
||||
THIS_WORKER.set_compatibility_mode(ObWorker::CompatMode::ORACLE);
|
||||
THIS_WORKER.set_compatibility_mode(lib::Worker::CompatMode::ORACLE);
|
||||
ObObj text;
|
||||
ObString(strlen(str), str);
|
||||
text.set_char("〝〔");
|
||||
@ -82,9 +86,10 @@ TEST_F(ObExprLRpadTest, lpad_oracle_test)
|
||||
lpad.calc(ObExprBaseLRpad::LPAD_TYPE, text, length, pad_text, expr_ctx, result);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
oceanbase::common::ObLogger::get_logger().set_log_level("DEBUG");
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user