Changeset 134ac5d in mainline for uspace/lib/pcut/src/list.c


Ignore:
Timestamp:
2014-06-06T07:54:24Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8db09e4
Parents:
eeb23f2d
Message:

Update PCUT to newest version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcut/src/list.c

    reeb23f2d r134ac5d  
    3535#include <stdlib.h>
    3636#include "internal.h"
    37 #include <pcut/test.h>
     37#include <pcut/pcut.h>
    3838
    3939
     
    118118}
    119119
     120/** Hide tests that are marked to be skipped.
     121 *
     122 * Go through all tests and those that have PCUT_EXTRA_SKIP mark
     123 * as skipped with PCUT_KIND_SKIP.
     124 *
     125 * @param first Head of the list.
     126 */
     127static void detect_skipped_tests(pcut_item_t *first) {
     128        assert(first != NULL);
     129        if (first->kind == PCUT_KIND_SKIP) {
     130                first = pcut_get_real_next(first);
     131        }
     132        for (pcut_item_t *it = first; it != NULL; it = pcut_get_real_next(it)) {
     133                if (it->kind != PCUT_KIND_TEST) {
     134                        continue;
     135                }
     136                pcut_extra_t *extras = it->test.extras;
     137                while (extras->type != PCUT_EXTRA_LAST) {
     138                        if (extras->type == PCUT_EXTRA_SKIP) {
     139                                it->kind = PCUT_KIND_SKIP;
     140                                break;
     141                        }
     142                        extras++;
     143                }
     144        }
     145}
     146
    120147/** Convert the static single-linked list into a flat double-linked list.
    121148 *
     
    143170        }
    144171
     172        detect_skipped_tests(next);
     173
    145174        set_ids(next);
    146175
Note: See TracChangeset for help on using the changeset viewer.