fix:test_json_base

This commit is contained in:
obdev
2023-03-17 04:11:04 +00:00
committed by ob-robot
parent 0c661df5f4
commit e029338914
2 changed files with 7 additions and 3 deletions

View File

@ -707,7 +707,11 @@ public:
}
OB_INLINE ObJsonNodeType json_type() const override { return ObJsonNodeType::J_BOOLEAN; }
OB_INLINE void set_value(bool value) { value_ = value; }
OB_INLINE bool value() const { return value_; }
OB_INLINE bool value() const
{
bool bool_ret = (value_ != 0);
return bool_ret;
}
OB_INLINE uint64_t get_serialize_size() { return sizeof(char); }
ObJsonNode *clone(ObIAllocator* allocator) const;
private:

View File

@ -1997,7 +1997,7 @@ TEST_F(TestJsonBase, test_seek_filter)
hit.reset();
ASSERT_EQ(OB_SUCCESS, j_tree->seek(j_path0, j_path0.path_node_cnt(), true, false, hit));
ASSERT_EQ(hit.size(), 1);
ASSERT_EQ(true, hit[0]->get_boolean());
ASSERT_NE(false, hit[0]->get_boolean());
// bin
ASSERT_EQ(OB_SUCCESS, ObJsonBaseFactory::transform(&allocator, j_tree,
ObJsonInType::JSON_BIN, j_bin));
@ -4514,4 +4514,4 @@ int main(int argc, char** argv)
// OB_LOGGER.set_file_name("test_json_base.log");
// OB_LOGGER.set_log_level("INFO");
return RUN_ALL_TESTS();
}
}