Function report |
Source Code:lib\kunit\test.c |
Create Date:2022-07-28 06:38:48 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:kunit_alloc_and_get_resource
Proto:struct kunit_resource *kunit_alloc_and_get_resource(struct kunit *test, kunit_resource_init_t init, kunit_resource_free_t free, gfp_t internal_gfp, void *context)
Type:struct kunit_resource
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct kunit * | test | |
| kunit_resource_init_t | init | |
| kunit_resource_free_t | free | |
| gfp_t | internal_gfp | |
| void * | context |
| 330 | res = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). |
| 331 | If Not res Then Return NULL |
| 335 | If ret Then Return NULL |
| 339 | spin_lock( & Guards all mutable test state. ) |
| 343 | Return res |
| Name | Describe |
|---|---|
| kunit_resource_test_alloc_resource | |
| kunit_resource_test_destroy_resource | |
| kunit_resource_test_cleanup_resources | |
| fake_resource_1_init | |
| kunit_resource_test_proper_free_ordering | TODO(brendanhiggins@google.com): replace the arrays that keep track of the* order of allocation and freeing with strict mocks using the IN_SEQUENCE macro* to assert allocation and freeing order when the feature becomes available. |
| kunit_alloc_resource | kunit_alloc_resource() - Allocates a *test managed resource* |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |