mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-10-31 00:12:19 +01:00 
			
		
		
		
	tests: Exercise gdbus-codegen --interface-info-body with empty input
Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
		| @@ -145,6 +145,7 @@ class TestCodegen(unittest.TestCase): | |||||||
|             "#ifdef G_OS_UNIX\n" |             "#ifdef G_OS_UNIX\n" | ||||||
|             "#  include <gio/gunixfdlist.h>\n" |             "#  include <gio/gunixfdlist.h>\n" | ||||||
|             "#endif", |             "#endif", | ||||||
|  |             "interface_info_header_includes": "#include <string.h>", | ||||||
|             "private_gvalues_getters": """#ifdef G_ENABLE_DEBUG |             "private_gvalues_getters": """#ifdef G_ENABLE_DEBUG | ||||||
| #define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v) | #define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v) | ||||||
| #define g_marshal_value_peek_char(v)     g_value_get_schar (v) | #define g_marshal_value_peek_char(v)     g_value_get_schar (v) | ||||||
| @@ -395,6 +396,25 @@ G_END_DECLS | |||||||
|             result.out.strip(), |             result.out.strip(), | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
|  |     def test_empty_interface_info_body(self): | ||||||
|  |         """Test generating a body with an empty interface file.""" | ||||||
|  |         result = self.runCodegenWithInterface( | ||||||
|  |             "", "--output", "-", "--interface-info-body" | ||||||
|  |         ) | ||||||
|  |         self.assertEqual("", result.err) | ||||||
|  |         self.assertEqual( | ||||||
|  |             """{standard_top_comment} | ||||||
|  |  | ||||||
|  | {standard_config_h_include} | ||||||
|  |  | ||||||
|  | #include "-.h" | ||||||
|  |  | ||||||
|  | {interface_info_header_includes}""".format( | ||||||
|  |                 **result.subs | ||||||
|  |             ), | ||||||
|  |             result.out.strip(), | ||||||
|  |         ) | ||||||
|  |  | ||||||
|     def test_reproducible(self): |     def test_reproducible(self): | ||||||
|         """Test builds are reproducible regardless of file ordering.""" |         """Test builds are reproducible regardless of file ordering.""" | ||||||
|         xml_contents1 = """ |         xml_contents1 = """ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user