From cdc025c04f6490308a14edf70e0837c6ddb8ac32 Mon Sep 17 00:00:00 2001 From: Daniel Lehman Date: Tue, 10 Oct 2017 09:26:49 -0700 Subject: [PATCH 2/2] msvcp120/tests: Add tests for concurrent_vector::_Segment_index_of. Signed-off-by: Daniel Lehman --- dlls/msvcp120/tests/msvcp120.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c index cd7d457..62165e9 100644 --- a/dlls/msvcp120/tests/msvcp120.c +++ b/dlls/msvcp120/tests/msvcp120.c @@ -276,6 +276,8 @@ static void (__cdecl *p_threads__Mtx_unlock)(void *mtx); static BOOLEAN (WINAPI *pCreateSymbolicLinkA)(LPCSTR,LPCSTR,DWORD); +static size_t (__cdecl *p_vector_base_v4__Segment_index_of)(size_t); + static HMODULE msvcp; #define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) @@ -391,6 +393,8 @@ static BOOL init(void) "?_Mtx_lock@threads@stdext@@YAXPEAX@Z"); SET(p_threads__Mtx_unlock, "?_Mtx_unlock@threads@stdext@@YAXPEAX@Z"); + SET(p_vector_base_v4__Segment_index_of, + "?_Segment_index_of@_Concurrent_vector_base_v4@details@Concurrency@@KA_K_K@Z"); } else { SET(p_tr2_sys__File_size, "?_File_size@sys@tr2@std@@YA_KPBD@Z"); @@ -460,6 +464,8 @@ static BOOL init(void) "?_Mtx_lock@threads@stdext@@YAXPAX@Z"); SET(p_threads__Mtx_unlock, "?_Mtx_unlock@threads@stdext@@YAXPAX@Z"); + SET(p_vector_base_v4__Segment_index_of, + "?_Segment_index_of@_Concurrent_vector_base_v4@details@Concurrency@@KAII@Z"); #ifdef __i386__ SET(p_i386_Thrd_current, "_Thrd_current"); @@ -2093,6 +2099,35 @@ static void test_threads__Mtx(void) p_threads__Mtx_delete(mtx); } +static void test_vector_base_v4__Segment_index_of(void) +{ + size_t i; + size_t ret; + struct { + size_t x; + size_t expect; + } tests[] = { + {0, 0}, + {1, 0}, + {2, 1}, + {3, 1}, + {4, 2}, + {7, 2}, + {8, 3}, + {15, 3}, + {16, 4}, + {31, 4}, + {32, 5}, + {~0, 8*sizeof(void*)-1} + }; + + for(i=0; i