mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
mkenums: Support public/private trigraphs again
This change was previously implemented in
9ba17d511e
but got dropped during the
Python conversion of the Perl script.
See the commit message of this commit as well as
https://bugzilla.gnome.org/show_bug.cgi?id=782162
for more information.
This patch also adds a new test so we don't loose this feature again.
This commit is contained in:
@@ -595,6 +595,61 @@ comment: {standard_bottom_comment}
|
||||
"0",
|
||||
)
|
||||
|
||||
def test_enum_private_public(self):
|
||||
"""Test private/public enums. Bug #782162."""
|
||||
h_contents1 = """
|
||||
typedef enum {
|
||||
ENUM_VALUE_PUBLIC1,
|
||||
/*< private >*/
|
||||
ENUM_VALUE_PRIVATE,
|
||||
} SomeEnumA
|
||||
"""
|
||||
|
||||
h_contents2 = """
|
||||
typedef enum {
|
||||
/*< private >*/
|
||||
ENUM_VALUE_PRIVATE,
|
||||
/*< public >*/
|
||||
ENUM_VALUE_PUBLIC2,
|
||||
} SomeEnumB;
|
||||
"""
|
||||
|
||||
result = self.runMkenumsWithHeader(h_contents1)
|
||||
self.maxDiff = None
|
||||
self.assertEqual("", result.err)
|
||||
self.assertSingleEnum(
|
||||
result,
|
||||
"SomeEnumA",
|
||||
"some_enum_a",
|
||||
"SOME_ENUM_A",
|
||||
"ENUM_A",
|
||||
"SOME",
|
||||
"",
|
||||
"enum",
|
||||
"Enum",
|
||||
"ENUM",
|
||||
"ENUM_VALUE_PUBLIC1",
|
||||
"public1",
|
||||
"0",
|
||||
)
|
||||
result = self.runMkenumsWithHeader(h_contents2)
|
||||
self.assertEqual("", result.err)
|
||||
self.assertSingleEnum(
|
||||
result,
|
||||
"SomeEnumB",
|
||||
"some_enum_b",
|
||||
"SOME_ENUM_B",
|
||||
"ENUM_B",
|
||||
"SOME",
|
||||
"",
|
||||
"enum",
|
||||
"Enum",
|
||||
"ENUM",
|
||||
"ENUM_VALUE_PUBLIC2",
|
||||
"public2",
|
||||
"0",
|
||||
)
|
||||
|
||||
|
||||
class TestRspMkenums(TestMkenums):
|
||||
"""Run all tests again in @rspfile mode"""
|
||||
|
Reference in New Issue
Block a user