msvcp120: Add tests for _Concurrent_vector_Internal_compact.

Signed-off-by: Hua Meng <161220092@smail.nju.edu.cn>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hua Meng 2018-08-15 21:59:42 +08:00 committed by Alexandre Julliard
parent 4ee79efd86
commit 27365695ed
1 changed files with 23 additions and 0 deletions

View File

@ -3102,6 +3102,29 @@ static void test_vector_base_v4(void)
free(b.blocks[i]); free(b.blocks[i]);
vector_alloc_count--; vector_alloc_count--;
} }
for(; i<ARRAY_SIZE(b.blocks); i++)
ok(!b.blocks[i], "b.blocks[%d] != NULL\n", i);
SET_EXPECT(concurrent_vector_int_alloc);
call_func4(p_vector_base_v4__Internal_reserve,
&v2, 17, sizeof(int), 32);
CHECK_CALLED(concurrent_vector_int_alloc);
data = call_func5(p_vector_base_v4__Internal_compact,
&v2, sizeof(int), &b, concurrent_vector_int_destroy,
concurrent_vector_int_copy);
ok(v2.first_block == 4, "v2.first_block got %ld expected 4\n", (long)v2.first_block);
ok(v2.early_size == 9, "v2.early_size got %ld expected 9\n", (long)v2.early_size);
ok(b.first_block == 4, "b.first_block got %ld expected 2\n", (long)b.first_block);
ok(v2.segment != v2.storage, "v2.segment got %p expected %p\n", v2.segment, v2.storage);
for(i = 4; i < 32; i++)
ok(v2.segment[i] == 0, "v2.segment[%d] got %p\n",
i, v2.segment[i]);
for(i=0; i<4; i++)
ok(!b.blocks[i], "b.blocks[%d] != NULL\n", i);
for(; i < 5; i++) {
ok(b.blocks[i] != NULL, "b.blocks[%d] got NULL\n", i);
free(b.blocks[i]);
vector_alloc_count--;
}
for(; i<ARRAY_SIZE(b.blocks); i++) for(; i<ARRAY_SIZE(b.blocks); i++)
ok(!b.blocks[i], "b.blocks[%d] != NULL\n", i); ok(!b.blocks[i], "b.blocks[%d] != NULL\n", i);
SET_EXPECT(concurrent_vector_int_destroy); SET_EXPECT(concurrent_vector_int_destroy);