Author: tkreuzer
Date: Tue Aug 24 05:20:16 2010
New Revision: 48615
URL:
http://svn.reactos.org/svn/reactos?rev=48615&view=rev
Log:
[REGTESTS]
Add bugs_regtest. This can be used to create testcases / regression tests for already
fixed bugs. I added a first test for bug 3481
Added:
trunk/rostests/regtests/bugs/ (with props)
trunk/rostests/regtests/bugs/bug3481.c (with props)
trunk/rostests/regtests/bugs/bugs_regtest.rbuild (with props)
trunk/rostests/regtests/bugs/testlist.c (with props)
Modified:
trunk/rostests/regtests/directory.rbuild
Propchange: trunk/rostests/regtests/bugs/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Tue Aug 24 05:20:16 2010
@@ -1,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)
Propchange: trunk/rostests/regtests/bugs/
------------------------------------------------------------------------------
bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/rostests/regtests/bugs/
------------------------------------------------------------------------------
bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/rostests/regtests/bugs/
------------------------------------------------------------------------------
tsvn:logminsize = 10
Added: trunk/rostests/regtests/bugs/bug3481.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/regtests/bugs/bug3481.c?r…
==============================================================================
--- trunk/rostests/regtests/bugs/bug3481.c (added)
+++ trunk/rostests/regtests/bugs/bug3481.c [iso-8859-1] Tue Aug 24 05:20:16 2010
@@ -1,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 <stdio.h>
+#include <wine/test.h>
+#include <windows.h>
+
+#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();
+}
+
Propchange: trunk/rostests/regtests/bugs/bug3481.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/regtests/bugs/bugs_regtest.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/regtests/bugs/bugs_regtes…
==============================================================================
--- trunk/rostests/regtests/bugs/bugs_regtest.rbuild (added)
+++ trunk/rostests/regtests/bugs/bugs_regtest.rbuild [iso-8859-1] Tue Aug 24 05:20:16
2010
@@ -1,0 +1,12 @@
+<?xml version="1.0"?>
+<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
+<group>
+<module name="bugs_regtest" type="win32cui"
installbase="bin" installname="bugs_regtest.exe">
+ <include base="bugs_regtest">.</include>
+ <library>wine</library>
+ <library>gdi32</library>
+ <file>testlist.c</file>
+
+ <file>bug3481.c</file>
+</module>
+</group>
Propchange: trunk/rostests/regtests/bugs/bugs_regtest.rbuild
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/regtests/bugs/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/regtests/bugs/testlist.c?…
==============================================================================
--- trunk/rostests/regtests/bugs/testlist.c (added)
+++ trunk/rostests/regtests/bugs/testlist.c [iso-8859-1] Tue Aug 24 05:20:16 2010
@@ -1,0 +1,17 @@
+/* Automatically generated file; DO NOT EDIT!! */
+
+#define WIN32_LEAN_AND_MEAN
+#define __ROS_LONG64__
+#include <windows.h>
+
+#define STANDALONE
+#include "wine/test.h"
+
+extern void func_bug3481(void);
+
+const struct test winetest_testlist[] =
+{
+ { "bug3481", func_bug3481 },
+ { 0, 0 }
+};
+
Propchange: trunk/rostests/regtests/bugs/testlist.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/regtests/directory.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/regtests/directory.rbuild…
==============================================================================
--- trunk/rostests/regtests/directory.rbuild [iso-8859-1] (original)
+++ trunk/rostests/regtests/directory.rbuild [iso-8859-1] Tue Aug 24 05:20:16 2010
@@ -7,4 +7,7 @@
<directory name="crt">
<xi:include href="crt/crt_regtest.rbuild" />
</directory>
+ <directory name="bugs">
+ <xi:include href="bugs/bugs_regtest.rbuild" />
+ </directory>
</group>