@@ -185,13 +185,34 @@ MU_TEST(test_sizeof)
185
185
186
186
mu_assert_int_eq (MEM_POOL_ERR_OK , pool_variable_aligned_sizeof (pool , b , & size ));
187
187
mu_assert_int_eq (mem_align (12 ), size );
188
+
189
+ mu_assert_int_eq (MEM_POOL_ERR_OK , pool_variable_destroy (pool ));
190
+ }
191
+
192
+ MU_TEST (test_multi_blocks )
193
+ {
194
+ VariableMemPool * pool ;
195
+ mu_assert_int_eq (MEM_POOL_ERR_OK , pool_variable_init (& pool , 1 , 10 ));
196
+
197
+ void * a , * b , * c ;
198
+
199
+ mu_assert_int_eq (MEM_POOL_ERR_OK , pool_variable_alloc (pool , 60 , & a ));
200
+ mu_assert_int_eq (MEM_POOL_ERR_OK , pool_variable_alloc (pool , 600 , & c ));
201
+ mu_assert_int_eq (MEM_POOL_ERR_OK , pool_variable_alloc (pool , 12 , & b ));
202
+
203
+ mu_assert_int_eq (MEM_POOL_ERR_OK , pool_variable_free (pool , a ));
204
+ mu_assert_int_eq (MEM_POOL_ERR_OK , pool_variable_free (pool , b ));
205
+ mu_assert_int_eq (MEM_POOL_ERR_OK , pool_variable_free (pool , c ));
206
+
207
+ mu_assert_int_eq (MEM_POOL_ERR_OK , pool_variable_destroy (pool ));
188
208
}
189
209
190
210
void run_variable_pool_test (void )
191
211
{
192
212
MU_RUN_TEST (test_alloc );
193
213
MU_RUN_TEST (test_complex_defragmentation );
194
214
MU_RUN_TEST (test_sizeof );
215
+ MU_RUN_TEST (test_multi_blocks );
195
216
196
217
MU_REPORT ();
197
218
}
0 commit comments