Changeset 4ac5ffbb in rtems


Ignore:
Timestamp:
Feb 5, 2018, 8:31:32 AM (22 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
53b6484
Parents:
03e5a780
Message:

fsclose01: Add tmpfile() test case

Close #1971.

Location:
testsuites/fstests/fsclose01
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/fstests/fsclose01/init.c

    r03e5a780 r4ac5ffbb  
    11/*
    2  * Copyright (c) 2012, 2017 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2012, 2018 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    427427}
    428428
    429 static void test(test_context *ctx)
     429static void test_close(test_context *ctx)
    430430{
    431431  const char *path = "generic";
     
    508508}
    509509
     510static void test_tmpfile(test_context *ctx)
     511{
     512  rtems_resource_snapshot before;
     513  FILE *f;
     514  int rv;
     515
     516  rv = mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO);
     517  rtems_test_assert(rv == 0);
     518
     519  f = tmpfile();
     520  rtems_test_assert(f != NULL);
     521  rv = fclose(f);
     522  rtems_test_assert(rv == 0);
     523
     524  rtems_resource_snapshot_take(&before);
     525  f = tmpfile();
     526  rtems_test_assert(f != NULL);
     527  rv = fclose(f);
     528  rtems_test_assert(rv == 0);
     529  rtems_test_assert(rtems_resource_snapshot_check(&before));
     530}
     531
    510532static void Init(rtems_task_argument arg)
    511533{
    512534  TEST_BEGIN();
    513   test(&test_instance);
     535  test_close(&test_instance);
     536  test_tmpfile(&test_instance);
    514537  TEST_END();
    515538  rtems_test_exit(0);
Note: See TracChangeset for help on using the changeset viewer.