Example #1
0
 def test_duplicates_are_kept(self):
     concat_map = ['c:@F@fun1#I# ast/fun1.c.ast',
                   'c:@F@fun2#I# ast/fun2.c.ast',
                   'c:@F@fun1#I# ast/fun1.c.ast']
     pairs = sut.create_global_ctu_extdef_map(concat_map)
     self.assertTrue(('c:@F@fun1#I#', 'ast/fun1.c.ast') in pairs)
     self.assertTrue(('c:@F@fun2#I#', 'ast/fun2.c.ast') in pairs)
     self.assertEqual(2, len(pairs))
Example #2
0
 def test_not_unique_func_left_out(self):
     concat_map = ['c:@F@fun1#I# ast/fun1.c.ast',
                   'c:@F@fun2#I# ast/fun2.c.ast',
                   'c:@F@fun1#I# ast/fun7.c.ast']
     pairs = sut.create_global_ctu_extdef_map(concat_map)
     self.assertFalse(('c:@F@fun1#I#', 'ast/fun1.c.ast') in pairs)
     self.assertFalse(('c:@F@fun1#I#', 'ast/fun7.c.ast') in pairs)
     self.assertTrue(('c:@F@fun2#I#', 'ast/fun2.c.ast') in pairs)
     self.assertEqual(1, len(pairs))
Example #3
0
 def test_multiple_maps_merged(self):
     concat_map = ['c:@F@fun1#I# ast/fun1.c.ast',
                   'c:@F@fun2#I# ast/fun2.c.ast',
                   'c:@F@fun3#I# ast/fun3.c.ast']
     pairs = sut.create_global_ctu_extdef_map(concat_map)
     self.assertTrue(('c:@F@fun1#I#', 'ast/fun1.c.ast') in pairs)
     self.assertTrue(('c:@F@fun2#I#', 'ast/fun2.c.ast') in pairs)
     self.assertTrue(('c:@F@fun3#I#', 'ast/fun3.c.ast') in pairs)
     self.assertEqual(3, len(pairs))
Example #4
0
 def test_space_handled_in_source(self):
     concat_map = ['c:@F@fun1#I# ast/f un.c.ast']
     pairs = sut.create_global_ctu_extdef_map(concat_map)
     self.assertTrue(('c:@F@fun1#I#', 'ast/f un.c.ast') in pairs)
     self.assertEqual(1, len(pairs))
Example #5
0
 def test_no_map_gives_empty(self):
     pairs = sut.create_global_ctu_extdef_map([])
     self.assertFalse(pairs)
Example #6
0
 def test_space_handled_in_source(self):
     concat_map = ['c:@F@fun1#I# ast/f un.c.ast']
     pairs = sut.create_global_ctu_extdef_map(concat_map)
     self.assertTrue(('c:@F@fun1#I#', 'ast/f un.c.ast') in pairs)
     self.assertEqual(1, len(pairs))
Example #7
0
 def test_no_map_gives_empty(self):
     pairs = sut.create_global_ctu_extdef_map([])
     self.assertFalse(pairs)