Egor Pasko | 0462e852d | 2018-03-29 15:52:09 | [diff] [blame] | 1 | #!/usr/bin/env vpython |
lizeb | 467e5ba | 2015-02-02 16:35:36 | [diff] [blame] | 2 | # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | import unittest |
| 7 | |
| 8 | import check_orderfile |
| 9 | import symbol_extractor |
| 10 | |
| 11 | |
| 12 | class TestCheckOrderFile(unittest.TestCase): |
| 13 | _SYMBOL_INFOS = [symbol_extractor.SymbolInfo('first', 0x1, 0, ''), |
| 14 | symbol_extractor.SymbolInfo('second', 0x2, 0, ''), |
| 15 | symbol_extractor.SymbolInfo('notProfiled', 0x4, 0, ''), |
| 16 | symbol_extractor.SymbolInfo('third', 0x3, 0, ''),] |
| 17 | |
Matthew Cary | 14195b4 | 2018-08-10 14:59:57 | [diff] [blame] | 18 | def testVerifySymbolOrder(self): |
| 19 | self.assertTrue(check_orderfile._VerifySymbolOrder( |
| 20 | ['.second', 'first', 'eighth', 'third'], |
Matthew Cary | bdba707 | 2018-08-11 01:09:01 | [diff] [blame] | 21 | self._SYMBOL_INFOS, 0)) |
Matthew Cary | 14195b4 | 2018-08-10 14:59:57 | [diff] [blame] | 22 | self.assertFalse(check_orderfile._VerifySymbolOrder( |
| 23 | ['second', 'first', 'eighth', 'third'], |
Matthew Cary | bdba707 | 2018-08-11 01:09:01 | [diff] [blame] | 24 | self._SYMBOL_INFOS, 0)) |
| 25 | self.assertTrue(check_orderfile._VerifySymbolOrder( |
| 26 | ['second', 'first', 'eighth', 'third'], |
| 27 | self._SYMBOL_INFOS, 1)) |
Matthew Cary | 14195b4 | 2018-08-10 14:59:57 | [diff] [blame] | 28 | |
lizeb | 467e5ba | 2015-02-02 16:35:36 | [diff] [blame] | 29 | |
| 30 | if __name__ == '__main__': |
| 31 | unittest.main() |