~ubuntu-branches/ubuntu/vivid/clutter-1.0/vivid-proposed

« back to all changes in this revision

Viewing changes to tests/conform/test-conform-common.c

  • Committer: Package Import Robot
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2014-03-26 11:51:28 UTC
  • mfrom: (1.5.1) (4.1.30 experimental)
  • Revision ID: package-import@ubuntu.com-20140326115128-timmbsde8734o6wz
Tags: 1.18.0-1
* New upstream release.
* debian/control.in:
  + Bump gtk-doc-tools build dependency.
  + Also break libcogl15.
  + Standards-Version is 3.9.5, no changes needed.
* debian/libclutter-1.0-0.symbols:
  + Drop a few symbols that were accidentally exported in the DSO because
    they had a clutter_ prefix but were not in the public headers.
  + Add one new symbol.
  + Drop unnecessary debian revisions from some symbols.
* debian/control.in,
  debian/rules,
  debian/libclutter-1.0-0.symbols:
  + Temporarily disable evdev input support. It was only enabled in 1.17.6-1
    in experimental and there is nothing using it yet, and I would like to
    wait a bit before uploading libinput to unstable as the ABI isn't stable
    yet.
* d/p/0001-wayland-Add-missing-CLUTTER_AVAILABLE-annotations.patch:
  + Add missing annotations so that a few symbols are exported in the DSO.

* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "config.h"
2
 
 
3
 
#include <clutter/clutter.h>
4
 
#include <stdlib.h>
5
 
 
6
 
#ifdef CLUTTER_WINDOWING_X11
7
 
#include <X11/Xlib.h>
8
 
#include <clutter/x11/clutter-x11.h>
9
 
#endif
10
 
 
11
 
#include "test-conform-common.h"
12
 
 
13
 
/**
14
 
 * test_conform_simple_fixture_setup:
15
 
 *
16
 
 * Initialise stuff before each test is run
17
 
 */
18
 
void
19
 
test_conform_simple_fixture_setup (TestConformSimpleFixture *fixture,
20
 
                                   gconstpointer data)
21
 
{
22
 
  const TestConformSharedState *shared_state = data;
23
 
  static int counter = 0;
24
 
 
25
 
  if (counter != 0)
26
 
    g_critical ("We don't support running more than one test at a time\n"
27
 
                "in a single test run due to the state leakage that often\n"
28
 
                "causes subsequent tests to fail.\n"
29
 
                "\n"
30
 
                "If you want to run all the tests you should run\n"
31
 
                "$ make test-report");
32
 
  counter++;
33
 
 
34
 
#ifdef CLUTTER_WINDOWING_X11
35
 
  if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
36
 
    {
37
 
      /* on X11 we need a display connection to run the test suite */
38
 
      const gchar *display = g_getenv ("DISPLAY");
39
 
      if (!display || *display == '\0')
40
 
        {
41
 
          g_print ("No DISPLAY found. Unable to run the conformance "
42
 
                   "test suite without a display.\n");
43
 
 
44
 
          exit (EXIT_SUCCESS);
45
 
        }
46
 
 
47
 
      /* enable XInput support */
48
 
      clutter_x11_enable_xinput ();
49
 
    }
50
 
#endif
51
 
 
52
 
  g_assert (clutter_init (shared_state->argc_addr, shared_state->argv_addr)
53
 
            == CLUTTER_INIT_SUCCESS);
54
 
 
55
 
#ifdef CLUTTER_WINDOWING_X11
56
 
  /* A lot of the tests depend on a specific stage / framebuffer size
57
 
   * when they read pixels back to verify the results of the test.
58
 
   *
59
 
   * Normally the asynchronous nature of X means that setting the
60
 
   * clutter stage size may really happen an indefinite amount of time
61
 
   * later but since the tests are so short lived and may only render
62
 
   * a single frame this is not an acceptable semantic.
63
 
   */
64
 
  if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
65
 
    XSynchronize (clutter_x11_get_default_display(), TRUE);
66
 
#endif
67
 
}
68
 
 
69
 
 
70
 
/**
71
 
 * test_conform_simple_fixture_teardown:
72
 
 *
73
 
 * Cleanup stuff after each test has finished
74
 
 */
75
 
void
76
 
test_conform_simple_fixture_teardown (TestConformSimpleFixture *fixture,
77
 
                                      gconstpointer data)
78
 
{
79
 
  /* const TestConformSharedState *shared_state = data; */
80
 
}
81
 
 
82
 
void
83
 
test_conform_get_gl_functions (TestConformGLFunctions *functions)
84
 
{
85
 
  functions->glGetString = (void *) cogl_get_proc_address ("glGetString");
86
 
  g_assert (functions->glGetString != NULL);
87
 
  functions->glGetIntegerv = (void *) cogl_get_proc_address ("glGetIntegerv");
88
 
  g_assert (functions->glGetIntegerv != NULL);
89
 
  functions->glPixelStorei = (void *) cogl_get_proc_address ("glPixelStorei");
90
 
  g_assert (functions->glPixelStorei != NULL);
91
 
  functions->glBindTexture = (void *) cogl_get_proc_address ("glBindTexture");
92
 
  g_assert (functions->glBindTexture != NULL);
93
 
  functions->glGenTextures = (void *) cogl_get_proc_address ("glGenTextures");
94
 
  g_assert (functions->glGenTextures != NULL);
95
 
  functions->glGetError = (void *) cogl_get_proc_address ("glGetError");
96
 
  g_assert (functions->glGetError != NULL);
97
 
  functions->glDeleteTextures =
98
 
    (void *) cogl_get_proc_address ("glDeleteTextures");
99
 
  g_assert (functions->glDeleteTextures != NULL);
100
 
  functions->glTexImage2D = (void *) cogl_get_proc_address ("glTexImage2D");
101
 
  g_assert (functions->glTexImage2D != NULL);
102
 
  functions->glTexParameteri =
103
 
    (void *) cogl_get_proc_address ("glTexParameteri");
104
 
  g_assert (functions->glTexParameteri != NULL);
105
 
}