Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5c23aa19
Commit
5c23aa19
authored
May 07, 2006
by
Andrew Ziem
Committed by
Alexandre Julliard
May 08, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Improve unit tests for case sensitivity in string tables.
parent
27800ef4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
12 deletions
+22
-12
stringtable.c
dlls/setupapi/tests/stringtable.c
+22
-12
No files found.
dlls/setupapi/tests/stringtable.c
View file @
5c23aa19
...
@@ -49,6 +49,7 @@ HMODULE hdll;
...
@@ -49,6 +49,7 @@ HMODULE hdll;
static
WCHAR
string
[]
=
{
's'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
static
WCHAR
string
[]
=
{
's'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
static
WCHAR
String
[]
=
{
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
static
WCHAR
String
[]
=
{
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
static
WCHAR
foo
[]
=
{
'f'
,
'o'
,
'o'
,
0
};
static
WCHAR
foo
[]
=
{
'f'
,
'o'
,
'o'
,
0
};
DWORD
hstring
,
hString
,
hfoo
;
/* Handles pointing to our strings */
HANDLE
table
,
table2
;
/* Handles pointing to our tables */
HANDLE
table
,
table2
;
/* Handles pointing to our tables */
static
void
load_it_up
(
void
)
static
void
load_it_up
(
void
)
...
@@ -90,23 +91,23 @@ static void test_StringTableInitialize(void)
...
@@ -90,23 +91,23 @@ static void test_StringTableInitialize(void)
static
void
test_StringTableAddString
(
void
)
static
void
test_StringTableAddString
(
void
)
{
{
DWORD
retval
,
retval2
,
retval3
,
retval4
;
DWORD
retval
;
/* case insensitive */
/* case insensitive */
retval
=
pStringTableAddString
(
table
,
string
,
0
);
hstring
=
pStringTableAddString
(
table
,
string
,
0
);
ok
(
retval
!=-
1
,
"Failed to add string to String Table
\n
"
);
ok
(
hstring
!=-
1
,
"Failed to add string to String Table
\n
"
);
retval
2
=
pStringTableAddString
(
table
,
String
,
0
);
retval
=
pStringTableAddString
(
table
,
String
,
0
);
ok
(
retval
2
!=-
1
,
"Failed to add String to String Table
\n
"
);
ok
(
retval
!=-
1
,
"Failed to add String to String Table
\n
"
);
ok
(
retval
=
retval2
,
"string and String have different IDs in String Table
\n
"
);
ok
(
hstring
==
retval
,
"string handle %lx != String handle %lx in String Table
\n
"
,
hstring
,
retval
);
retval3
=
pStringTableAddString
(
table
,
foo
,
0
);
hfoo
=
pStringTableAddString
(
table
,
foo
,
0
);
ok
(
retval3
!=-
1
,
"Failed to add foo to String Table
\n
"
);
ok
(
hfoo
!=-
1
,
"Failed to add foo to String Table
\n
"
);
ok
(
retval3
!=
retval2
,
"foo and String share the same ID in String Table
\n
"
);
ok
(
hfoo
!=
hstring
,
"foo and string share the same ID %lx in String Table
\n
"
,
hfoo
);
/* case sensitive */
/* case sensitive */
retval4
=
pStringTableAddString
(
table
,
String
,
ST_CASE_SENSITIVE_COMPARE
);
hString
=
pStringTableAddString
(
table
,
String
,
ST_CASE_SENSITIVE_COMPARE
);
ok
(
retval
!=
retval4
,
"String and string share same ID in Table
\n
"
);
ok
(
hstring
!=
hString
,
"String handle and string share same ID %lx in Table
\n
"
,
hstring
);
}
}
static
void
test_StringTableDuplicate
(
void
)
static
void
test_StringTableDuplicate
(
void
)
...
@@ -122,6 +123,9 @@ static void test_StringTableLookUpString(void)
...
@@ -122,6 +123,9 @@ static void test_StringTableLookUpString(void)
/* case insensitive */
/* case insensitive */
retval
=
pStringTableLookUpString
(
table
,
string
,
0
);
retval
=
pStringTableLookUpString
(
table
,
string
,
0
);
ok
(
retval
!=-
1
,
"Failed find string in String Table 1
\n
"
);
ok
(
retval
!=-
1
,
"Failed find string in String Table 1
\n
"
);
ok
(
retval
==
hstring
,
"Lookup for string (%lx) does not match previous handle (%lx) in String Table 1
\n
"
,
retval
,
hstring
);
retval
=
pStringTableLookUpString
(
table2
,
string
,
0
);
retval
=
pStringTableLookUpString
(
table2
,
string
,
0
);
ok
(
retval
!=-
1
,
"Failed find string in String Table 2
\n
"
);
ok
(
retval
!=-
1
,
"Failed find string in String Table 2
\n
"
);
...
@@ -134,6 +138,9 @@ static void test_StringTableLookUpString(void)
...
@@ -134,6 +138,9 @@ static void test_StringTableLookUpString(void)
retval
=
pStringTableLookUpString
(
table
,
foo
,
0
);
retval
=
pStringTableLookUpString
(
table
,
foo
,
0
);
ok
(
retval
!=-
1
,
"Failed find foo in String Table 1
\n
"
);
ok
(
retval
!=-
1
,
"Failed find foo in String Table 1
\n
"
);
ok
(
retval
==
hfoo
,
"Lookup for foo (%lx) does not match previous handle (%lx) in String Table 1
\n
"
,
retval
,
hfoo
);
retval
=
pStringTableLookUpString
(
table2
,
foo
,
0
);
retval
=
pStringTableLookUpString
(
table2
,
foo
,
0
);
ok
(
retval
!=-
1
,
"Failed find foo in String Table 2
\n
"
);
ok
(
retval
!=-
1
,
"Failed find foo in String Table 2
\n
"
);
...
@@ -141,7 +148,10 @@ static void test_StringTableLookUpString(void)
...
@@ -141,7 +148,10 @@ static void test_StringTableLookUpString(void)
/* case sensitive */
/* case sensitive */
retval
=
pStringTableLookUpString
(
table
,
string
,
ST_CASE_SENSITIVE_COMPARE
);
retval
=
pStringTableLookUpString
(
table
,
string
,
ST_CASE_SENSITIVE_COMPARE
);
retval2
=
pStringTableLookUpString
(
table
,
String
,
ST_CASE_SENSITIVE_COMPARE
);
retval2
=
pStringTableLookUpString
(
table
,
String
,
ST_CASE_SENSITIVE_COMPARE
);
ok
(
retval
!=
retval2
,
"Lookup of string = String in Table 1
\n
"
);
ok
(
retval
!=
retval2
,
"Lookup of string equals String in Table 1
\n
"
);
ok
(
retval2
==
hString
,
"Lookup for String (%lx) does not match previous handle (%lx) in String Table 1
\n
"
,
retval
,
hString
);
}
}
static
void
test_StringTableStringFromId
(
void
)
static
void
test_StringTableStringFromId
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment