tensorflow/core/lib/core/coding_test.cc
// Test that encoding routines generate little-endian encodings
Test that encoding routines generate little-endian encodings
Test that encoding routines generate little - endian encodings
TEST(Coding, EncodingOutput) {
  char dst[8];
  EncodeFixed16(dst, 0x0201);
  ASSERT_EQ(0x01, static_cast<int>(dst[0]));
  ASSERT_EQ(0x02, static_cast<int>(dst[1]));
  EncodeFixed32(dst, 0x04030201);
  ASSERT_EQ(0x01, static_cast<int>(dst[0]));
  ASSERT_EQ(0x02, static_cast<int>(dst[1]));
  ASSERT_EQ(0x03, static_cast<int>(dst[2]));
  ASSERT_EQ(0x04, static_cast<int>(dst[3]));
  EncodeFixed64(dst, 0x0807060504030201ull);
  ASSERT_EQ(0x01, static_cast<int>(dst[0]));
  ASSERT_EQ(0x02, static_cast<int>(dst[1]));
  ASSERT_EQ(0x03, static_cast<int>(dst[2]));
  ASSERT_EQ(0x04, static_cast<int>(dst[3]));
  ASSERT_EQ(0x05, static_cast<int>(dst[4]));
  ASSERT_EQ(0x06, static_cast<int>(dst[5]));
  ASSERT_EQ(0x07, static_cast<int>(dst[6]));
  ASSERT_EQ(0x08, static_cast<int>(dst[7]));
}
TEST ( Coding , EncodingOutput ) { char dst [ 8 ] ; EncodeFixed16 ( dst , 0x0201 ) ; ASSERT_EQ ( 0x01 , static_cast < int > ( dst [ 0 ] ) ) ; ASSERT_EQ ( 0x02 , static_cast < int > ( dst [ 1 ] ) ) ; EncodeFixed32 ( dst , 0x04030201 ) ; ASSERT_EQ ( 0x01 , static_cast < int > ( dst [ 0 ] ) ) ; ASSERT_EQ ( 0x02 , static_cast < int > ( dst [ 1 ] ) ) ; ASSERT_EQ ( 0x03 , static_cast < int > ( dst [ 2 ] ) ) ; ASSERT_EQ ( 0x04 , static_cast < int > ( dst [ 3 ] ) ) ; EncodeFixed64 ( dst , 0x0807060504030201ull ) ; ASSERT_EQ ( 0x01 , static_cast < int > ( dst [ 0 ] ) ) ; ASSERT_EQ ( 0x02 , static_cast < int > ( dst [ 1 ] ) ) ; ASSERT_EQ ( 0x03 , static_cast < int > ( dst [ 2 ] ) ) ; ASSERT_EQ ( 0x04 , static_cast < int > ( dst [ 3 ] ) ) ; ASSERT_EQ ( 0x05 , static_cast < int > ( dst [ 4 ] ) ) ; ASSERT_EQ ( 0x06 , static_cast < int > ( dst [ 5 ] ) ) ; ASSERT_EQ ( 0x07 , static_cast < int > ( dst [ 6 ] ) ) ; ASSERT_EQ ( 0x08 , static_cast < int > ( dst [ 7 ] ) ) ; }
Test that encoding routines generate little-endian encodings
Test that encoding routines generate little - endian encodings