1a63414966
* clutter/clutter-path.h: * clutter/clutter-path.c: Implementation of new ClutterPath object to represent a path combining straight line and bezier curve elements. * clutter/clutter.h: Include clutter-path.h and remove clutter-behaviour-bspline.h * tests/interactive/test-threads.c (test_threads_main): * tests/interactive/test-script.c: * tests/interactive/test-behave.c (test_behave_main): Use new path API * clutter/clutter-effect.c: Use the new ClutterBehaviourPath API. * clutter/clutter-bezier.h: * clutter/clutter-bezier.c: Moved bezier curve handling code out from clutter-behaviour-bspline.c to a separate file. * clutter/clutter-behaviour-path.h: * clutter/clutter-behaviour-path.c: Reimplemented to work with a ClutterPath * clutter/clutter-behaviour-bspline.h: * clutter/clutter-behaviour-bspline.c: Removed * clutter/Makefile.am: Add clutter-path and clutter-bezier, remove clutter-behaviour-bspline. * tests/conform/test-path.c: New automatic test for ClutterPath consistency * tests/conform/test-conform-main.c (main): Add test_path * tests/conform/Makefile.am (test_conformance_SOURCES): Add test-path.c * clutter/clutter-sections.txt: Add ClutterPath docs * clutter/clutter.types: * clutter/clutter-docs.xml: * doc/reference/clutter/clutter-animation-tutorial.xml: Remove mention of ClutterBehaviourBspline * clutter/clutter-marshal.list: Add VOID:UINT
112 lines
3.7 KiB
C
112 lines
3.7 KiB
C
#include "config.h"
|
|
|
|
#include <clutter/clutter.h>
|
|
|
|
#include <glib.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "test-conform-common.h"
|
|
|
|
|
|
/* This is a bit of sugar for adding new conformance tests:
|
|
*
|
|
* - It adds an extern function definition just to save maintaining a header
|
|
* that lists test entry points.
|
|
* - It sets up callbacks for a fixture, which lets us share initialization
|
|
* *code* between tests. (see test-conform-common.c)
|
|
* - It passes in a shared *data* pointer that is initialised once in main(),
|
|
* that gets passed to the fixture setup and test functions. (See the
|
|
* definition in test-conform-common.h)
|
|
*/
|
|
#define TEST_CONFORM_SIMPLE(NAMESPACE, FUNC) \
|
|
extern void FUNC (TestConformSimpleFixture *fixture, gconstpointer data); \
|
|
g_test_add ("/conform" NAMESPACE "/" #FUNC, \
|
|
TestConformSimpleFixture, \
|
|
shared_state, /* data argument for test */ \
|
|
test_conform_simple_fixture_setup, \
|
|
FUNC, \
|
|
test_conform_simple_fixture_teardown);
|
|
|
|
|
|
int
|
|
main (int argc, char **argv)
|
|
{
|
|
TestConformSharedState *shared_state = g_new0 (TestConformSharedState, 1);
|
|
const gchar *display;
|
|
|
|
#ifdef HAVE_CLUTTER_GLX
|
|
/* on X11 we need a display connection to run the test suite */
|
|
display = g_getenv ("DISPLAY");
|
|
if (!display || *display == '\0')
|
|
{
|
|
g_print ("No DISPLAY found. Unable to run the conformance "
|
|
"test suite without a display.");
|
|
return EXIT_SUCCESS;
|
|
}
|
|
#endif
|
|
|
|
g_test_init (&argc, &argv, NULL);
|
|
|
|
g_test_bug_base ("http://bugzilla.openedhand.com/show_bug.cgi?id=%s");
|
|
|
|
g_assert (clutter_init (shared_state->argc_addr, shared_state->argv_addr)
|
|
== CLUTTER_INIT_SUCCESS);
|
|
|
|
/* Initialise the state you need to share with everything.
|
|
*/
|
|
shared_state->argc_addr = &argc;
|
|
shared_state->argv_addr = &argv;
|
|
|
|
TEST_CONFORM_SIMPLE ("/timeline", test_timeline);
|
|
if (g_test_slow ())
|
|
{
|
|
TEST_CONFORM_SIMPLE ("/timeline", test_timeline_dup_frames);
|
|
TEST_CONFORM_SIMPLE ("/timeline", test_timeline_interpolate);
|
|
TEST_CONFORM_SIMPLE ("/timeline", test_timeline_rewind);
|
|
TEST_CONFORM_SIMPLE ("/timeline", test_timeline_smoothness);
|
|
}
|
|
|
|
TEST_CONFORM_SIMPLE ("/picking", test_pick);
|
|
|
|
TEST_CONFORM_SIMPLE ("/label", test_label_cache);
|
|
|
|
TEST_CONFORM_SIMPLE ("/entry", test_entry_utf8_validation);
|
|
TEST_CONFORM_SIMPLE ("/entry", test_entry_empty);
|
|
TEST_CONFORM_SIMPLE ("/entry", test_entry_set_empty);
|
|
TEST_CONFORM_SIMPLE ("/entry", test_entry_set_text);
|
|
|
|
TEST_CONFORM_SIMPLE ("/entry", test_entry_append_some);
|
|
TEST_CONFORM_SIMPLE ("/entry", test_entry_prepend_some);
|
|
TEST_CONFORM_SIMPLE ("/entry", test_entry_insert);
|
|
|
|
TEST_CONFORM_SIMPLE ("/entry", test_entry_delete_chars);
|
|
TEST_CONFORM_SIMPLE ("/entry", test_entry_delete_text);
|
|
|
|
TEST_CONFORM_SIMPLE ("/entry", test_entry_cursor);
|
|
TEST_CONFORM_SIMPLE ("/entry", test_entry_event);
|
|
|
|
TEST_CONFORM_SIMPLE ("/rectangle", test_rect_set_size);
|
|
TEST_CONFORM_SIMPLE ("/rectangle", test_rect_set_color);
|
|
|
|
TEST_CONFORM_SIMPLE ("/fixed", test_fixed_constants);
|
|
|
|
TEST_CONFORM_SIMPLE ("/invariants", test_initial_state);
|
|
TEST_CONFORM_SIMPLE ("/invariants", test_realized);
|
|
TEST_CONFORM_SIMPLE ("/invariants", test_mapped);
|
|
TEST_CONFORM_SIMPLE ("/invariants", test_show_on_set_parent);
|
|
|
|
TEST_CONFORM_SIMPLE ("/mesh", test_mesh_contiguous);
|
|
TEST_CONFORM_SIMPLE ("/mesh", test_mesh_interleved);
|
|
TEST_CONFORM_SIMPLE ("/mesh", test_mesh_mutability);
|
|
|
|
TEST_CONFORM_SIMPLE ("/opacity", test_label_opacity);
|
|
TEST_CONFORM_SIMPLE ("/opacity", test_rectangle_opacity);
|
|
TEST_CONFORM_SIMPLE ("/opacity", test_paint_opacity);
|
|
|
|
TEST_CONFORM_SIMPLE ("/texture", test_backface_culling);
|
|
|
|
TEST_CONFORM_SIMPLE ("/path", test_path);
|
|
|
|
return g_test_run ();
|
|
}
|