2 * PROJECT: ReactOS bug regression tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: rostests/regtests/bugs/bug3481.c
5 * PURPOSE: Test for bug 3481
6 * PROGRAMMERS: Timo Kreuzer
10 #include <wine/test.h>
17 const char text
[COUNT
] = "abcdefghijklmnopqrstuvmxyz";
19 INT i
, aiWidth1
[COUNT
], aiWidth2
[COUNT
];
25 hdc
= CreateCompatibleDC(NULL
);
27 SelectObject(hdc
, GetStockObject(DEFAULT_GUI_FONT
));
29 /* Convert the charcaters into glyph indices */
30 result
= GetGlyphIndicesA(hdc
, text
, COUNT
, agi
, 0);
31 ok(result
!= 0, "result=%d, GetLastError()=%ld\n", result
, GetLastError());
33 /* Get the size of the string */
34 result
= GetTextExtentPoint32A(hdc
, text
, COUNT
, &size1
);
35 ok(result
!= 0, "result=%d, GetLastError()=%ld\n", result
, GetLastError());
37 /* Get the size from glyph indices */
38 result
= GetTextExtentPointI(hdc
, agi
, COUNT
, &size2
);
39 ok(result
!= 0, "result=%d, GetLastError()=%ld\n", result
, GetLastError());
42 ok(size1
.cx
== size2
.cx
, "Sizes don't match. size1.cx=%ld, size2.cx=%ld\n", size1
.cx
, size2
.cx
);
43 ok(size1
.cy
== size2
.cy
, "Sizes don't match. size1.cy=%ld, size2.cy=%ld\n", size1
.cy
, size2
.cy
);
45 /* Get the size of the string */
46 result
= GetTextExtentExPointA(hdc
, text
, COUNT
, MAXLONG
, NULL
, aiWidth1
, &size1
);
47 ok(result
!= 0, "result=%d, GetLastError()=%ld\n", result
, GetLastError());
49 /* Get the size from glyph indices */
50 result
= GetTextExtentExPointI(hdc
, agi
, COUNT
, MAXLONG
, NULL
, aiWidth2
, &size2
);
51 ok(result
!= 0, "result=%d, GetLastError()=%ld\n", result
, GetLastError());
54 ok(size1
.cx
== size2
.cx
, "Sizes don't match. size1.cx=%ld, size2.cx=%ld\n", size1
.cx
, size2
.cx
);
55 ok(size1
.cy
== size2
.cy
, "Sizes don't match. size1.cy=%ld, size2.cy=%ld\n", size1
.cy
, size2
.cy
);
57 /* Loop all characters */
58 for (i
= 0; i
< COUNT
; i
++)
60 /* Check if we got identical spacing values */
61 ok(aiWidth1
[i
] == aiWidth2
[i
], "wrong spacing, i=%d, char:%d, index:%d\n", i
, aiWidth1
[i
], aiWidth2
[i
]);