summaryrefslogtreecommitdiffstats
path: root/testsuites/fstests/fsimfsgeneric01/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/fstests/fsimfsgeneric01/init.c')
-rw-r--r--testsuites/fstests/fsimfsgeneric01/init.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/testsuites/fstests/fsimfsgeneric01/init.c b/testsuites/fstests/fsimfsgeneric01/init.c
index 44d75c5fad..6cc6c15436 100644
--- a/testsuites/fstests/fsimfsgeneric01/init.c
+++ b/testsuites/fstests/fsimfsgeneric01/init.c
@@ -396,6 +396,13 @@ static const IMFS_node_control node_initialization_error_control = {
.node_destroy = node_destroy_inhibited
};
+static const rtems_filesystem_operations_table *imfs_ops;
+
+static int other_clone(rtems_filesystem_location_info_t *loc)
+{
+ return (*imfs_ops->clonenod_h)(loc);
+}
+
static void test_imfs_make_generic_node_errors(void)
{
int rv = 0;
@@ -403,7 +410,7 @@ static void test_imfs_make_generic_node_errors(void)
rtems_chain_control *chain = &rtems_filesystem_mount_table;
rtems_filesystem_mount_table_entry_t *mt_entry =
(rtems_filesystem_mount_table_entry_t *) rtems_chain_first(chain);
- const char *type = mt_entry->type;
+ rtems_filesystem_operations_table other_ops;
void *opaque = NULL;
rtems_resource_snapshot before;
@@ -421,14 +428,17 @@ static void test_imfs_make_generic_node_errors(void)
rtems_test_assert(rtems_resource_snapshot_check(&before));
errno = 0;
- mt_entry->type = "XXX";
+ imfs_ops = mt_entry->ops;
+ other_ops = *imfs_ops;
+ other_ops.clonenod_h = other_clone;
+ mt_entry->ops = &other_ops;
rv = IMFS_make_generic_node(
path,
S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO,
&node_control,
NULL
);
- mt_entry->type = type;
+ mt_entry->ops = imfs_ops;
rtems_test_assert(rv == -1);
rtems_test_assert(errno == ENOTSUP);
rtems_test_assert(rtems_resource_snapshot_check(&before));