Moving gobject tests from tests/gobjects to gobjects/tests

The test files concerned are:

- tests/gobjects/accumulator.c
- tests/gobjects/defaultiface.c
- tests/gobjects/deftype.c
- tests/gobjects/dynamictype.c
- tests/gobjects/override.c
- tests/gobjects/references.c
- tests/gobjects/signals.c
- tests/gobjects/singleton.c

Related to issue #1434
This commit is contained in:
Emmanuel Fleury 2022-03-13 19:44:31 +01:00 committed by Philip Withnall
parent a8baa8d0d8
commit 4e02be948b
14 changed files with 24 additions and 53 deletions

View File

@ -17,7 +17,7 @@
#include <glib-object.h>
#include "testmarshal.h"
#include "marshalers.h"
#include "testcommon.h"
/* What this test tests is the behavior of signal accumulators
@ -68,7 +68,7 @@ test_signal1_accumulator (GSignalInvocationHint *ihint,
else
result_string = NULL;
g_value_set_string_take_ownership (return_accu, result_string);
g_value_take_string (return_accu, result_string);
return TRUE;
}
@ -214,21 +214,21 @@ test_object_class_init (TestObjectClass *class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (TestObjectClass, test_signal1),
test_signal1_accumulator, NULL,
test_marshal_STRING__INT,
test_STRING__INT,
G_TYPE_STRING, 1, G_TYPE_INT);
g_signal_new ("test-signal2",
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (TestObjectClass, test_signal2),
g_signal_accumulator_true_handled, NULL,
test_marshal_BOOLEAN__INT,
test_BOOLEAN__INT,
G_TYPE_BOOLEAN, 1, G_TYPE_INT);
g_signal_new ("test-signal3",
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (TestObjectClass, test_signal3),
test_signal3_accumulator, NULL,
test_marshal_VARIANT__POINTER,
test_VARIANT__POINTER,
G_TYPE_VARIANT, 1, G_TYPE_POINTER);
}

View File

@ -101,7 +101,7 @@ static DEFINE_TYPE(TestObject, test_object,
G_TYPE_OBJECT)
static void
test_signals (void)
test_basic_signals (void)
{
TestObject *object;
@ -131,7 +131,7 @@ main (int argc,
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/gobject/signals", test_signals);
g_test_add_func ("/gobject/basic-signals", test_basic_signals);
return g_test_run ();
}

View File

@ -1,3 +1,6 @@
VOID:INT,BOOLEAN,CHAR,UCHAR,UINT,LONG,ULONG,ENUM,FLAGS,FLOAT,DOUBLE,STRING,PARAM,BOXED,POINTER,OBJECT,VARIANT,INT64,UINT64
BOOLEAN:INT
INT:VOID
STRING:INT
UINT:VOID
VARIANT:POINTER

View File

@ -28,12 +28,26 @@ marshalers_c = custom_target('marshalers_c',
gobject_tests = {
'qdata' : {},
'accumulator' : {
'source' : ['accumulator.c', marshalers_h, marshalers_c],
},
'boxed' : {},
'cxx' : {
'source' : ['cxx.cpp'],
},
'defaultiface' : {
'source' : ['defaultiface.c', 'testmodule.c'],
},
'deftype' : {},
'dynamictype' : {
'source' : ['dynamictype.c', 'testmodule.c'],
},
'enums' : {},
'override' : {},
'param' : {},
'references' : {},
'basic-signals' : {},
'singleton' : {},
'threadtests' : {},
'dynamictests' : {},
'binding' : {},

View File

@ -1,47 +1,5 @@
# We cannot use gnome.genmarshal() here
testmarshal_h = custom_target('testmarshal_h',
output : 'testmarshal.h',
input : 'testmarshal.list',
command : [
python, glib_genmarshal,
'--prefix=test_marshal',
'--output=@OUTPUT@',
'--quiet',
'--header',
'@INPUT@',
],
)
testmarshal_c = custom_target('testmarshal_c',
output : 'testmarshal.c',
input : 'testmarshal.list',
command : [
python, glib_genmarshal,
'--prefix=test_marshal',
'--include-header=testmarshal.h',
'--output=@OUTPUT@',
'--quiet',
'--body',
'@INPUT@',
],
)
gobject_tests = {
'deftype' : {},
'defaultiface' : {
'extra_sources' : ['testmodule.c'],
},
'dynamictype' : {
'extra_sources' : ['testmodule.c'],
},
'override' : {},
'signals' : {},
'singleton' : {},
'references' : {},
'testgobject' : {},
'accumulator' : {
'extra_sources' : [testmarshal_c, testmarshal_h],
},
}
if host_system != 'windows'

View File

@ -1,4 +0,0 @@
# Marshallers used in tests
BOOLEAN:INT
STRING:INT
VARIANT:POINTER