For the investigation of failures like the following one:
```
[ RUN ] BufferList.rebuild_aligned_size_and_memory
../src/test/bufferlist.cc:1865: Failure
Expected equality of these values:
bl.get_num_buffers()
Which is: 2
1
[ FAILED ] BufferList.rebuild_aligned_size_and_memory (0 ms)
```
The test case assumes the rebuild before the failed clause **always**
happens while `bufferlist::rebuild_aligned_size_and_memory()` skips it
if buffers are already aligned.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
bl.append(ptr, 0, 0);
EXPECT_EQ(bl.get_num_buffers(), 2);
EXPECT_EQ(bl.back().length(), 0);
- /* rebuild_aligned() calls rebuild_aligned_size_and_memory() */
- bl.rebuild_aligned(4096);
+ /* rebuild_aligned() calls rebuild_aligned_size_and_memory().
+ * we assume the rebuild always happens. */
+ EXPECT_TRUE(bl.rebuild_aligned(4096));
EXPECT_EQ(bl.get_num_buffers(), 1);
}
}