Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Ported surface tests.

  • Loading branch information
mkauppila committed Jul 9, 2011
1 parent b999514 commit 7f82c6f0afe8143176361363c0c901dedde4b622
@@ -1,6 +1,6 @@
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,15 +92,17 @@ 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));
_testAssertsPassed++;
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. */

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

@@ -36,7 +36,8 @@ AC_CONFIG_FILES([Makefile
testdummy/Makefile
testrect/Makefile
testplatform/Makefile
testaudio/Makefile])
testaudio/Makefile
testsurface/Makefile])
AC_OUTPUT

echo ""
Binary file not shown.
@@ -104,16 +104,16 @@ 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
PlainAssertWithValues(const char *assertName, int assertResult, const char *assertMessage,
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
@@ -0,0 +1,5 @@
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`

0 comments on commit 7f82c6f

Please sign in to comment.