+TEST(Varint, Interface) {
+ // Make sure decodeVarint() accepts all of StringPiece, MutableStringPiece,
+ // ByteRange, and MutableByteRange.
+ char c = 0;
+
+ StringPiece sp(&c, 1);
+ EXPECT_EQ(decodeVarint(sp), 0);
+
+ MutableStringPiece msp(&c, 1);
+ EXPECT_EQ(decodeVarint(msp), 0);
+
+ ByteRange br(reinterpret_cast<unsigned char*>(&c), 1);
+ EXPECT_EQ(decodeVarint(br), 0);
+
+ MutableByteRange mbr(reinterpret_cast<unsigned char*>(&c), 1);
+ EXPECT_EQ(decodeVarint(mbr), 0);
+}
+