diff --git a/rostests/regtests/bugs/bug3481.c b/rostests/regtests/bugs/bug3481.c new file mode 100644 index 00000000000..4cef4346d57 --- /dev/null +++ b/rostests/regtests/bugs/bug3481.c @@ -0,0 +1,72 @@ +/* + * PROJECT: ReactOS CRT regression tests + * LICENSE: GPL - See COPYING in the top level directory + * FILE: rostests/regtests/crt/time.c + * PURPOSE: Test for bug 3481 + * PROGRAMMERS: Timo Kreuzer + */ + +#include +#include +#include + +#define COUNT 26 + +void Test_bug3481() +{ + const char text[COUNT] = "abcdefghijklmnopqrstuvmxyz"; + WORD agi[COUNT]; + INT i, aiWidth1[COUNT], aiWidth2[COUNT]; + BOOL result; + HDC hdc; + SIZE size1, size2; + + /* Create a DC */ + hdc = CreateCompatibleDC(NULL); + + SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT)); + + /* Convert the charcaters into glyph indices */ + result = GetGlyphIndicesA(hdc, text, COUNT, agi, 0); + ok(result != 0, "result=%d, GetLastError()=%ld\n", result, GetLastError()); + + /* Get the size of the string */ + result = GetTextExtentPoint32A(hdc, text, COUNT, &size1); + ok(result != 0, "result=%d, GetLastError()=%ld\n", result, GetLastError()); + + /* Get the size from glyph indices */ + result = GetTextExtentPointI(hdc, agi, COUNT, &size2); + ok(result != 0, "result=%d, GetLastError()=%ld\n", result, GetLastError()); + + /* Compare sizes */ + ok(size1.cx == size2.cx, "Sizes don't match. size1.cx=%ld, size2.cx=%ld\n", size1.cx, size2.cx); + ok(size1.cy == size2.cy, "Sizes don't match. size1.cy=%ld, size2.cy=%ld\n", size1.cy, size2.cy); + + /* Get the size of the string */ + result = GetTextExtentExPointA(hdc, text, COUNT, MAXLONG, NULL, aiWidth1, &size1); + ok(result != 0, "result=%d, GetLastError()=%ld\n", result, GetLastError()); + + /* Get the size from glyph indices */ + result = GetTextExtentExPointI(hdc, agi, COUNT, MAXLONG, NULL, aiWidth2, &size2); + ok(result != 0, "result=%d, GetLastError()=%ld\n", result, GetLastError()); + + /* Compare sizes */ + ok(size1.cx == size2.cx, "Sizes don't match. size1.cx=%ld, size2.cx=%ld\n", size1.cx, size2.cx); + ok(size1.cy == size2.cy, "Sizes don't match. size1.cy=%ld, size2.cy=%ld\n", size1.cy, size2.cy); + + /* Loop all characters */ + for (i = 0; i < COUNT; i++) + { + /* Check if we got identical spacing values */ + ok(aiWidth1[i] == aiWidth2[i], "wrong spacing, i=%d, char:%d, index:%d\n", i, aiWidth1[i], aiWidth2[i]); + } + + /* Cleanup */ + DeleteDC(hdc); +} + +START_TEST(bug3481) +{ + Test_bug3481(); +} + diff --git a/rostests/regtests/bugs/bugs_regtest.rbuild b/rostests/regtests/bugs/bugs_regtest.rbuild new file mode 100644 index 00000000000..a02c69012b2 --- /dev/null +++ b/rostests/regtests/bugs/bugs_regtest.rbuild @@ -0,0 +1,12 @@ + + + + + . + wine + gdi32 + testlist.c + + bug3481.c + + diff --git a/rostests/regtests/bugs/testlist.c b/rostests/regtests/bugs/testlist.c new file mode 100644 index 00000000000..501e5c968f5 --- /dev/null +++ b/rostests/regtests/bugs/testlist.c @@ -0,0 +1,17 @@ +/* Automatically generated file; DO NOT EDIT!! */ + +#define WIN32_LEAN_AND_MEAN +#define __ROS_LONG64__ +#include + +#define STANDALONE +#include "wine/test.h" + +extern void func_bug3481(void); + +const struct test winetest_testlist[] = +{ + { "bug3481", func_bug3481 }, + { 0, 0 } +}; + diff --git a/rostests/regtests/directory.rbuild b/rostests/regtests/directory.rbuild index acbe991bc01..5264d803af9 100644 --- a/rostests/regtests/directory.rbuild +++ b/rostests/regtests/directory.rbuild @@ -7,4 +7,7 @@ + + +