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
1819321f
Commit
1819321f
authored
Jun 04, 2011
by
Markus Kauppila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test case fails if it doesn't contain any asserts.
parent
1b21c654
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
SDL_test.c
test/test-automation/SDL_test.c
+6
-2
runner.c
test/test-automation/runner.c
+6
-2
No files found.
test/test-automation/SDL_test.c
View file @
1819321f
...
...
@@ -47,7 +47,11 @@ int
_TestCaseQuit
()
{
//! \todo make the test fail, if it does not contain any asserts
printf
(
"Asserts: passed %d, failed %d
\n
"
,
_testAssertsPassed
,
_testAssertsFailed
);
fflush
(
stdout
);
printf
(
"Asserts: passed %d, failed %d
\n
"
,
_testAssertsPassed
,
_testAssertsFailed
);
if
(
_testAssertsFailed
==
0
&&
_testAssertsPassed
==
0
)
{
_testReturnValue
=
2
;
}
return
_testReturnValue
;
}
...
...
@@ -61,7 +65,7 @@ AssertEquals(Uint32 expected, Uint32 actual, char* message, ...)
va_start
(
args
,
message
);
SDL_vsnprintf
(
buf
,
sizeof
(
buf
),
message
,
args
);
va_end
(
args
);
printf
(
"Assert Equals failed: expected %d, got %d; %s
\n
"
,
expected
,
actual
,
buf
);
fflush
(
stdout
);
printf
(
"Assert Equals failed: expected %d, got %d; %s
\n
"
,
expected
,
actual
,
buf
);
_testReturnValue
=
1
;
_testAssertsFailed
++
;
}
else
{
...
...
test/test-automation/runner.c
View file @
1819321f
...
...
@@ -52,7 +52,7 @@ ScanForTestSuites() {
#if defined(linux) || defined( __linux)
char
*
libName
=
"tests/libtest.so"
;
#else
char
*
libName
=
"tests/libtest
rect
.dylib"
;
char
*
libName
=
"tests/libtest.dylib"
;
#endif
return
libName
;
}
...
...
@@ -287,7 +287,11 @@ main(int argc, char *argv[])
if
(
retVal
)
{
failureCount
++
;
printf
(
"%s (in %s): FAILED
\n
"
,
testname
,
testSuiteName
);
if
(
retVal
==
2
)
{
printf
(
"%s (in %s): FAILED -> No asserts
\n
"
,
testname
,
testSuiteName
);
}
else
{
printf
(
"%s (in %s): FAILED
\n
"
,
testname
,
testSuiteName
);
}
}
else
{
passCount
++
;
printf
(
"%s (in %s): ok
\n
"
,
testname
,
testSuiteName
);
...
...
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