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
850eb7ba
Commit
850eb7ba
authored
May 23, 2011
by
Markus Kauppila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added assertEquals(Uint32, Uint32) function
parent
87553ecc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
6 deletions
+47
-6
Makefile.in
test/test-automation/Makefile.in
+6
-3
asserts.h
test/test-automation/asserts.h
+29
-0
test.c
test/test-automation/test.c
+12
-3
No files found.
test/test-automation/Makefile.in
View file @
850eb7ba
...
...
@@ -25,9 +25,12 @@ all: runner $(ALL_TESTS)
runner
:
$(SRC)
$(CC)
$(CFLAGS)
$(LDFLAGS)
-o
$@
$+
asserts.o
:
asserts.c
$(CC)
$(CFLAGS)
-c
$+
-o
$@
tests
:
$(ALL_TESTS)
libtest.so
:
test.o
libtest.so
:
test.o
asserts.o
$(CC)
-shared
-wl
,-soname,
$@
-o
$@
$(LDFLAGS)
$+
test.o
:
$(TEST_SRC)
...
...
test/test-automation/asserts.h
0 → 100644
View file @
850eb7ba
/*
Copyright (C) 2011 Markus Kauppila <markus.kauppila@gmail.com>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef _ASSERTS_H
#define _ASSERTS_H
#include <SDL/SDL.h>
void
assertEquals
(
Uint32
expected
,
Uint32
actual
);
#endif
test/test-automation/test.c
View file @
850eb7ba
...
...
@@ -23,14 +23,21 @@
#include <stdio.h>
char
*
names
[]
=
{
"hello"
,
"hello2"
,
"hello3"
};
#include <SDL/SDL.h>
char
**
suite
()
{
#include "asserts.h"
const
char
*
names
[]
=
{
"hello"
,
"hello2"
,
"hello3"
};
const
char
**
suite
()
{
return
names
;
}
void
hello
(
void
*
arg
){
printf
(
"hello
\n
"
);
const
char
*
revision
=
SDL_GetRevision
();
printf
(
"Revision is %s
\n
"
,
revision
);
assertEquals
(
3
,
5
);
}
void
hello2
(
void
*
arg
)
{
...
...
@@ -40,6 +47,8 @@ void hello2(void *arg) {
void
hello3
(
void
*
arg
)
{
printf
(
"hello
\n
"
);
assertEquals
(
3
,
3
);
}
#endif
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