Index: tools/binary_size/explain_binary_size_delta_unittest.py |
diff --git a/tools/binary_size/explain_binary_size_delta_unittest.py b/tools/binary_size/explain_binary_size_delta_unittest.py |
index 87ecb3680d62ea5c497007b57cafd51b77150fce..d5b575abc8d879594a570901bca5f0eaa558bf95 100755 |
--- a/tools/binary_size/explain_binary_size_delta_unittest.py |
+++ b/tools/binary_size/explain_binary_size_delta_unittest.py |
@@ -15,65 +15,66 @@ import explain_binary_size_delta |
class ExplainBinarySizeDeltaTest(unittest.TestCase): |
Andrew Hayden (chromium.org)
2015/02/16 12:47:38
Can you add a test that exercises your new effecti
Daniel Bratell
2015/02/18 13:31:53
Done.
|
def testCompare(self): |
- # List entries have form: symbol_name, symbol_type, symbol_size, file_path |
+ # List entries have form: |
+ # symbol_name, symbol_type, symbol_size, file_path, memory_address |
symbol_list1 = ( |
# File with one symbol, left as-is. |
- ( 'unchanged', 't', 1000, '/file_unchanged' ), |
+ ( 'unchanged', 't', 1000, '/file_unchanged', 0x1 ), |
# File with one symbol, changed. |
- ( 'changed', 't', 1000, '/file_all_changed' ), |
+ ( 'changed', 't', 1000, '/file_all_changed', 0x2 ), |
# File with one symbol, deleted. |
- ( 'removed', 't', 1000, '/file_all_deleted' ), |
+ ( 'removed', 't', 1000, '/file_all_deleted', 0x3 ), |
# File with two symbols, one unchanged, one changed, same bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_changed' ), |
- ( 'changed', 't', 1000, '/file_pair_unchanged_changed' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_changed', 0x4 ), |
+ ( 'changed', 't', 1000, '/file_pair_unchanged_changed', 0x5 ), |
# File with two symbols, one unchanged, one deleted, same bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_removed' ), |
- ( 'removed', 't', 1000, '/file_pair_unchanged_removed' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_removed', 0x6 ), |
+ ( 'removed', 't', 1000, '/file_pair_unchanged_removed', 0x7 ), |
# File with two symbols, one unchanged, one added, same bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_added' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_added', 0x8 ), |
# File with two symbols, one unchanged, one changed, different bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_changed' ), |
- ( 'changed', '@', 1000, '/file_pair_unchanged_diffbuck_changed' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_changed', 0x9 ), |
+ ( 'changed', '@', 1000, '/file_pair_unchanged_diffbuck_changed', 0xa ), |
# File with two symbols, one unchanged, one deleted, different bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_removed' ), |
- ( 'removed', '@', 1000, '/file_pair_unchanged_diffbuck_removed' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_removed', 0xb ), |
+ ( 'removed', '@', 1000, '/file_pair_unchanged_diffbuck_removed', 0xc ), |
# File with two symbols, one unchanged, one added, different bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_added' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_added', 0xd ), |
# File with four symbols, one added, one removed, |
# one changed, one unchanged |
- ( 'size_changed', 't', 1000, '/file_tetra' ), |
- ( 'removed', 't', 1000, '/file_tetra' ), |
- ( 'unchanged', 't', 1000, '/file_tetra' ), |
+ ( 'size_changed', 't', 1000, '/file_tetra', 0xe ), |
+ ( 'removed', 't', 1000, '/file_tetra', 0xf ), |
+ ( 'unchanged', 't', 1000, '/file_tetra', 0x10 ), |
) |
symbol_list2 = ( |
# File with one symbol, left as-is. |
- ( 'unchanged', 't', 1000, '/file_unchanged' ), |
+ ( 'unchanged', 't', 1000, '/file_unchanged', 0x1 ), |
# File with one symbol, changed. |
- ( 'changed', 't', 2000, '/file_all_changed' ), |
+ ( 'changed', 't', 2000, '/file_all_changed', 0x2 ), |
# File with two symbols, one unchanged, one changed, same bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_changed' ), |
- ( 'changed', 't', 2000, '/file_pair_unchanged_changed' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_changed', 0x3 ), |
+ ( 'changed', 't', 2000, '/file_pair_unchanged_changed', 0x4 ), |
# File with two symbols, one unchanged, one deleted, same bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_removed' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_removed', 0x5 ), |
# File with two symbols, one unchanged, one added, same bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_added' ), |
- ( 'added', 't', 1000, '/file_pair_unchanged_added' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_added', 0x6 ), |
+ ( 'added', 't', 1000, '/file_pair_unchanged_added', 0x7 ), |
# File with two symbols, one unchanged, one changed, different bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_changed' ), |
- ( 'changed', '@', 2000, '/file_pair_unchanged_diffbuck_changed' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_changed', 0x8 ), |
+ ( 'changed', '@', 2000, '/file_pair_unchanged_diffbuck_changed', 0x9 ), |
# File with two symbols, one unchanged, one deleted, different bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_removed' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_removed', 0xa ), |
# File with two symbols, one unchanged, one added, different bucket |
- ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_added' ), |
- ( 'added', '@', 1000, '/file_pair_unchanged_diffbuck_added' ), |
+ ( 'unchanged', 't', 1000, '/file_pair_unchanged_diffbuck_added', 0xb ), |
+ ( 'added', '@', 1000, '/file_pair_unchanged_diffbuck_added', 0xc ), |
# File with four symbols, one added, one removed, |
# one changed, one unchanged |
- ( 'size_changed', 't', 2000, '/file_tetra' ), |
- ( 'unchanged', 't', 1000, '/file_tetra' ), |
- ( 'added', 't', 1000, '/file_tetra' ), |
+ ( 'size_changed', 't', 2000, '/file_tetra', 0xd ), |
+ ( 'unchanged', 't', 1000, '/file_tetra', 0xe ), |
+ ( 'added', 't', 1000, '/file_tetra', 0xf ), |
# New file with one symbol added |
- ( 'added', 't', 1000, '/file_new' ), |
+ ( 'added', 't', 1000, '/file_new', 0x10 ), |
) |
# Here we go |
@@ -225,13 +226,13 @@ Per-source Analysis: |
# List entries have form: symbol_name, symbol_type, symbol_size, file_path |
symbol_list1 = ( |
# File with one string. |
- ( '.L.str107', 'r', 8, '/file_with_strs' ), |
+ ( '.L.str107', 'r', 8, '/file_with_strs', 0x1 ), |
) |
symbol_list2 = ( |
# Two files with one string each, same name. |
- ( '.L.str107', 'r', 8, '/file_with_strs' ), |
- ( '.L.str107', 'r', 7, '/other_file_with_strs' ), |
+ ( '.L.str107', 'r', 8, '/file_with_strs', 0x1 ), |
+ ( '.L.str107', 'r', 7, '/other_file_with_strs', 0x2 ), |
) |
# Here we go |
@@ -277,24 +278,24 @@ Per-source Analysis: |
def testCompareStringEntriesWithNoFile(self): |
# List entries have form: symbol_name, symbol_type, symbol_size, file_path |
symbol_list1 = ( |
- ( '.L.str104', 'r', 21, '??' ), # Will change size. |
- ( '.L.str105', 'r', 17, '??' ), # Same. |
- ( '.L.str106', 'r', 13, '??' ), # Will be removed. |
- ( '.L.str106', 'r', 3, '??' ), # Same. |
- ( '.L.str106', 'r', 3, '??' ), # Will be removed. |
- ( '.L.str107', 'r', 8, '??' ), # Will be removed (other sizes). |
+ ( '.L.str104', 'r', 21, '??', 0x1 ), # Will change size. |
+ ( '.L.str105', 'r', 17, '??', 0x2 ), # Same. |
+ ( '.L.str106', 'r', 13, '??', 0x3 ), # Will be removed. |
+ ( '.L.str106', 'r', 3, '??', 0x4 ), # Same. |
+ ( '.L.str106', 'r', 3, '??', 0x5 ), # Will be removed. |
+ ( '.L.str107', 'r', 8, '??', 0x6 ), # Will be removed (other sizes). |
) |
symbol_list2 = ( |
# Two files with one string each, same name. |
- ( '.L.str104', 'r', 19, '??' ), # Changed. |
- ( '.L.str105', 'r', 11, '??' ), # New size for multi-symbol. |
- ( '.L.str105', 'r', 17, '??' ), # New of same size for multi-symbol. |
- ( '.L.str105', 'r', 17, '??' ), # Same. |
- ( '.L.str106', 'r', 3, '??' ), # Same. |
- ( '.L.str107', 'r', 5, '??' ), # New size for symbol. |
- ( '.L.str107', 'r', 7, '??' ), # New size for symbol. |
- ( '.L.str108', 'r', 8, '??' ), # New symbol. |
+ ( '.L.str104', 'r', 19, '??', 0x1 ), # Changed. |
+ ( '.L.str105', 'r', 11, '??', 0x2 ), # New size for multi-symbol. |
+ ( '.L.str105', 'r', 17, '??', 0x3 ), # New of same size for multi-symbol. |
+ ( '.L.str105', 'r', 17, '??', 0x4 ), # Same. |
+ ( '.L.str106', 'r', 3, '??', 0x5 ), # Same. |
+ ( '.L.str107', 'r', 5, '??', 0x6 ), # New size for symbol. |
+ ( '.L.str107', 'r', 7, '??', 0x7 ), # New size for symbol. |
+ ( '.L.str108', 'r', 8, '??', 0x8 ), # New symbol. |
) |
# Here we go |