src/base/chunk_generator.test.cc
/*
 * A test to consume chunks until the last chunk.
 */
A test to consume chunks until the last chunk.
A test to consume chunks until the last chunk .
TEST(ChunkGeneratorTest, AdvanceToLastChunk)
{
    ChunkGenerator chunk_generator(0, 32, 8);
    EXPECT_EQ(0, chunk_generator.addr());
    EXPECT_TRUE(chunk_generator.next());
    EXPECT_EQ(8, chunk_generator.addr());
    EXPECT_TRUE(chunk_generator.next());
    EXPECT_EQ(16, chunk_generator.addr());
    EXPECT_TRUE(chunk_generator.next());
    EXPECT_EQ(24, chunk_generator.addr());
    EXPECT_EQ(8, chunk_generator.size());
    EXPECT_EQ(24, chunk_generator.complete());
    EXPECT_FALSE(chunk_generator.done());
    EXPECT_TRUE(chunk_generator.last());
}
TEST ( ChunkGeneratorTest , AdvanceToLastChunk ) { ChunkGenerator chunk_generator ( 0 , 32 , 8 ) ; EXPECT_EQ ( 0 , chunk_generator . addr ( ) ) ; EXPECT_TRUE ( chunk_generator . next ( ) ) ; EXPECT_EQ ( 8 , chunk_generator . addr ( ) ) ; EXPECT_TRUE ( chunk_generator . next ( ) ) ; EXPECT_EQ ( 16 , chunk_generator . addr ( ) ) ; EXPECT_TRUE ( chunk_generator . next ( ) ) ; EXPECT_EQ ( 24 , chunk_generator . addr ( ) ) ; EXPECT_EQ ( 8 , chunk_generator . size ( ) ) ; EXPECT_EQ ( 24 , chunk_generator . complete ( ) ) ; EXPECT_FALSE ( chunk_generator . done ( ) ) ; EXPECT_TRUE ( chunk_generator . last ( ) ) ; }
A test to consume chunks until the last chunk.
A test to consume chunks until the last chunk .