Changeset 9e8df1fe in rtems


Ignore:
Timestamp:
Apr 10, 2018, 5:02:01 AM (15 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
7ff743d
Parents:
d869c182
git-author:
Chris Johns <chrisj@…> (04/10/18 05:02:01)
git-committer:
Chris Johns <chrisj@…> (04/11/18 01:51:57)
Message:

fstest/fsrfsbitmap01: Update RFS bitmap tests to test fixes.

Add tests to check the patches for this ticket exist and are fixed.

Close #3089

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/fstests/fsrfsbitmap01/test.c

    rd869c182 r9e8df1fe  
    196196  }
    197197
     198  /* Check the free and size are equal after opening */
     199  rtems_test_assert( control.free == control.size );
     200
    198201  /*
    199202   * This is a new bitmap with no bits set. Try and find a bit with a few
     
    245248          rc == 0 ? "PASS" : "FAIL", strerror (rc));
    246249  rtems_rfs_exit_on_error (rc, false, &control, buffer.buffer);
     250  /* Check the free is 0 */
     251  rtems_test_assert( control.free == 0 );
    247252
    248253  bit = rand () % size;
     
    252257          bit, rc == 0 ? "PASS" : "FAIL", strerror (rc));
    253258  rtems_rfs_exit_on_error (rc, false, &control, buffer.buffer);
     259  rtems_test_assert( control.free == 1);
    254260
    255261  last_bit = bit;
     
    270276          rc == 0 ? "pass" : "FAIL", strerror (rc));
    271277  rtems_rfs_exit_on_error (rc, false, &control, buffer.buffer);
     278  rtems_test_assert( control.free == 1);
    272279
    273280  rc = rtems_rfs_bitmap_map_alloc (&control, size - 1, &result, &bit);
     
    427434  rc = rtems_rfs_bitmap_map_clear_all(&control);
    428435  rtems_test_assert( rc == 0 );
     436  /* Check the free and size are equal after clearing all */
     437  rtems_test_assert( control.free == control.size );
     438
     439  /* Check accounting for bits when setting a bit, see #3089 */
     440  printf (" 35. Set a bit and check accounting.\n");
     441  rc = rtems_rfs_bitmap_map_set(&control, 0);
     442  rtems_test_assert( rc == 0 );
     443  rtems_test_assert( control.free == control.size - 1);
     444  /* Setting again should not change the accounting. */
     445  rc = rtems_rfs_bitmap_map_set(&control, 0);
     446  rtems_test_assert( rc == 0 );
     447  rtems_test_assert( control.free == control.size - 1);
    429448
    430449  rtems_rfs_bitmap_close (&control);
Note: See TracChangeset for help on using the changeset viewer.