summaryrefslogtreecommitdiff
path: root/LICENSES
ModeNameSize
-rw-r--r--Apache-2.0.txt11358logplain
-rw-r--r--BSD-2-Clause.txt1288logplain
-rw-r--r--BSD-3-Clause.txt1480logplain
-rw-r--r--CC-BY-SA-4.0.txt20132logplain
-rw-r--r--CC0-1.0.txt6916logplain
l---------GPL-2.0+.txt20logplain
-rw-r--r--GPL-2.0-only.txt18092logplain
-rw-r--r--GPL-2.0-or-later.txt17622logplain
l---------GPL-2.0.txt16logplain
-rw-r--r--LGPL-2.1-or-later.txt25906logplain
-rw-r--r--Linux-syscall-note.txt624logplain
-rw-r--r--MIT.txt1108logplain
uot;" # pylint: disable=W0212 self.assertEquals(translate._MapKind("uint8{string}"), "m[s][u8]") def testLeftToRightAssociativeArray(self): """Makes sure that parsing is done from right to left on the internal kinds in the presence of an associative array.""" # pylint: disable=W0212 self.assertEquals(translate._MapKind("uint8[]{string}"), "m[s][a:u8]") def testTranslateSimpleUnions(self): """Makes sure that a simple union is translated correctly.""" tree = ast.Mojom(None, ast.ImportList(), [ ast.Union( "SomeUnion", None, ast.UnionBody([ ast.UnionField("a", None, None, "int32"), ast.UnionField("b", None, None, "string") ])) ]) translation = translate.OrderedModule(tree, "mojom_tree", []) self.assertEqual(1, len(translation.unions)) union = translation.unions[0] self.assertTrue(isinstance(union, mojom.Union)) self.assertEqual("SomeUnion", union.mojom_name) self.assertEqual(2, len(union.fields)) self.assertEqual("a", union.fields[0].mojom_name) self.assertEqual(mojom.INT32.spec, union.fields[0].kind.spec) self.assertEqual("b", union.fields[1].mojom_name) self.assertEqual(mojom.STRING.spec, union.fields[1].kind.spec) def testMapKindRaisesWithDuplicate(self): """Verifies _MapTreeForType() raises when passed two values with the same name.""" methods = [ ast.Method('dup', None, None, ast.ParameterList(), None), ast.Method('dup', None, None, ast.ParameterList(), None) ] with self.assertRaises(Exception): translate._ElemsOfType(methods, ast.Method, 'scope') def testAssociatedKinds(self): """Tests type spec translation of associated interfaces and requests.""" # pylint: disable=W0212 self.assertEquals( translate._MapKind("asso<SomeInterface>?"), "?asso:x:SomeInterface") self.assertEquals(translate._MapKind("rca<SomeInterface>?"), "?rca:x:SomeInterface") def testSelfRecursiveUnions(self): """Verifies _UnionField() raises when a union is self-recursive.""" tree = ast.Mojom(None, ast.ImportList(), [ ast.Union("SomeUnion", None, ast.UnionBody([ast.UnionField("a", None, None, "SomeUnion")])) ]) with self.assertRaises(Exception): translate.OrderedModule(tree, "mojom_tree", []) tree = ast.Mojom(None, ast.ImportList(), [ ast.Union( "SomeUnion", None, ast.UnionBody([ast.UnionField("a", None, None, "SomeUnion?")])) ]) with self.assertRaises(Exception): translate.OrderedModule(tree, "mojom_tree", []) def testDuplicateAttributesException(self): tree = ast.Mojom(None, ast.ImportList(), [ ast.Union( "FakeUnion", ast.AttributeList([ ast.Attribute("key1", "value"), ast.Attribute("key1", "value") ]), ast.UnionBody([ ast.UnionField("a", None, None, "int32"), ast.UnionField("b", None, None, "string") ])) ]) with self.assertRaises(Exception): translate.OrderedModule(tree, "mojom_tree", []) def testEnumWithReservedValues(self): """Verifies that assigning reserved values to enumerators fails.""" # -128 is reserved for the empty representation in WTF::HashTraits. tree = ast.Mojom(None, ast.ImportList(), [ ast.Enum( "MyEnum", None,