Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
d0e9372d
Commit
d0e9372d
authored
Jul 09, 2011
by
Markus Kauppila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ported surface tests.
parent
63d7c3fa
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
424 additions
and
14 deletions
+424
-14
Makefile.am
test/test-automation/Makefile.am
+1
-1
SDL_test.c
test/test-automation/SDL_test.c
+7
-5
install-tests.sh
test/test-automation/build-scripts/install-tests.sh
+1
-1
common.c
test/test-automation/common/common.c
+0
-3
common.h
test/test-automation/common/common.h
+1
-0
img_blit.c
test/test-automation/common/img_blit.c
+2
-0
img_blitblend.c
test/test-automation/common/img_blitblend.c
+1
-0
img_face.c
test/test-automation/common/img_face.c
+1
-0
img_primitives.c
test/test-automation/common/img_primitives.c
+1
-0
img_primitivesblend.c
test/test-automation/common/img_primitivesblend.c
+1
-0
configure.ac
test/test-automation/configure.ac
+2
-1
icon.bmp
test/test-automation/icon.bmp
+0
-0
plain_logger.c
test/test-automation/plain_logger.c
+3
-3
Makefile.am
test/test-automation/testsurface/Makefile.am
+5
-0
testsurface.c
test/test-automation/testsurface/testsurface.c
+398
-0
No files found.
test/test-automation/Makefile.am
View file @
d0e9372d
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
...
...
test/test-automation/SDL_test.c
View file @
d0e9372d
...
...
@@ -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
++
;
}
}
...
...
test/test-automation/build-scripts/install-tests.sh
View file @
d0e9372d
...
...
@@ -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
...
...
test/test-automation/common/common.c
View file @
d0e9372d
...
...
@@ -7,12 +7,9 @@
*/
#include "SDL.h"
#include "../SDL_at.h"
#include "common.h"
/**
* @brief Compares a surface and a surface image for equality.
*/
...
...
test/test-automation/common/common.h
View file @
d0e9372d
...
...
@@ -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. */
...
...
test/test-automation/common/img_blit.c
View file @
d0e9372d
/* 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
"
...
...
test/test-automation/common/img_blitblend.c
View file @
d0e9372d
/* GIMP RGB C-Source image dump (alpha.c) */
#include "common.h"
static
const
SurfaceImage_t
img_blendAdd
=
{
80
,
60
,
3
,
...
...
test/test-automation/common/img_face.c
View file @
d0e9372d
/* GIMP RGBA C-Source image dump (face.c) */
#include "common.h"
static
const
SurfaceImage_t
img_face
=
{
32
,
32
,
4
,
...
...
test/test-automation/common/img_primitives.c
View file @
d0e9372d
/* GIMP RGB C-Source image dump (primitives.c) */
#include "common.h"
static
const
SurfaceImage_t
img_primitives
=
{
80
,
60
,
3
,
...
...
test/test-automation/common/img_primitivesblend.c
View file @
d0e9372d
/* GIMP RGB C-Source image dump (alpha.c) */
#include "common.h"
static
const
SurfaceImage_t
img_blend
=
{
80
,
60
,
3
,
...
...
test/test-automation/configure.ac
View file @
d0e9372d
...
...
@@ -36,7 +36,8 @@ AC_CONFIG_FILES([Makefile
testdummy/Makefile
testrect/Makefile
testplatform/Makefile
testaudio/Makefile])
testaudio/Makefile
testsurface/Makefile])
AC_OUTPUT
echo ""
...
...
test/test-automation/icon.bmp
0 → 100644
View file @
d0e9372d
578 Bytes
test/test-automation/plain_logger.c
View file @
d0e9372d
...
...
@@ -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
,
assertR
esult
,
expected
,
actualValue
,
assertMessage
);
Output
(
indentLevel
,
"%s %
s
(expected %d, actualValue &d): %s"
,
assertName
,
r
esult
,
expected
,
actualValue
,
assertMessage
);
}
void
...
...
test/test-automation/testsurface/Makefile.am
0 → 100644
View file @
d0e9372d
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
`
test/test-automation/testsurface/testsurface.c
0 → 100644
View file @
d0e9372d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment