binman: Store the original data before compression
When compressing an entry, the original uncompressed data is overwritten. Store it so it is available if needed. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -1810,6 +1810,18 @@ class TestFunctional(unittest.TestCase):
|
||||
props = self._GetPropTree(dtb, ['size', 'uncomp-size'])
|
||||
orig = self._decompress(data)
|
||||
self.assertEquals(COMPRESS_DATA, orig)
|
||||
|
||||
# Do a sanity check on various fields
|
||||
image = control.images['image']
|
||||
entries = image.GetEntries()
|
||||
self.assertEqual(1, len(entries))
|
||||
|
||||
entry = entries['blob']
|
||||
self.assertEqual(COMPRESS_DATA, entry.uncomp_data)
|
||||
self.assertEqual(len(COMPRESS_DATA), entry.uncomp_size)
|
||||
orig = self._decompress(entry.data)
|
||||
self.assertEqual(orig, entry.uncomp_data)
|
||||
|
||||
expected = {
|
||||
'blob:uncomp-size': len(COMPRESS_DATA),
|
||||
'blob:size': len(data),
|
||||
|
Reference in New Issue
Block a user