add more check

This commit is contained in:
Hongze Cheng 2022-01-03 06:18:07 +00:00
parent ad33744771
commit 99510b689c
1 changed files with 4 additions and 0 deletions

View File

@ -115,6 +115,8 @@ static void simple_encode_decode_func(bool var_len) {
GTEST_ASSERT_EQ(coder.pos, sizeof(T));
}
int32_t epos = coder.pos;
tCoderClear(&coder);
// Decode
tCoderInit(&coder, d_endian, buf, BUF_SIZE, TD_DECODER);
@ -126,6 +128,8 @@ static void simple_encode_decode_func(bool var_len) {
GTEST_ASSERT_EQ(coder.pos, sizeof(T));
}
GTEST_ASSERT_EQ(coder.pos, epos);
if (typeid(T) == typeid(int8_t) || typeid(T) == typeid(uint8_t) || e_endian == d_endian) {
GTEST_ASSERT_EQ(i, dval);
}