Skip to content

Commit

Permalink
Bug 1293001 - Part 4: Add test for xpidl parser modifications, r=froydnj
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: JTtcwlVH3HN
  • Loading branch information
mystor committed Aug 11, 2016
1 parent f6abe0f commit 20e259b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions xpcom/idl-parser/xpidl/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import mozunit
import unittest
import xpidl
import header


class TestParser(unittest.TestCase):
Expand Down Expand Up @@ -95,5 +96,19 @@ def testAttribute(self):
self.assertEqual("bar", a.name)
self.assertEqual("long", a.type)

def testOverloadedVirtual(self):
i = self.p.parse("""[uuid(abc)] interface foo {
attribute long bar;
void getBar();
};""", filename='f')
self.assertTrue(isinstance(i, xpidl.IDL))
class FdMock:
def write(self, s):
pass
try:
header.print_header(i, FdMock(), filename='f')
except Exception as e:
self.assertEqual(e.args[0], "Unexpected overloaded virtual method GetBar in interface foo")

if __name__ == '__main__':
mozunit.main()

0 comments on commit 20e259b

Please sign in to comment.