Memory bag allocator.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include "conf_test.h"
Functions | |
int | main () |
static void | run_membag_alloc_test (const struct test_case *test) |
Unit test to check that the Membag allocates small and large chunks of memory correctly, and fails when a chunk that is too large is requested. More... | |
static void | run_membag_alloc_when_full_test (const struct test_case *test) |
Unit test to check that the Membag allocations fail once all suitable bags are already allocated. More... | |
static void | run_membag_free_test (const struct test_case *test) |
Unit test to check that the Membag frees previously allocated memory correctly. More... | |
static void | run_membag_get_test (const struct test_case *test) |
Unit test to check that the Membag functions to determine memory status work correctly. More... | |
static void | run_membag_init_test (const struct test_case *test) |
Unit test to check that the Membag is initialized and re-initialized correctly. More... | |
static void | run_membag_realloc_test (const struct test_case *test) |
Unit test to check that the Membag re-allocates previously allocated and subsequently freed blocks of memory correctly. More... | |
int main | ( | void | ) |
References usart_rs232_options::baudrate, board_init(), DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, pmic_init(), run_membag_alloc_test(), run_membag_alloc_when_full_test(), run_membag_free_test(), run_membag_get_test(), run_membag_init_test(), run_membag_realloc_test(), sleepmgr_init(), stdio_serial_init(), sysclk_init(), test_suite_run(), and usart_serial_options.
|
static |
Unit test to check that the Membag allocates small and large chunks of memory correctly, and fails when a chunk that is too large is requested.
test | Pointer to the unit test case instance |
References data, membag_alloc(), membag_init(), test_assert_false, and test_assert_true.
Referenced by main().
|
static |
Unit test to check that the Membag allocations fail once all suitable bags are already allocated.
test | Pointer to the unit test case instance |
References data, membag_alloc(), membag_get_largest_free_block_size(), membag_init(), test_assert_false, and test_assert_true.
Referenced by main().
|
static |
Unit test to check that the Membag frees previously allocated memory correctly.
test | Pointer to the unit test case instance |
References membag_alloc(), membag_free(), membag_get_total(), membag_get_total_free(), membag_init(), test_assert_false, and test_assert_true.
Referenced by main().
|
static |
Unit test to check that the Membag functions to determine memory status work correctly.
test | Pointer to the unit test case instance |
References data, membag_alloc(), membag_get_largest_free_block_size(), membag_get_total_free(), membag_init(), test_assert_false, and test_assert_true.
Referenced by main().
|
static |
Unit test to check that the Membag is initialized and re-initialized correctly.
test | Pointer to the unit test case instance |
References membag_alloc(), membag_get_total(), membag_get_total_free(), membag_init(), test_assert_false, and test_assert_true.
Referenced by main().
|
static |
Unit test to check that the Membag re-allocates previously allocated and subsequently freed blocks of memory correctly.
test | Pointer to the unit test case instance |
References data, membag_alloc(), membag_free(), membag_get_largest_free_block_size(), membag_init(), and test_assert_false.
Referenced by main().