add test case
This commit is contained in:
parent
782848a6e7
commit
80e5716d20
|
@ -41,6 +41,29 @@ class UtilEnv : public ::testing::Test {
|
||||||
SArray *rslt;
|
SArray *rslt;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class UtilComm : public ::testing::Test {
|
||||||
|
protected:
|
||||||
|
virtual void SetUp() {
|
||||||
|
// src = (SArray *)taosArrayInit(2, sizeof(void *));
|
||||||
|
// for (int i = 0; i < 3; i++) {
|
||||||
|
// SArray *m = taosArrayInit(10, sizeof(uint64_t));
|
||||||
|
// taosArrayPush(src, &m);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// rslt = (SArray *)taosArrayInit(10, sizeof(uint64_t));
|
||||||
|
}
|
||||||
|
virtual void TearDown() {
|
||||||
|
// for (int i = 0; i < taosArrayGetSize(src); i++) {
|
||||||
|
// SArray *m = (SArray *)taosArrayGetP(src, i);
|
||||||
|
// taosArrayDestroy(m);
|
||||||
|
// }
|
||||||
|
// taosArrayDestroy(src);
|
||||||
|
}
|
||||||
|
// SArray *src;
|
||||||
|
// SArray *rslt;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
static void clearSourceArray(SArray *p) {
|
static void clearSourceArray(SArray *p) {
|
||||||
for (int i = 0; i < taosArrayGetSize(p); i++) {
|
for (int i = 0; i < taosArrayGetSize(p); i++) {
|
||||||
SArray *m = (SArray *)taosArrayGetP(p, i);
|
SArray *m = (SArray *)taosArrayGetP(p, i);
|
||||||
|
@ -369,3 +392,18 @@ TEST_F(UtilEnv, testDictComm) {
|
||||||
EXPECT_EQ(COMMON_INPUTS[v], i);
|
EXPECT_EQ(COMMON_INPUTS[v], i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(UtilComm, testCompress) {
|
||||||
|
for (int32_t i = 0; i < 6; i++) {
|
||||||
|
_cache_range_compare cmpFunc = idxGetCompare((RangeType)(i));
|
||||||
|
//char[32]a = 0, b = 1;
|
||||||
|
char a[32] = {0};
|
||||||
|
char b[32] = {1};
|
||||||
|
for (int32_t j = 0; j < TSDB_DATA_TYPE_MAX; j++) {
|
||||||
|
cmpFunc(a, b, j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue