27static const char *
msifile =
"winetest-record.msi";
58 const char str[] =
"hello";
63 ok(
r==-1,
"field count for invalid record not -1\n");
66 ok(
r==0,
"invalid handle not considered to be non-null...\n");
76 ok(
h==0,
"created record with -1 elements\n");
78 ok(
h==0,
"created record with 0x10000 elements\n");
84 ok(
r == 0,
"MsiRecordDataSize returned wrong error\n");
89 ok(
h!=0,
"couldn't create record with zero elements\n");
91 ok(
r==0,
"field count should be zero\n");
93 ok(
r,
"new record wasn't null\n");
95 ok(
r,
"out of range record wasn't null\n");
97 ok(
r,
"out of range record wasn't null\n");
99 ok(
r==0,
"size of null record is 0\n");
104 ok(sz==0,
"null string too long\n");
105 ok(
buf[0]==0,
"null string not set\n");
111 ok(
r==0,
"new record is null after setting an integer\n");
113 ok(
r==
sizeof(
DWORD),
"size of integer record is 4\n");
121 ok(
r==0,
"new record is null after setting an integer\n");
123 ok(
r == 1,
"failed to get integer\n");
129 ok(
r ==
TRUE,
"null string not null field\n");
131 ok(
r == 0,
"size of string record is strlen\n");
136 ok(
buf[0] == 0,
"MsiRecordGetStringA returned the wrong string\n");
137 ok(sz == 0,
"MsiRecordGetStringA returned the wrong length\n");
142 ok(bufW[0] == 0,
"MsiRecordGetStringW returned the wrong string\n");
143 ok(sz == 0,
"MsiRecordGetStringW returned the wrong length\n");
147 ok(
r ==
TRUE,
"null string not null field\n");
149 ok(
r == 0,
"size of string record is strlen\n");
154 ok(
buf[0] == 0,
"MsiRecordGetStringA returned the wrong string\n");
155 ok(sz == 0,
"MsiRecordGetStringA returned the wrong length\n");
160 ok(bufW[0] == 0,
"MsiRecordGetStringW returned the wrong string\n");
161 ok(sz == 0,
"MsiRecordGetStringW returned the wrong length\n");
167 ok(
r ==
FALSE,
"expected field to be non-null\n");
171 ok(
r ==
TRUE,
"expected field to be null\n");
175 ok(
buf[0] == 0,
"MsiRecordGetStringA returned the wrong string\n");
176 ok(sz == 0,
"MsiRecordGetStringA returned the wrong length\n");
184 ok(
r==
sizeof str-1,
"size of string record is strlen\n");
189 ok(0==
strcmp(
buf,
str),
"MsiRecordGetStringA returned the wrong string\n");
190 ok(sz ==
sizeof str-1,
"MsiRecordGetStringA returned the wrong length\n");
195 ok(sz ==
sizeof str-1,
"MsiRecordGetStringA returned the wrong length\n");
196 ok(0==
strncmp(
buf,
str,
sizeof str-3),
"MsiRecordGetStringA returned the wrong string\n");
197 ok(
buf[
sizeof str - 3]==0,
"string wasn't nul terminated\n");
203 ok(sz ==
sizeof str-1,
"MsiRecordGetStringA returned the wrong length\n");
204 ok(0==
strcmp(
buf,
str),
"MsiRecordGetStringA returned the wrong string\n");
207 memset(bufW, 0,
sizeof bufW);
211 ok(sz == 5,
"MsiRecordGetStringA returned the wrong length\n");
212 ok(!
memcmp(bufW,
L"hello", 8),
"MsiRecordGetStringA returned the wrong string\n");
218 ok(sz == 5,
"MsiRecordGetStringA returned the wrong length\n");
219 ok(
'x'==bufW[0],
"MsiRecordGetStringA returned the wrong string\n");
225 ok(sz == 5,
"MsiRecordGetStringA returned the wrong length\n");
226 ok(0==
memcmp(
buf,
str,4),
"MsiRecordGetStringA returned the wrong string\n");
232 ok(sz == 5,
"MsiRecordGetStringA returned the wrong length\n");
233 ok(
'x'==
buf[0],
"MsiRecordGetStringA returned the wrong string\n");
241 ok(
r,
"cleared record wasn't null\n");
247 ok(
i == 42,
"should get invalid integer\n");
251 ok(
i == -42,
"should get invalid integer\n");
271 ok(
i == -1530494976,
"should get truncated integer\n");
275 ok(
i == 2147483647,
"should get maxint\n");
279 ok(
i == -2147483647,
"should get -maxint-1\n");
283 ok(
i == 1,
"should get one\n");
303 ok(sz == 2,
"length wrong\n");
308 ok(0==
strcmp(
buf,
"32"),
"failed to get string from integer\n");
315 ok(sz == 3,
"length wrong\n");
319 ok(0==
strcmp(
buf,
"-32"),
"failed to get string from integer\n");
328 ok(sz ==
sizeof buf,
"set sz\n");
330 ok(
r == 0,
"MsiRecordDataSize returned wrong size\n");
332 ok(
r == 4,
"MsiRecordDataSize returned wrong size\n");
345 ok(
h,
"couldn't create a two field record\n");
358 ok(sz==26,
"couldn't get size of stream\n");
362 ok(sz==0,
"short read\n");
366 ok(sz==
sizeof buf,
"short read\n");
367 ok(!
strncmp(
buf,
"abcdefghij",10),
"read the wrong thing\n");
371 ok(sz==
sizeof buf,
"short read\n");
372 ok(!
strncmp(
buf,
"klmnopqrst",10),
"read the wrong thing\n");
377 ok(sz==6,
"short read\n");
378 ok(!
strcmp(
buf,
"uvwxyz"),
"read the wrong thing\n");
383 ok(sz==0,
"size non-zero at end of stream\n");
384 ok(
buf[0]==0,
"read something at end of the stream\n");
390 ok(sz==26,
"couldn't get size of stream\n");
392 ok(
r == 26,
"MsiRecordDataSize returned wrong size\n");
408 ok(rec != 0,
"Expected a valid handle\n");
413 ok(sz == 0,
"Expected 0, got %lu\n", sz);
420 ok(sz == 0,
"Expected 0, got %lu\n", sz);
427 ok(sz == 0,
"Expected 0, got %lu\n", sz);
432 ok(rec != 0,
"Expected a valid handle\n");
440 ok(sz == 1,
"Expected 1, got %lu\n",sz);
447 ok(sz == 1,
"Expected 1, got %lu\n", sz);
457 ok(sz == 2,
"Expected 2, got %lu\n", sz);
469 ok(rec != 0,
"Expected a valid handle\n");
475 ok(
val == 5,
"Expected 5, got %d\n",
val);
481 ok(
val == -5,
"Expected -5, got %d\n",
val);
501 ok(rec != 0,
"Expected a valid handle\n");
511 ok(sz == 0,
"Expected 0, got %lu\n", sz);
514 ok(
r ==
TRUE,
"Expected TRUE, got %d\n",
r);
530 ok(sz == 0,
"Expected 0, got %lu\n", sz);
533 ok(
r ==
TRUE,
"Expected TRUE, got %d\n",
r);
536 ok(
r == 42,
"Expected 42, got %d\n",
r);
549 ok(sz == 0,
"Expected 0, got %lu\n", sz);
552 ok(
r ==
TRUE,
"Expected TRUE, got %d\n",
r);
559 ok(sz == 7,
"Expected 7, got %lu\n", sz);
566 query =
"CREATE TABLE `drone` ( "
567 "`id` INT, `name` CHAR(32), `number` CHAR(32) "
578 query =
"INSERT INTO `drone` ( `id`, `name`, `number` )"
579 "VALUES('1', 'Abe', '8675309')";
600 ok(sz == 5,
"Expected 5, got %lu\n", sz);
603 ok(
r ==
FALSE,
"Expected FALSE, got %d\n",
r);
610 query =
"SELECT * FROM `drone` WHERE `id` = 1";
622 ok(
r ==
FALSE,
"Expected FALSE, got %d\n",
r);
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strcpy(char *DstString, const char *SrcString)
#define ERROR_INVALID_PARAMETER
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define ERROR_INVALID_HANDLE
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
UINT WINAPI MsiRecordClearData(MSIHANDLE handle)
UINT WINAPI MsiRecordDataSize(MSIHANDLE handle, UINT iField)
int WINAPI MsiRecordGetInteger(MSIHANDLE handle, UINT iField)
UINT WINAPI MsiRecordGetStringA(MSIHANDLE handle, UINT iField, char *szValue, DWORD *pcchValue)
MSIHANDLE WINAPI MsiCreateRecord(UINT cParams)
UINT WINAPI MsiRecordGetStringW(MSIHANDLE handle, UINT iField, WCHAR *szValue, DWORD *pcchValue)
BOOL WINAPI MsiRecordIsNull(MSIHANDLE handle, UINT iField)
UINT WINAPI MsiRecordSetInteger(MSIHANDLE handle, UINT iField, int iVal)
UINT WINAPI MsiRecordSetStreamA(MSIHANDLE hRecord, UINT iField, const char *szFilename)
UINT WINAPI MsiRecordSetStringA(MSIHANDLE handle, UINT iField, const char *szValue)
UINT WINAPI MsiRecordReadStream(MSIHANDLE handle, UINT iField, char *buf, DWORD *sz)
UINT WINAPI MsiRecordGetFieldCount(MSIHANDLE handle)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
static const WCHAR msifileW[]
static void test_msirecord(void)
static void test_fieldzero(void)
static void test_MsiRecordGetString(void)
static const char * msifile
static void test_MsiRecordGetInteger(void)
static BOOL create_temp_file(char *name)
UINT WINAPI MsiViewClose(MSIHANDLE hView)
UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
UINT WINAPI MsiDatabaseGetPrimaryKeysA(MSIHANDLE hdb, const char *table, MSIHANDLE *phRec)
UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE hdb, const char *szQuery, MSIHANDLE *phView)
UINT WINAPI MsiViewFetch(MSIHANDLE hView, MSIHANDLE *record)
DWORD WINAPI GetLastError(void)
#define ERROR_INVALID_DATATYPE
#define ERROR_INVALID_TABLE