PragmaTwice commented on PR #1342:
URL:
https://github.com/apache/incubator-kvrocks/pull/1342#issuecomment-1480706478
> @PragmaTwice So there is a mistake in my test?
The correct version is like this:
```
TEST(Metadata, MetadataDecodingBackwardCompatibleSimpleKey) {
auto expire_at = (Util::GetTimeStamp() + 10) * 1000;
Metadata md_old(kRedisString, true, false);
EXPECT_FALSE(md_old.Is64BitEncoded());
md_old.expire = expire_at;
std::string encoded_bytes;
md_old.Encode(&encoded_bytes);
Metadata md_new(kRedisNone, false, true); // decoding existing metadata
with 64-bit feature activated
md_new.Decode(encoded_bytes);
EXPECT_FALSE(md_new.Is64BitEncoded());
EXPECT_EQ(md_new.Type(), kRedisString);
EXPECT_EQ(md_new.expire, expire_at);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]