diff options
Diffstat (limited to 'include/test')
-rw-r--r-- | include/test/suites.h | 4 | ||||
-rw-r--r-- | include/test/test.h | 10 | ||||
-rw-r--r-- | include/test/ut.h | 16 |
3 files changed, 29 insertions, 1 deletions
diff --git a/include/test/suites.h b/include/test/suites.h index 20970f08d66..0748185eaf7 100644 --- a/include/test/suites.h +++ b/include/test/suites.h @@ -13,6 +13,7 @@ struct unit_test; * cmd_ut_category() - Run a category of unit tests * * @name: Category name + * @prefix: Prefix of test name * @tests: List of tests to run * @n_ents: Number of tests in @tests * @argc: Argument count provided. Must be >= 1. If this is 1 then all @@ -20,7 +21,8 @@ struct unit_test; * @argv: Arguments: argv[1] is the test to run (if @argc >= 2) * @return 0 if OK, CMD_RET_FAILURE on failure */ -int cmd_ut_category(const char *name, struct unit_test *tests, int n_ents, +int cmd_ut_category(const char *name, const char *prefix, + struct unit_test *tests, int n_ents, int argc, char * const argv[]); int do_ut_bloblist(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]); diff --git a/include/test/test.h b/include/test/test.h index 98fbcd11f6f..e5bef4759a6 100644 --- a/include/test/test.h +++ b/include/test/test.h @@ -46,5 +46,15 @@ struct unit_test { .func = _name, \ } +/* Sizes for devres tests */ +enum { + TEST_DEVRES_SIZE = 100, + TEST_DEVRES_COUNT = 10, + TEST_DEVRES_TOTAL = TEST_DEVRES_SIZE * TEST_DEVRES_COUNT, + + /* A few different sizes */ + TEST_DEVRES_SIZE2 = 15, + TEST_DEVRES_SIZE3 = 37, +}; #endif /* __TEST_TEST_H */ diff --git a/include/test/ut.h b/include/test/ut.h index fbfde10719f..f616c202f35 100644 --- a/include/test/ut.h +++ b/include/test/ut.h @@ -149,4 +149,20 @@ void ut_failf(struct unit_test_state *uts, const char *fname, int line, /* Assert that an operation succeeds (returns 0) */ #define ut_assertok(cond) ut_asserteq(0, cond) +/** + * ut_check_free() - Return the number of bytes free in the malloc() pool + * + * @return bytes free + */ +ulong ut_check_free(void); + +/** + * ut_check_delta() - Return the number of bytes allocated/freed + * + * @last: Last value from ut_check_free + * @return free memory delta from @last; positive means more memory has been + * allocated, negative means less has been allocated (i.e. some is freed) + */ +long ut_check_delta(ulong last); + #endif |