src/base/chunk_generator.test.cc
/*
 * A region does is not necessisarily divisable by the chunk size. This will
 * will result in the final chunk being smaller than the rest.
 */
A region does is not necessisarily divisable by the chunk size. This will
will result in the final chunk being smaller than the rest.
A region does is not necessisarily divisable by the chunk size . This will will result in the final chunk being smaller than the rest .
TEST(ChunkGeneratorTest, SmallerLastChunk)
{
    ChunkGenerator chunk_generator(0, 14, 8);
    EXPECT_EQ(0, chunk_generator.addr());
    EXPECT_TRUE(chunk_generator.next());
    EXPECT_EQ(8, chunk_generator.addr());
    EXPECT_EQ(6, chunk_generator.size());
    EXPECT_EQ(8, chunk_generator.complete());
    EXPECT_FALSE(chunk_generator.done());
    EXPECT_TRUE(chunk_generator.last());
}
TEST ( ChunkGeneratorTest , SmallerLastChunk ) { ChunkGenerator chunk_generator ( 0 , 14 , 8 ) ; EXPECT_EQ ( 0 , chunk_generator . addr ( ) ) ; EXPECT_TRUE ( chunk_generator . next ( ) ) ; EXPECT_EQ ( 8 , chunk_generator . addr ( ) ) ; EXPECT_EQ ( 6 , chunk_generator . size ( ) ) ; EXPECT_EQ ( 8 , chunk_generator . complete ( ) ) ; EXPECT_FALSE ( chunk_generator . done ( ) ) ; EXPECT_TRUE ( chunk_generator . last ( ) ) ; }
A region does is not necessisarily divisable by the chunk size.
A region does is not necessisarily divisable by the chunk size .
// There are two chunks. The last will be 6 bytes.