mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
[MSVCRT_WINETEST] Sync with Wine Staging 1.9.4. CORE-10912
svn path=/trunk/; revision=70976
This commit is contained in:
parent
6be757f3b7
commit
13376ac48f
4 changed files with 104 additions and 29 deletions
|
@ -146,7 +146,7 @@ static void init_thiscall_thunk(void)
|
|||
}
|
||||
|
||||
#define call_func1(func,_this) call_thiscall_func1(func,_this)
|
||||
#define call_func2(func,_this,a) call_thiscall_func2(func,_this,(const void*)a)
|
||||
#define call_func2(func,_this,a) call_thiscall_func2(func,_this,(const void*)(a))
|
||||
|
||||
#else
|
||||
|
||||
|
@ -452,8 +452,7 @@ static void test_exception(void)
|
|||
{
|
||||
/* Check the rtti */
|
||||
type_info *ti = p__RTtypeid(&e);
|
||||
ok (ti && ti->mangled &&
|
||||
!strcmp(ti->mangled, ".?AVexception@@"), "bad rtti for e\n");
|
||||
ok (ti && !strcmp(ti->mangled, ".?AVexception@@"), "bad rtti for e\n");
|
||||
|
||||
if (ti)
|
||||
{
|
||||
|
@ -1036,15 +1035,13 @@ static void test_rtti(void)
|
|||
child_class_sig0_rtti.object_locator.type_hierarchy = RTTI_REF_SIG0(child_class_sig0_rtti, object_hierarchy, base);
|
||||
|
||||
ti = p__RTtypeid(&simple_class_sig0);
|
||||
ok (ti && ti->mangled && !strcmp(ti->mangled, "simple_class"),
|
||||
"incorrect rtti data\n");
|
||||
ok (ti && !strcmp(ti->mangled, "simple_class"), "incorrect rtti data\n");
|
||||
|
||||
casted = p__RTCastToVoid(&simple_class_sig0);
|
||||
ok (casted == (void*)&simple_class_sig0, "failed cast to void\n");
|
||||
|
||||
ti = p__RTtypeid(&child_class_sig0);
|
||||
ok (ti && ti->mangled && !strcmp(ti->mangled, "child_class"),
|
||||
"incorrect rtti data\n");
|
||||
ok (ti && !strcmp(ti->mangled, "child_class"), "incorrect rtti data\n");
|
||||
|
||||
casted = p__RTCastToVoid(&child_class_sig0);
|
||||
ok (casted == (void*)&child_class_sig0, "failed cast to void\n");
|
||||
|
@ -1064,15 +1061,13 @@ static void test_rtti(void)
|
|||
}
|
||||
|
||||
ti = p__RTtypeid(&simple_class);
|
||||
ok (ti && ti->mangled && !strcmp(ti->mangled, "simple_class"),
|
||||
"incorrect rtti data\n");
|
||||
ok (ti && !strcmp(ti->mangled, "simple_class"), "incorrect rtti data\n");
|
||||
|
||||
casted = p__RTCastToVoid(&simple_class);
|
||||
ok (casted == (void*)&simple_class, "failed cast to void\n");
|
||||
|
||||
ti = p__RTtypeid(&child_class);
|
||||
ok (ti && ti->mangled && !strcmp(ti->mangled, "child_class"),
|
||||
"incorrect rtti data\n");
|
||||
ok (ti && !strcmp(ti->mangled, "child_class"), "incorrect rtti data\n");
|
||||
|
||||
casted = p__RTCastToVoid(&child_class);
|
||||
ok (casted == (void*)&child_class, "failed cast to void\n");
|
||||
|
@ -1323,6 +1318,11 @@ static void test_demangle(void)
|
|||
/* 128 */ {"??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z",
|
||||
"class std::complex<float> & std::operator*=(class std::complex<float> &,class std::complex<float> const &)",
|
||||
"??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z", 2},
|
||||
/* 129 */ {"??$run@XVTask_Render_Preview@@@QtConcurrent@@YA?AV?$QFuture@X@@PEAVTask_Render_Preview@@P82@EAAXXZ@Z",
|
||||
"class QFuture<void> __cdecl QtConcurrent::run<void,class Task_Render_Preview>(class Task_Render_Preview * __ptr64,void (__cdecl Task_Render_Preview::*)(void) __ptr64)",
|
||||
"??$run@XVTask_Render_Preview@@@QtConcurrent@@YA?AV?$QFuture@X@@PEAVTask_Render_Preview@@P82@EAAXXZ@Z"},
|
||||
/* 130 */ {"??_E?$TStrArray@$$BY0BAA@D$0BA@@@UAEPAXI@Z",
|
||||
"public: virtual void * __thiscall TStrArray<char [256],16>::`vector deleting destructor'(unsigned int)"},
|
||||
};
|
||||
int i, num_test = (sizeof(test)/sizeof(test[0]));
|
||||
char* name;
|
||||
|
|
|
@ -148,11 +148,11 @@ todo_wine
|
|||
ok(ret != NULL || broken (ret == NULL), "ret == NULL\n");
|
||||
if(ret)
|
||||
{
|
||||
trace("Chinese_China.936=%s\n", ret);
|
||||
todo_wine
|
||||
ok(!strcmp(ret, "Chinese (Simplified)_People's Republic of China.936")
|
||||
|| !strcmp(ret, "Chinese (Simplified)_China.936")
|
||||
ok(!strcmp(ret, "Chinese (Simplified)_People's Republic of China.936") /* Vista - Win7 */
|
||||
|| !strcmp(ret, "Chinese (Simplified)_China.936") /* Win8 - Win10 */
|
||||
|| broken(!strcmp(ret, "Chinese_People's Republic of China.936")), "ret = %s\n", ret);
|
||||
trace("ret is %s\n", ret);
|
||||
}
|
||||
|
||||
ret = setlocale(LC_ALL, "csy");
|
||||
|
@ -450,33 +450,39 @@ todo_wine
|
|||
ret = setlocale(LC_ALL, "non");
|
||||
ok(ret != NULL || broken (ret == NULL), "ret == NULL\n");
|
||||
if(ret)
|
||||
ok(!strcmp( ret, "Norwegian-Nynorsk_Norway.1252")
|
||||
ok(!strcmp( ret, "Norwegian-Nynorsk_Norway.1252") /* XP - Win10 */
|
||||
|| !strcmp(ret, "Norwegian (Nynorsk)_Norway.1252")
|
||||
|| broken(!strcmp(ret, "Norwegian (Bokm\xe5l)_Norway.1252"))
|
||||
|| broken(!strcmp(ret, "Norwegian_Norway.1252")), "ret = %s\n", ret);
|
||||
|| broken(!strcmp(ret, "Norwegian_Norway.1252")), /* WinME */
|
||||
"ret = %s\n", ret);
|
||||
|
||||
ret = setlocale(LC_ALL, "nor");
|
||||
ok(ret != NULL || broken (ret == NULL), "ret == NULL\n");
|
||||
if(ret)
|
||||
ok(!strcmp(ret, "Norwegian (Bokm\xe5l)_Norway.1252")
|
||||
ok(!strcmp(ret, "Norwegian (Bokm\xe5l)_Norway.1252") /* XP - Win8 */
|
||||
|| !strcmp(ret, "Norwegian Bokm\xe5l_Norway.1252") /* Win10 */
|
||||
|| !strcmp(ret, "Norwegian (Bokmal)_Norway.1252")
|
||||
|| broken(!strcmp(ret, "Norwegian_Norway.1252")), "ret = %s\n", ret);
|
||||
|| broken(!strcmp(ret, "Norwegian_Norway.1252")), /* WinME */
|
||||
"ret = %s\n", ret);
|
||||
|
||||
ret = setlocale(LC_ALL, "norwegian-bokmal");
|
||||
ok(ret != NULL || broken (ret == NULL), "ret == NULL\n");
|
||||
if(ret)
|
||||
ok(!strcmp(ret, "Norwegian (Bokm\xe5l)_Norway.1252")
|
||||
ok(!strcmp(ret, "Norwegian (Bokm\xe5l)_Norway.1252") /* XP - Win8 */
|
||||
|| !strcmp(ret, "Norwegian Bokm\xe5l_Norway.1252") /* Win10 */
|
||||
|| !strcmp(ret, "Norwegian (Bokmal)_Norway.1252")
|
||||
|| broken(!strcmp(ret, "Norwegian_Norway.1252")), "ret = %s\n", ret);
|
||||
|| broken(!strcmp(ret, "Norwegian_Norway.1252")), /* WinME */
|
||||
"ret = %s\n", ret);
|
||||
|
||||
ret = setlocale(LC_ALL, "norwegian-nynorsk");
|
||||
ok(ret != NULL || broken (ret == NULL), "ret == NULL\n");
|
||||
if(ret)
|
||||
ok(!strcmp(ret, "Norwegian-Nynorsk_Norway.1252")
|
||||
ok(!strcmp(ret, "Norwegian-Nynorsk_Norway.1252") /* Vista - Win10 */
|
||||
|| !strcmp(ret, "Norwegian (Nynorsk)_Norway.1252")
|
||||
|| broken(!strcmp(ret, "Norwegian_Norway.1252"))
|
||||
|| broken(!strcmp(ret, "Norwegian_Norway.1252")) /* WinME */
|
||||
|| broken(!strcmp(ret, "Norwegian (Bokmal)_Norway.1252"))
|
||||
|| broken(!strcmp(ret, "Norwegian (Bokm\xe5l)_Norway.1252")), "ret = %s\n", ret);
|
||||
|| broken(!strcmp(ret, "Norwegian (Bokm\xe5l)_Norway.1252")) /* XP & 2003 */,
|
||||
"ret = %s\n", ret);
|
||||
|
||||
ret = setlocale(LC_ALL, "plk");
|
||||
ok(ret != NULL || broken (ret == NULL), "ret == NULL\n");
|
||||
|
@ -671,12 +677,12 @@ static void test__Gettnames(void)
|
|||
return;
|
||||
|
||||
ret = _Gettnames();
|
||||
size = ret->data-(char*)ret;
|
||||
size = ret->str[0]-(char*)ret;
|
||||
/* Newer version of the structure stores both ascii and unicode strings.
|
||||
* Unicode strings are only initialized on Windows 7
|
||||
*/
|
||||
if(sizeof(void*) == 8)
|
||||
ok(size==0x2c0 || broken(size==0x170), "structure size: %x\n", size);
|
||||
ok(size==0x2c0 || broken(size==0x168), "structure size: %x\n", size);
|
||||
else
|
||||
ok(size==0x164 || broken(size==0xb8), "structure size: %x\n", size);
|
||||
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "wine/test.h"
|
||||
#include <wine/test.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include "msvcrt.h"
|
||||
#include <msvcrt.h>
|
||||
#include <process.h>
|
||||
|
||||
static inline float __port_infinity(void)
|
||||
{
|
||||
|
@ -262,7 +263,7 @@ static void test__get_doserrno(void)
|
|||
out = 0xdeadbeef;
|
||||
ret = p_get_doserrno(&out);
|
||||
ok(ret == 0, "Expected _get_doserrno to return 0, got %d\n", ret);
|
||||
ok(out == ERROR_INVALID_CMM, "Expected output variable to be ERROR_INVAID_CMM, got %d\n", out);
|
||||
ok(out == ERROR_INVALID_CMM, "Expected output variable to be ERROR_INVALID_CMM, got %d\n", out);
|
||||
}
|
||||
|
||||
static void test__get_errno(void)
|
||||
|
@ -539,6 +540,66 @@ static void test_math_functions(void)
|
|||
ok(errno == 0xdeadbeef, "errno = %d\n", errno);
|
||||
}
|
||||
|
||||
static void __cdecl test_thread_func(void *end_thread_type)
|
||||
{
|
||||
if (end_thread_type == (void*)1)
|
||||
_endthread();
|
||||
else if (end_thread_type == (void*)2)
|
||||
ExitThread(0);
|
||||
else if (end_thread_type == (void*)3)
|
||||
_endthreadex(0);
|
||||
}
|
||||
|
||||
static unsigned __stdcall test_thread_func_ex(void *arg)
|
||||
{
|
||||
_endthread();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void test_thread_handle_close(void)
|
||||
{
|
||||
HANDLE hThread;
|
||||
DWORD ret;
|
||||
|
||||
/* _beginthread: handle is not closed on ExitThread and _endthreadex */
|
||||
hThread = (HANDLE)_beginthread(test_thread_func, 0, (void*)0);
|
||||
ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno);
|
||||
WaitForSingleObject(hThread, INFINITE);
|
||||
ret = CloseHandle(hThread);
|
||||
ok(!ret, "ret = %d\n", ret);
|
||||
|
||||
hThread = (HANDLE)_beginthread(test_thread_func, 0, (void*)1);
|
||||
ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno);
|
||||
WaitForSingleObject(hThread, INFINITE);
|
||||
ret = CloseHandle(hThread);
|
||||
ok(!ret, "ret = %d\n", ret);
|
||||
|
||||
hThread = (HANDLE)_beginthread(test_thread_func, 0, (void*)2);
|
||||
ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno);
|
||||
Sleep(150);
|
||||
ret = WaitForSingleObject(hThread, INFINITE);
|
||||
ok(ret == WAIT_OBJECT_0, "ret = %d\n", ret);
|
||||
ret = CloseHandle(hThread);
|
||||
ok(ret, "ret = %d\n", ret);
|
||||
|
||||
hThread = (HANDLE)_beginthread(test_thread_func, 0, (void*)3);
|
||||
ok(hThread != INVALID_HANDLE_VALUE, "_beginthread failed (%d)\n", errno);
|
||||
Sleep(150);
|
||||
ret = WaitForSingleObject(hThread, INFINITE);
|
||||
ok(ret == WAIT_OBJECT_0, "ret = %d\n", ret);
|
||||
ret = CloseHandle(hThread);
|
||||
ok(ret, "ret = %d\n", ret);
|
||||
|
||||
/* _beginthreadex: handle is not closed on _endthread */
|
||||
hThread = (HANDLE)_beginthreadex(NULL,0, test_thread_func_ex, NULL, 0, NULL);
|
||||
ok(hThread != NULL, "_beginthreadex failed (%d)\n", errno);
|
||||
Sleep(150);
|
||||
ret = WaitForSingleObject(hThread, INFINITE);
|
||||
ok(ret == WAIT_OBJECT_0, "ret = %d\n", ret);
|
||||
ret = CloseHandle(hThread);
|
||||
ok(ret, "ret = %d\n", ret);
|
||||
}
|
||||
|
||||
START_TEST(misc)
|
||||
{
|
||||
int arg_c;
|
||||
|
@ -567,4 +628,5 @@ START_TEST(misc)
|
|||
test__invalid_parameter();
|
||||
test_qsort_s();
|
||||
test_math_functions();
|
||||
test_thread_handle_close();
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ static void test_sscanf( void )
|
|||
ret = sscanf(buffer, "%lld", &result64);
|
||||
ok(ret == 1, "Wrong number of arguments read: %d\n", ret);
|
||||
ret = sprintf(buffer1, "%lld", result64);
|
||||
ok(ret==14 || broken(ret==10), "sprintf retuned %d\n", ret);
|
||||
ok(ret==14 || broken(ret==10), "sprintf returned %d\n", ret);
|
||||
if(ret == 14)
|
||||
ok(!strcmp(buffer, buffer1), "got %s, expected %s\n", buffer1, buffer);
|
||||
|
||||
|
@ -244,6 +244,13 @@ static void test_sscanf( void )
|
|||
ret = sscanf(buffer, "%d:%d%n", &hour, &min, &number_so_far);
|
||||
ok(ret == 2, "Wrong number of arguments read: %d\n", ret);
|
||||
ok(number_so_far == 4, "%%n yielded wrong result: %d\n", number_so_far);
|
||||
|
||||
buffer[0] = 0;
|
||||
buffer1[0] = 0;
|
||||
ret = sscanf("test=value\xda", "%[^=] = %[^;]", buffer, buffer1);
|
||||
ok(ret == 2, "got %d\n", ret);
|
||||
ok(!strcmp(buffer, "test"), "buf %s\n", buffer);
|
||||
ok(!strcmp(buffer1, "value\xda"), "buf %s\n", buffer1);
|
||||
}
|
||||
|
||||
static void test_sscanf_s(void)
|
||||
|
|
Loading…
Reference in a new issue