summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-11-24 15:52:47 +0100
committerTomeu Vizoso <tomeu@sugarlabs.org>2009-11-24 15:52:54 +0100
commitfc3dca018e85aee34ade79d104ebd8cdd1dd5968 (patch)
tree0da699542761d6861787d474831455db50f140b1 /tests
parent33081c29a1c2fdec2b8bfe17ae0a72b8db7a8d84 (diff)
downloadpygi-fc3dca018e85aee34ade79d104ebd8cdd1dd5968.tar.gz
pygi-fc3dca018e85aee34ade79d104ebd8cdd1dd5968.tar.xz
pygi-fc3dca018e85aee34ade79d104ebd8cdd1dd5968.zip
Accept 0 as a valid value for flag and enum arguments
https://bugzilla.gnome.org/show_bug.cgi?id=602638
Diffstat (limited to 'tests')
-rw-r--r--tests/libtestgi.c6
-rw-r--r--tests/libtestgi.h1
-rw-r--r--tests/test_gi.py1
3 files changed, 8 insertions, 0 deletions
diff --git a/tests/libtestgi.c b/tests/libtestgi.c
index 9b278b8..3677fca 100644
--- a/tests/libtestgi.c
+++ b/tests/libtestgi.c
@@ -2822,6 +2822,12 @@ test_gi_flags_in (TestGIFlags flags_)
g_assert(flags_ == TESTGI_FLAGS_VALUE2);
}
+void
+test_gi_flags_in_zero (TestGIFlags flags)
+{
+ g_assert(flags == 0);
+}
+
/**
* test_gi_flags_in_ptr:
* @flags_: (in) (transfer none):
diff --git a/tests/libtestgi.h b/tests/libtestgi.h
index 538f139..685dcff 100644
--- a/tests/libtestgi.h
+++ b/tests/libtestgi.h
@@ -489,6 +489,7 @@ GType test_gi_flags_get_type (void) G_GNUC_CONST;
TestGIFlags test_gi_flags_return (void);
void test_gi_flags_in (TestGIFlags flags_);
+void test_gi_flags_in_zero (TestGIFlags flags);
void test_gi_flags_in_ptr (TestGIFlags *flags_);
void test_gi_flags_out (TestGIFlags *flags_);
diff --git a/tests/test_gi.py b/tests/test_gi.py
index 6c63bfc..1b0cadb 100644
--- a/tests/test_gi.py
+++ b/tests/test_gi.py
@@ -1065,6 +1065,7 @@ class TestGFlags(unittest.TestCase):
def test_flags_in(self):
TestGI.flags_in(TestGI.Flags.VALUE2)
+ TestGI.flags_in_zero(Number(0))
self.assertRaises(TypeError, TestGI.flags_in, 1 << 1)
self.assertRaises(TypeError, TestGI.flags_in, 'TestGI.Flags.VALUE2')