/** * ASSERT_NE(): * Check the condition * @_expected != @_seen * If false, print failed test message (if running with --verbose) and then * assert.
*/ #define ASSERT_NE(_expected, _seen) do { \ if ((_expected) == (_seen)) \
test_fail(); \
assert((_expected) != (_seen)); \
} while (0)
/** * ASSERT_LT(): * Check the condition * @_expected < @_seen * If false, print failed test message (if running with --verbose) and then * assert.
*/ #define ASSERT_LT(_expected, _seen) do { \ if ((_expected) >= (_seen)) \
test_fail(); \
assert((_expected) < (_seen)); \
} while (0)
/** * ASSERT_LE(): * Check the condition * @_expected <= @_seen * If false, print failed test message (if running with --verbose) and then * assert.
*/ #define ASSERT_LE(_expected, _seen) do { \ if ((_expected) > (_seen)) \
test_fail(); \
assert((_expected) <= (_seen)); \
} while (0)
/** * ASSERT_MEM_EQ(): * Check that the first @_size bytes of @_seen are all equal to @_expected. * If false, print failed test message (if running with --verbose) and then * assert.
*/ #define ASSERT_MEM_EQ(_seen, _expected, _size) do { \ for (int _i = 0; _i < (_size); _i++) { \
ASSERT_EQ(((char *)_seen)[_i], (_expected)); \
} \
} while (0)
/** * ASSERT_MEM_NE(): * Check that none of the first @_size bytes of @_seen are equal to @_expected. * If false, print failed test message (if running with --verbose) and then * assert.
*/ #define ASSERT_MEM_NE(_seen, _expected, _size) do { \ for (int _i = 0; _i < (_size); _i++) { \
ASSERT_NE(((char *)_seen)[_i], (_expected)); \
} \
} while (0)
#define PREFIX_PUSH() prefix_push(__func__)
/* * Available memory registered with memblock needs to be valid for allocs * test to run. This is a convenience wrapper for memory allocated in * dummy_physical_memory_init() that is later registered with memblock * in setup_memblock().
*/ struct test_memory { void *base;
};
struct region {
phys_addr_t base;
phys_addr_t size;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.