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
45e6823e
Commit
45e6823e
authored
Aug 28, 2011
by
Markus Kauppila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created SetUp and TearDown functions for testrwops suite.
parent
8632b5f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
testrwops.c
test/test-automation/tests/testrwops/testrwops.c
+22
-3
No files found.
test/test-automation/tests/testrwops/testrwops.c
View file @
45e6823e
...
@@ -13,13 +13,13 @@
...
@@ -13,13 +13,13 @@
#include "../../include/SDL_test.h"
#include "../../include/SDL_test.h"
// TODO create these at SetUp() and such TearDown()
const
char
*
RWOPS_READ
=
"rwops_read"
;
const
char
*
RWOPS_READ
=
"tests/testrwops/read"
;
const
char
*
RWOPS_WRITE
=
"rwops_write"
;
const
char
*
RWOPS_WRITE
=
"tests/testrwops/write"
;
static
const
char
hello_world
[]
=
"Hello World!"
;
static
const
char
hello_world
[]
=
"Hello World!"
;
static
const
char
const_mem
[]
=
"Hello World!"
;
static
const
char
const_mem
[]
=
"Hello World!"
;
/* Test cases */
/* Test cases */
static
const
TestCaseReference
test1
=
static
const
TestCaseReference
test1
=
(
TestCaseReference
){
"rwops_testParam"
,
"test parameters"
,
TEST_ENABLED
,
0
,
0
};
(
TestCaseReference
){
"rwops_testParam"
,
"test parameters"
,
TEST_ENABLED
,
0
,
0
};
...
@@ -54,6 +54,25 @@ TestCaseReference **QueryTestSuite() {
...
@@ -54,6 +54,25 @@ TestCaseReference **QueryTestSuite() {
}
}
// Fixture
void
SetUp
(
void
*
arg
)
{
FILE
*
handle
=
fopen
(
RWOPS_READ
,
"w"
);
AssertTrue
(
handle
!=
NULL
,
"Creating file '%s' failed"
,
RWOPS_READ
);
fwrite
(
hello_world
,
1
,
SDL_strlen
(
hello_world
),
handle
);
fclose
(
handle
);
}
void
TearDown
(
void
*
arg
)
{
// Remove the created files
remove
(
RWOPS_READ
);
remove
(
RWOPS_WRITE
);
}
/**
/**
* @brief Makes sure parameters work properly. Helper function
* @brief Makes sure parameters work properly. Helper function
*
*
...
...
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