patch 4.0
This commit is contained in:
@ -17,49 +17,50 @@
|
||||
using namespace oceanbase::common;
|
||||
using namespace oceanbase::sql;
|
||||
|
||||
class ObExprLnnvlTest : public ::testing::Test {
|
||||
public:
|
||||
ObExprLnnvlTest();
|
||||
virtual ~ObExprLnnvlTest();
|
||||
virtual void SetUp();
|
||||
virtual void TearDown();
|
||||
|
||||
private:
|
||||
// disallow copy
|
||||
ObExprLnnvlTest(const ObExprLnnvlTest& other);
|
||||
ObExprLnnvlTest& operator=(const ObExprLnnvlTest& other);
|
||||
|
||||
protected:
|
||||
// data members
|
||||
class ObExprLnnvlTest: public ::testing::Test
|
||||
{
|
||||
public:
|
||||
ObExprLnnvlTest();
|
||||
virtual ~ObExprLnnvlTest();
|
||||
virtual void SetUp();
|
||||
virtual void TearDown();
|
||||
private:
|
||||
// disallow copy
|
||||
ObExprLnnvlTest(const ObExprLnnvlTest &other);
|
||||
ObExprLnnvlTest& operator=(const ObExprLnnvlTest &other);
|
||||
protected:
|
||||
// data members
|
||||
};
|
||||
|
||||
ObExprLnnvlTest::ObExprLnnvlTest()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
ObExprLnnvlTest::~ObExprLnnvlTest()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
void ObExprLnnvlTest::SetUp()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
void ObExprLnnvlTest::TearDown()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
#define EXPECT_EQUAL(lnnvl_func, buf, test_obj, result_obj, input_type, input_value, ret_value) \
|
||||
{ \
|
||||
test_obj.set_##input_type(input_value); \
|
||||
OB_ASSERT(OB_SUCCESS == lnnvl_func.calc_result1(result_obj, test_obj, buf)); \
|
||||
OB_ASSERT(ret_value == result_obj.get_bool()); \
|
||||
} \
|
||||
while (0)
|
||||
{ \
|
||||
test_obj.set_##input_type(input_value); \
|
||||
OB_ASSERT(OB_SUCCESS == lnnvl_func.calc_result1(result_obj, test_obj, buf));\
|
||||
OB_ASSERT(ret_value == result_obj.get_bool()); \
|
||||
} while(0)
|
||||
|
||||
#define EXPECT_EQUAL_NULL(lnnvl_func, buf, test_obj, result_obj, input_type, ret_value) \
|
||||
{ \
|
||||
test_obj.set_##input_type(); \
|
||||
OB_ASSERT(OB_SUCCESS == lnnvl_func.calc_result1(result_obj, test_obj, buf)); \
|
||||
OB_ASSERT(ret_value == result_obj.get_bool()); \
|
||||
} \
|
||||
while (0)
|
||||
{ \
|
||||
test_obj.set_##input_type(); \
|
||||
OB_ASSERT(OB_SUCCESS == lnnvl_func.calc_result1(result_obj, test_obj, buf));\
|
||||
OB_ASSERT(ret_value == result_obj.get_bool()); \
|
||||
} while(0)
|
||||
TEST_F(ObExprLnnvlTest, bool_value_test)
|
||||
{
|
||||
ObExprStringBuf buf;
|
||||
@ -83,13 +84,14 @@ TEST_F(ObExprLnnvlTest, bool_value_test)
|
||||
test_obj.set_int(10);
|
||||
OB_ASSERT(OB_SUCCESS == lnnvl_func.calc_result1(result_obj, test_obj, expr_ctx));
|
||||
OB_ASSERT(false == result_obj.get_bool());
|
||||
// EXPECT_EQUAL(lnnvl_func, &buf, test_obj, result_obj, bool, true, false);
|
||||
// EXPECT_EQUAL(lnnvl_func, &buf, test_obj, result_obj, bool, false, true);
|
||||
// EXPECT_EQUAL_NULL(lnnvl_func, &buf, test_obj, result_obj, null, true);
|
||||
//EXPECT_EQUAL(lnnvl_func, &buf, test_obj, result_obj, bool, true, false);
|
||||
//EXPECT_EQUAL(lnnvl_func, &buf, test_obj, result_obj, bool, false, true);
|
||||
//EXPECT_EQUAL_NULL(lnnvl_func, &buf, test_obj, result_obj, null, true);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
::testing::InitGoogleTest(&argc,argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user