int main(int argc, char **argv) { gint tests_run = 0; gint tests_passed = 0; gint tests_failed = 0; gint i; const char *operation_names[] = { "svg:src", "svg:dst", "svg:src-over", "svg:dst-over", "svg:src-in", "svg:dst-in", "svg:src-out", "svg:dst-out", "svg:src-atop", "svg:dst-atop", "svg:clear", "svg:xor", }; gegl_init(0, NULL); g_object_set(G_OBJECT(gegl_config()), "swap", "RAM", "use-opencl", FALSE, NULL); printf ("testing abyss handling of svg blends\n"); for (i = 0; i < G_N_ELEMENTS(operation_names); ++i) { if (test_operation (operation_names[i])) tests_passed++; else tests_failed++; tests_run++; } gegl_exit(); printf ("\n"); if (tests_passed == tests_run) return 0; return -1; return 0; }
static int local_timer_test(void *data) { int cpu = *(int*)data; printk("[%s]: thread for cpu%d start\n", __func__, cpu); enable_percpu_irq(GIC_PPI_PRIVATE_TIMER, 0); while (1) { wait_for_completion(¬ify[cpu]); test_operation(); complete(&ack); } printk("[%s]: thread for cpu%d stop\n", __func__, cpu); return 0; }
int main(int argc, char const *argv[]) { print< ::color::rgb< ::color::type::split422_t >::category_type >(); print< ::color::rgb< ::color::type::split242_t >::category_type >(); print< ::color::rgb< ::color::type::split224_t >::category_type >(); print< ::color::bgr< ::color::type::split422_t >::category_type >(); print< ::color::bgr< ::color::type::split242_t >::category_type >(); print< ::color::bgr< ::color::type::split224_t >::category_type >(); print< ::color::abgr< ::color::type::split2AAA_t >::category_type >(); print< ::color::bgra< ::color::type::splitAAA2_t >::category_type >(); print< ::color::rgba< ::color::type::splitAAA2_t >::category_type >(); print< ::color::argb< ::color::type::split2AAA_t >::category_type >(); sandbox_test(); extern void test_constant(); test_constant(); extern void check_sizeof(); check_sizeof(); void test_operation(); test_operation(); void image_conversion(); image_conversion(); test_pallete(); ctor_test(); void main_place(); main_place(); void check_get(); check_get(); extern int gray_test( int argc, char const *argv[] ); gray_test( argc, argv ); extern int decompose_test( int argc, char const *argv[] ); decompose_test( argc, argv ); extern void print_bound(); print_bound(); make_blue(); invoke(); extern void check_conversion(); check_conversion(); void make_test_gray_scale(); make_test_gray_scale(); void test_set_invoke(); test_set_invoke(); void test_get_invoke( double value ); test_get_invoke(0.5); return 0; }
static gboolean process_operations (GType type) { GType *operations; gboolean result = TRUE; guint count; gint i; operations = g_type_children (type, &count); if (!operations) { g_free (operations); return TRUE; } for (i = 0; i < count; i++) { GeglOperationClass *operation_class; const gchar *image, *xml, *name; gboolean matches; operation_class = g_type_class_ref (operations[i]); image = gegl_operation_class_get_key (operation_class, "reference-image"); xml = gegl_operation_class_get_key (operation_class, "reference-composition"); name = gegl_operation_class_get_key (operation_class, "name"); if (name == NULL) { result = result && process_operations (operations[i]); continue; } matches = g_regex_match (regex, name, 0, NULL) && !g_regex_match (exc_regex, name, 0, NULL); if (xml && matches) { GeglNode *composition; if (output_all) g_printf ("%s\n", name); else if (image) g_printf ("%s: ", name); /* more information will follow if we're testing */ composition = gegl_node_new_from_xml (xml, data_dir); if (!composition) { g_printf ("FAIL\n Composition graph is flawed\n"); result = FALSE; } else if (image || output_all) { gchar *output_path = operation_to_path (name, FALSE); GeglNode *output = gegl_node_new_child (composition, "operation", "gegl:png-save", "compression", 9, "path", output_path, NULL); gegl_node_link (composition, output); gegl_node_process (output); g_object_unref (composition); /* don't test if run with --all */ if (!output_all && image) result = test_operation (name, image, output_path) && result; g_free (output_path); } } /* if we are running with --all and the operation doesn't have a composition, use standard composition and images, don't test */ else if (output_all && matches && !(g_type_is_a (operations[i], GEGL_TYPE_OPERATION_SINK) || g_type_is_a (operations[i], GEGL_TYPE_OPERATION_TEMPORAL))) { g_printf ("%s\n", name); standard_output (name); } result = process_operations (operations[i]) && result; } g_free (operations); return result; }