Commit d0e9372d authored by Markus Kauppila's avatar Markus Kauppila

Ported surface tests.

parent 63d7c3fa
ACLOCAL_AMFLAGS = -I acinclude -I build-scripts
SUBDIRS = testdummy testrect testplatform testaudio
SUBDIRS = testdummy testrect testplatform testaudio testsurface
bin_PROGRAMS = runner
runner_SOURCES = runner.c SDL_test.c logger.c xml_logger.c plain_logger.c xml.c logger_helpers.c
......
......@@ -74,7 +74,7 @@ AssertEquals(Uint32 expected, Uint32 actual, char* message, ...)
_testReturnValue = 1;
_testAssertsFailed++;
} else {
AssertWithValues("AssertEquals", 1, "AssertEquals passed",
AssertWithValues("AssertEquals", 1, buf,
actual, expected, time(0));
_testAssertsPassed++;
......@@ -92,14 +92,16 @@ AssertTrue(int condition, char *message, ...)
SDL_vsnprintf( buf, sizeof(buf), message, args );
va_end( args );
//printf("AssertTrue failed: %s\n", buf);
Assert("AssertTrue", 0, buf, time(0));
_testReturnValue = 1;
_testAssertsFailed++;
} else {
//printf("AssertTrue passed\n");
Assert("AssertTrue", 1, "AssertTrue passed", time(0));
va_start( args, message );
SDL_vsnprintf( buf, sizeof(buf), message, args );
va_end( args );
Assert("AssertTrue", 1, buf, time(0));
_testAssertsPassed++;
}
}
......
......@@ -16,7 +16,7 @@ elif [[ $PLATFORM == "Darwin" ]]; then
fi
# TODO: put the test in an array
for suite in "testdummy" "testplatform" "testrect" "testaudio"
for suite in "testdummy" "testplatform" "testrect" "testaudio" "testsurface"
do
cp -f "$suite/.libs/lib$suite.$EXT" $DIRECTORY
done
......
......@@ -7,12 +7,9 @@
*/
#include "SDL.h"
#include "../SDL_at.h"
#include "common.h"
/**
* @brief Compares a surface and a surface image for equality.
*/
......
......@@ -10,6 +10,7 @@
#ifndef COMMON_H
# define COMMON_H
#include "SDL/SDL.h"
# define FORMAT SDL_PIXELFORMAT_ARGB8888
# define AMASK 0xff000000 /**< Alpha bit mask. */
......
/* GIMP RGB C-Source image dump (blit.c) */
#include "common.h"
static const SurfaceImage_t img_blit = {
80, 60, 3,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
......
/* GIMP RGB C-Source image dump (alpha.c) */
#include "common.h"
static const SurfaceImage_t img_blendAdd = {
80, 60, 3,
......
/* GIMP RGBA C-Source image dump (face.c) */
#include "common.h"
static const SurfaceImage_t img_face = {
32, 32, 4,
......
/* GIMP RGB C-Source image dump (primitives.c) */
#include "common.h"
static const SurfaceImage_t img_primitives = {
80, 60, 3,
......
/* GIMP RGB C-Source image dump (alpha.c) */
#include "common.h"
static const SurfaceImage_t img_blend = {
80, 60, 3,
......
......@@ -36,7 +36,8 @@ AC_CONFIG_FILES([Makefile
testdummy/Makefile
testrect/Makefile
testplatform/Makefile
testaudio/Makefile])
testaudio/Makefile
testsurface/Makefile])
AC_OUTPUT
echo ""
......
......@@ -104,7 +104,7 @@ PlainAssert(const char *assertName, int assertResult, const char *assertMessage,
time_t eventTime)
{
const char *result = (assertResult) ? "passed" : "failed";
Output(indentLevel, "%s: %s", assertName, assertMessage);
Output(indentLevel, "%s: %s; %s", assertName, result, assertMessage);
}
void
......@@ -112,8 +112,8 @@ PlainAssertWithValues(const char *assertName, int assertResult, const char *asse
int actualValue, int expected, time_t eventTime)
{
const char *result = (assertResult) ? "passed" : "failed";
Output(indentLevel, "%s %d (expected %d, actualValue &d): %s",
assertName, assertResult, expected, actualValue, assertMessage);
Output(indentLevel, "%s %s (expected %d, actualValue &d): %s",
assertName, result, expected, actualValue, assertMessage);
}
void
......
lib_LTLIBRARIES = libtestsurface.la
libtestsurface_la_SOURCES = testsurface.c ../SDL_test.c ../logger.c ../logger_helpers.c ../plain_logger.c ../xml_logger.c ../xml.c \
../common/common.c ../common/img_blit.c ../common/img_blitblend.c ../common/img_face.c ../common/img_primitives.c ../common/img_primitivesblend.c
libtestsurface_la_CLAGS = -fPIC -g
libtestsurface_la_LDFLAGS = `sdl-config --libs`
This diff is collapsed.
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