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
2d323b3d
Commit
2d323b3d
authored
Jun 13, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Jun 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add a test for creating a record with a long string.
parent
d2dca89c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
db.c
dlls/msi/tests/db.c
+40
-0
No files found.
dlls/msi/tests/db.c
View file @
2d323b3d
...
...
@@ -886,6 +886,45 @@ static void test_msiexport(void)
ok
(
length
==
strlen
(
expected
),
"length of data wrong
\n
"
);
ok
(
!
lstrcmp
(
buffer
,
expected
),
"data doesn't match
\n
"
);
}
DeleteFile
(
msifile
);
}
static
void
test_longstrings
(
void
)
{
const
char
insert_query
[]
=
"INSERT INTO `strings` ( `id`, `val` ) VALUES('1', 'Z')"
;
char
*
str
;
MSIHANDLE
hdb
;
UINT
len
;
UINT
r
;
const
int
STRING_LENGTH
=
0x10005
;
DeleteFile
(
msifile
);
/* just MsiOpenDatabase should not create a file */
r
=
MsiOpenDatabase
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiOpenDatabase failed
\n
"
);
/* create a table */
r
=
try_query
(
hdb
,
"CREATE TABLE `strings` ( `id` INT, `val` CHAR(0) PRIMARY KEY `id`)"
);
ok
(
r
==
ERROR_SUCCESS
,
"query failed
\n
"
);
/* try a insert a very long string */
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
STRING_LENGTH
+
sizeof
insert_query
);
len
=
strchr
(
insert_query
,
'Z'
)
-
insert_query
;
strcpy
(
str
,
insert_query
);
memset
(
str
+
len
,
'Z'
,
STRING_LENGTH
);
strcpy
(
str
+
len
+
STRING_LENGTH
,
insert_query
+
len
+
1
);
r
=
try_query
(
hdb
,
str
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseOpenView failed
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
str
);
MsiDatabaseCommit
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseCommit failed
\n
"
);
MsiCloseHandle
(
hdb
);
DeleteFile
(
msifile
);
}
START_TEST
(
db
)
...
...
@@ -898,4 +937,5 @@ START_TEST(db)
test_viewgetcolumninfo
();
test_getcolinfo
();
test_msiexport
();
test_longstrings
();
}
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