fstests/fsimfsgeneric01: Avoid global state

This commit is contained in:
Sebastian Huber
2012-10-07 17:11:30 +02:00
parent c17d0b315b
commit 39d7d51fe3

View File

@@ -46,8 +46,6 @@ typedef enum {
TEST_DESTROYED TEST_DESTROYED
} test_state; } test_state;
static test_state global_state = TEST_NEW;
static int handler_open( static int handler_open(
rtems_libio_t *iop, rtems_libio_t *iop,
const char *path, const char *path,
@@ -263,6 +261,7 @@ static const IMFS_node_control node_control = {
static void test_imfs_make_generic_node(void) static void test_imfs_make_generic_node(void)
{ {
test_state state = TEST_NEW;
int rv = 0; int rv = 0;
int fd = 0; int fd = 0;
const char *path = "generic"; const char *path = "generic";
@@ -274,7 +273,7 @@ static void test_imfs_make_generic_node(void)
path, path,
S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO, S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO,
&node_control, &node_control,
&global_state &state
); );
rtems_test_assert(rv == 0); rtems_test_assert(rv == 0);
@@ -311,7 +310,7 @@ static void test_imfs_make_generic_node(void)
rv = unlink(path); rv = unlink(path);
rtems_test_assert(rv == 0); rtems_test_assert(rv == 0);
rtems_test_assert(global_state == TEST_DESTROYED); rtems_test_assert(state == TEST_DESTROYED);
} }
static const IMFS_node_control node_invalid_control = { static const IMFS_node_control node_invalid_control = {