aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-07-02 16:26:57 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-07-02 16:32:31 -0300
commit95b44627e2080c25a6fba858b18a68727c064d16 (patch)
tree3cfedabb14f77b04f9ef6292249ade06019c8c8c /tests
parent7a726a6338e80bdfe9a4a926af29176012859f88 (diff)
Add support for static fields.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/libsample/abstract.cpp2
-rw-r--r--tests/libsample/abstract.h1
-rw-r--r--tests/samplebinding/class_fields_test.py3
3 files changed, 6 insertions, 0 deletions
diff --git a/tests/libsample/abstract.cpp b/tests/libsample/abstract.cpp
index e81d2cb8..f1f26421 100644
--- a/tests/libsample/abstract.cpp
+++ b/tests/libsample/abstract.cpp
@@ -38,6 +38,8 @@
using namespace std;
+const int Abstract::staticPrimitiveField = 0;
+
Abstract::Abstract(int id) : m_id(id)
{
primitiveField = 123;
diff --git a/tests/libsample/abstract.h b/tests/libsample/abstract.h
index cdfbb30f..834a2f9b 100644
--- a/tests/libsample/abstract.h
+++ b/tests/libsample/abstract.h
@@ -54,6 +54,7 @@ public:
TpAbstract, TpDerived
};
+ static const int staticPrimitiveField;
int primitiveField;
Point valueTypeField;
ObjectType* objectTypeField;
diff --git a/tests/samplebinding/class_fields_test.py b/tests/samplebinding/class_fields_test.py
index 4578efb2..576e8d62 100644
--- a/tests/samplebinding/class_fields_test.py
+++ b/tests/samplebinding/class_fields_test.py
@@ -117,6 +117,9 @@ class TestAccessingCppFields(unittest.TestCase):
del d
self.assertEqual(getrefcount(o), refcount)
+ def testStaticField(self):
+ self.assertEqual(Derived.staticPrimitiveField, 0)
+
if __name__ == '__main__':
unittest.main()