Commit 63a8144e authored by Benjamin Otte's avatar Benjamin Otte
Browse files

testsuite: Remove serialize-deserialize test

The serialize-deserialize test is completely handled via the new
nodeparser tests.

So move those tests over and delete the old test binary.
parent 0a32305f
Pipeline #83172 passed with stages
in 22 minutes and 57 seconds
......@@ -17,14 +17,6 @@ node_parser = executable(
install_dir: testexecdir
)
serialize_deserialize = executable(
'serialize-deserialize',
['serialize-deserialize.c'],
dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
)
compare_render_tests = [
'blend-normal',
'blend-difference',
......@@ -88,6 +80,9 @@ foreach renderer : renderers
endforeach
node_parser_tests = [
'blend.node',
'border.node',
'color.node',
'crash1.errors',
'crash1.node',
'crash1.ref.node',
......@@ -99,6 +94,7 @@ node_parser_tests = [
'crash4.errors',
'crash4.node',
'crash4.ref.node',
'debug.node',
'empty-blend.node',
'empty-blend.ref.node',
'empty-blur.node',
......@@ -137,6 +133,10 @@ node_parser_tests = [
'empty-texture.ref.node',
'empty-transform.node',
'empty-transform.ref.node',
'rounded-rect.node',
'shadow.node',
'testswitch.node',
'widgetfactory.node',
]
foreach test : node_parser_tests
......@@ -155,28 +155,3 @@ foreach test : node_parser_tests
suite: 'gsk')
endif
endforeach
serialize_deserialize_tests = [
'blend',
'border',
'color',
'debug',
'rounded-rect',
'shadow',
'testswitch',
'widgetfactory',
]
foreach test : serialize_deserialize_tests
test('serialize-deserialize ' + test, serialize_deserialize,
args: [join_paths(meson.current_source_dir(), 'serializedeserialize', test + '.node')],
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
'GSETTINGS_BACKEND=memory',
'GTK_CSD=1',
'G_ENABLE_DIAGNOSTIC=0',
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
'GSK_RENDERER=opengl'
],
suite: 'gsk')
endforeach
blend {
bottom: container {
}
top: container {
}
}
blend {
bottom: container {
}
mode: color-dodge;
top: container {
}
}
blend {
bottom: color {
bounds: 0 0 50 50;
color: rgb(255,0,204);
}
mode: difference;
top: color {
bounds: 0 0 50 50;
color: rgb(255,0,204);
}
}
border {
colors: rgb(213,208,204);
outline: -1 -1 50 26 / 13;
}
color {
bounds: 100 100 200 300;
color: rgb(255,0,0);
}
debug {
child: container {
}
message: "I'm a debug node.";
child: container {}
}
border {
outline: 0 0 100 100;
}
border {
outline: 0 0 100 100 / 50;
}
border {
outline: 0 0 100 100 / 100 0 100 0;
}
border {
outline: 0 0 100 100 / 100 0 100 0;
}
border {
outline: 0 0 100 100 / 100 0 100 0;
}
border {
outline: 0 0 100 100 / 50;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 50 50 50;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 50 50 50;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 50 50 50;
}
border {
outline: 0 0 100 100 / 50 50 50 50 / 25 0 25 0;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 0 50 0;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 0 50 0;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 0 50 0;
}
border {
outline: 0 0 100 100 / 50 50 50 50 / 25 0 25 0;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 0 50 0;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 0 50 0;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 0 50 0;
}
border {
outline: 0 0 100 100 / 50 50 50 50 / 25 0 25 0;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 0 50 0;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 0 50 0;
}
border {
outline: 0 0 100 100 / 100 0 100 0 / 50 0 50 0;
}
shadow {
child: color {
bounds: 100 100 100 100;
color: rgb(0,128,0);
}
shadows: rgb(255,0,0) 10 10 4, rgb(0,0,255) -10 -10 8;
}
#include <gtk/gtk.h>
static void
deserialize_error_func (const GtkCssSection *section,
const GError *error,
gpointer user_data)
{
char *section_str = gtk_css_section_to_string (section);
g_error ("Error at %s: %s", section_str, error->message);
free (section_str);
}
int
main (int argc, char **argv)
{
GError *error = NULL;
GskRenderNode *node;
GskRenderNode *deserialized;
GBytes *bytes;
GFile *file;
g_assert (argc == 2);
gtk_init ();
file = g_file_new_for_commandline_arg (argv[1]);
bytes = g_file_load_bytes (file, NULL, NULL, &error);
g_assert_no_error (error);
g_assert (bytes != NULL);
node = gsk_render_node_deserialize (bytes, deserialize_error_func, NULL);
g_assert_no_error (error);
/* Now serialize */
g_bytes_unref (bytes);
bytes = gsk_render_node_serialize (node);
/* and deserialize again... */
deserialized = gsk_render_node_deserialize (bytes, deserialize_error_func, NULL);
if (error)
g_message ("OUTPUT:\n%.*s", (int)g_bytes_get_size (bytes), (char *)g_bytes_get_data (bytes, NULL));
g_assert_no_error (error);
/* And check if that all worked. */
g_assert_cmpint (gsk_render_node_get_node_type (deserialized), ==,
gsk_render_node_get_node_type (node));
g_clear_error (&error);
g_clear_pointer (&node, gsk_render_node_unref);
g_clear_pointer (&deserialized, gsk_render_node_unref);
g_bytes_unref (bytes);
g_object_unref (file);
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment