示例#1
0
 def test__eq__(self):
     for t1_ in TYPE.types:
         t1 = SymbolBASICTYPE(t1_)
         for t2_ in TYPE.types:
             t2 = SymbolBASICTYPE(t2_)
             t = SymbolTYPE('test_type', 0, t1, t2)
             tt = SymbolTYPE('other_type', 0, t)
             self.assertTrue(t == t)
             self.assertFalse(t != t)
             self.assertFalse(tt == t)
             self.assertFalse(t == tt)
             self.assertTrue(tt == tt)
             self.assertFalse(tt != tt)
             self.assertTrue(t != tt)
             self.assertTrue(tt != t)
示例#2
0
 def test_size(self):
     for t1_ in TYPE.types:
         t1 = SymbolBASICTYPE(t1_)
         for t2_ in TYPE.types:
             t2 = SymbolBASICTYPE(t2_)
             t = SymbolTYPE('test_type', 0, t1, t2)
             self.assertEqual(t.size, t1.size + t2.size)
示例#3
0
 def test_is_alias(self):
     for t1_ in TYPE.types:
         t1 = SymbolBASICTYPE(t1_)
         for t2_ in TYPE.types:
             t2 = SymbolBASICTYPE(t2_)
             t = SymbolTYPE('test_type', 0, t1, t2)
             self.assertFalse(t.is_alias)