aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding/reference_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/samplebinding/reference_test.py')
-rwxr-xr-xtests/samplebinding/reference_test.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/samplebinding/reference_test.py b/tests/samplebinding/reference_test.py
new file mode 100755
index 000000000..ed4c5cbc8
--- /dev/null
+++ b/tests/samplebinding/reference_test.py
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+
+'''Test cases for methods that receive references to objects.'''
+
+import sys
+import unittest
+
+from sample import Reference
+
+class ReferenceTest(unittest.TestCase):
+ '''Test case for methods that receive references to objects.'''
+
+ def testMethodThatReceivesReference(self):
+ '''Test a method that receives a reference to an object as argument.'''
+ objId = 123
+ r = Reference(objId)
+ self.assertEqual(Reference.usesReference(r), objId)
+
+ def testMethodThatReceivesConstReference(self):
+ '''Test a method that receives a const reference to an object as argument.'''
+ objId = 123
+ r = Reference(objId)
+ self.assertEqual(Reference.usesConstReference(r), objId)
+
+
+if __name__ == '__main__':
+ unittest.main()
+