annotate test/automated/common/common.h @ 3736:78f544eded7b gsoc2009_unit_tests

Added platform test based ot testplatform.c.
author Edgar Simo <bobbens@gmail.com>
date Mon, 20 Jul 2009 18:42:55 +0000
parents 97e9704fc267
children 9f62f47d989b
rev   line source
3728
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
1 /**
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
2 * Automated SDL test common framework.
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
3 *
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
4 * Written by Edgar Simo "bobbens"
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
5 *
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
6 * Released under Public Domain.
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
7 */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
8
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
9
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
10 #ifndef COMMON_H
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
11 # define COMMON_H
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
12
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
13
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
14 #if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
15 # define RMASK 0xff000000 /**< Red bit mask. */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
16 # define GMASK 0x00ff0000 /**< Green bit mask. */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
17 # define BMASK 0x0000ff00 /**< Blue bit mask. */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
18 # define AMASK 0x000000ff /**< Alpha bit mask. */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
19 #else
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
20 # define RMASK 0x000000ff /**< Red bit mask. */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
21 # define GMASK 0x0000ff00 /**< Green bit mask. */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
22 # define BMASK 0x00ff0000 /**< Blue bit mask. */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
23 # define AMASK 0xff000000 /**< Alpha bit mask. */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
24 #endif
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
25
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
26
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
27 typedef struct SurfaceImage_s {
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
28 int width;
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
29 int height;
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
30 unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
31 const unsigned char pixel_data[];
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
32 } SurfaceImage_t;
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
33
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
34
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
35 /**
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
36 * @brief Compares a surface and a surface image for equality.
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
37 *
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
38 * @param sur Surface to compare.
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
39 * @param img Image to compare against.
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
40 * @return 0 if they are the same, -1 on error and positive if different.
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
41 */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
42 int surface_compare( SDL_Surface *sur, const SurfaceImage_t *img );
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
43
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
44
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
45 #endif /* COMMON_H */
97e9704fc267 Using common infrastructure.
Edgar Simo <bobbens@gmail.com>
parents:
diff changeset
46