Commit b8e1b138 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

d3dxof/tests: Use ULONG instead of unsigned long.

parent 4de7ac85
...@@ -61,7 +61,7 @@ static void init_function_pointers(void) ...@@ -61,7 +61,7 @@ static void init_function_pointers(void)
pDirectXFileCreate = (void *)GetProcAddress(hd3dxof, "DirectXFileCreate"); pDirectXFileCreate = (void *)GetProcAddress(hd3dxof, "DirectXFileCreate");
} }
static unsigned long getRefcount(IUnknown *iface) static ULONG getRefcount(IUnknown *iface)
{ {
IUnknown_AddRef(iface); IUnknown_AddRef(iface);
return IUnknown_Release(iface); return IUnknown_Release(iface);
...@@ -70,7 +70,7 @@ static unsigned long getRefcount(IUnknown *iface) ...@@ -70,7 +70,7 @@ static unsigned long getRefcount(IUnknown *iface)
static void test_refcount(void) static void test_refcount(void)
{ {
HRESULT hr; HRESULT hr;
unsigned long ref; ULONG ref;
LPDIRECTXFILE lpDirectXFile = NULL; LPDIRECTXFILE lpDirectXFile = NULL;
LPDIRECTXFILEENUMOBJECT lpdxfeo; LPDIRECTXFILEENUMOBJECT lpdxfeo;
LPDIRECTXFILEDATA lpdxfd; LPDIRECTXFILEDATA lpdxfd;
...@@ -91,11 +91,11 @@ static void test_refcount(void) ...@@ -91,11 +91,11 @@ static void test_refcount(void)
} }
ref = getRefcount( (IUnknown *) lpDirectXFile); ref = getRefcount( (IUnknown *) lpDirectXFile);
ok(ref == 1, "Got refcount %ld, expected 1\n", ref); ok(ref == 1, "Got refcount %d, expected 1\n", ref);
ref = IDirectXFile_AddRef(lpDirectXFile); ref = IDirectXFile_AddRef(lpDirectXFile);
ok(ref == 2, "Got refcount %ld, expected 1\n", ref); ok(ref == 2, "Got refcount %d, expected 1\n", ref);
ref = IDirectXFile_Release(lpDirectXFile); ref = IDirectXFile_Release(lpDirectXFile);
ok(ref == 1, "Got refcount %ld, expected 1\n", ref); ok(ref == 1, "Got refcount %d, expected 1\n", ref);
hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template, strlen(template)); hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template, strlen(template));
ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr); ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
...@@ -105,36 +105,36 @@ static void test_refcount(void) ...@@ -105,36 +105,36 @@ static void test_refcount(void)
hr = IDirectXFile_CreateEnumObject(lpDirectXFile, &dxflm, DXFILELOAD_FROMMEMORY, &lpdxfeo); hr = IDirectXFile_CreateEnumObject(lpDirectXFile, &dxflm, DXFILELOAD_FROMMEMORY, &lpdxfeo);
ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr); ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
ref = getRefcount( (IUnknown *) lpDirectXFile); ref = getRefcount( (IUnknown *) lpDirectXFile);
ok(ref == 1, "Got refcount %ld, expected 1\n", ref); ok(ref == 1, "Got refcount %d, expected 1\n", ref);
ref = getRefcount( (IUnknown *) lpdxfeo); ref = getRefcount( (IUnknown *) lpdxfeo);
ok(ref == 1, "Got refcount %ld, expected 1\n", ref); ok(ref == 1, "Got refcount %d, expected 1\n", ref);
hr = IDirectXFileEnumObject_GetNextDataObject(lpdxfeo, &lpdxfd); hr = IDirectXFileEnumObject_GetNextDataObject(lpdxfeo, &lpdxfd);
ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr); ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
ref = getRefcount( (IUnknown *) lpDirectXFile); ref = getRefcount( (IUnknown *) lpDirectXFile);
ok(ref == 1, "Got refcount %ld, expected 1\n", ref); ok(ref == 1, "Got refcount %d, expected 1\n", ref);
ref = getRefcount( (IUnknown *) lpdxfeo); ref = getRefcount( (IUnknown *) lpdxfeo);
ok(ref == 1, "Got refcount %ld, expected 1\n", ref); ok(ref == 1, "Got refcount %d, expected 1\n", ref);
/* Enum object gets references to all top level objects */ /* Enum object gets references to all top level objects */
ref = getRefcount( (IUnknown *) lpdxfd); ref = getRefcount( (IUnknown *) lpdxfd);
ok(ref == 2, "Got refcount %ld, expected 2\n", ref); ok(ref == 2, "Got refcount %d, expected 2\n", ref);
ref = IDirectXFile_Release(lpDirectXFile); ref = IDirectXFile_Release(lpDirectXFile);
ok(ref == 0, "Got refcount %ld, expected 0\n", ref); ok(ref == 0, "Got refcount %d, expected 0\n", ref);
/* Nothing changes for all other objects */ /* Nothing changes for all other objects */
ref = getRefcount( (IUnknown *) lpdxfeo); ref = getRefcount( (IUnknown *) lpdxfeo);
ok(ref == 1, "Got refcount %ld, expected 1\n", ref); ok(ref == 1, "Got refcount %d, expected 1\n", ref);
ref = getRefcount( (IUnknown *) lpdxfd); ref = getRefcount( (IUnknown *) lpdxfd);
ok(ref == 2, "Got refcount %ld, expected 1\n", ref); ok(ref == 2, "Got refcount %d, expected 1\n", ref);
ref = IDirectXFileEnumObject_Release(lpdxfeo); ref = IDirectXFileEnumObject_Release(lpdxfeo);
ok(ref == 0, "Got refcount %ld, expected 0\n", ref); ok(ref == 0, "Got refcount %d, expected 0\n", ref);
/* Enum object releases references to all top level objects */ /* Enum object releases references to all top level objects */
ref = getRefcount( (IUnknown *) lpdxfd); ref = getRefcount( (IUnknown *) lpdxfd);
ok(ref == 1, "Got refcount %ld, expected 1\n", ref); ok(ref == 1, "Got refcount %d, expected 1\n", ref);
ref = IDirectXFileData_Release(lpdxfd); ref = IDirectXFileData_Release(lpdxfd);
ok(ref == 0, "Got refcount %ld, expected 0\n", ref); ok(ref == 0, "Got refcount %d, expected 0\n", ref);
} }
/* Set it to 1 to expand the string when dumping the object. This is useful when there is /* Set it to 1 to expand the string when dumping the object. This is useful when there is
...@@ -236,7 +236,7 @@ static void process_data(LPDIRECTXFILEDATA lpDirectXFileData, int* plevel) ...@@ -236,7 +236,7 @@ static void process_data(LPDIRECTXFILEDATA lpDirectXFileData, int* plevel)
static void test_dump(void) static void test_dump(void)
{ {
HRESULT hr; HRESULT hr;
unsigned long ref; ULONG ref;
LPDIRECTXFILE lpDirectXFile = NULL; LPDIRECTXFILE lpDirectXFile = NULL;
LPDIRECTXFILEENUMOBJECT lpDirectXFileEnumObject = NULL; LPDIRECTXFILEENUMOBJECT lpDirectXFileEnumObject = NULL;
LPDIRECTXFILEDATA lpDirectXFileData = NULL; LPDIRECTXFILEDATA lpDirectXFileData = NULL;
...@@ -294,10 +294,10 @@ static void test_dump(void) ...@@ -294,10 +294,10 @@ static void test_dump(void)
ok(hr == DXFILE_OK || hr == DXFILEERR_NOMOREOBJECTS, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr); ok(hr == DXFILE_OK || hr == DXFILEERR_NOMOREOBJECTS, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr);
ref = IDirectXFile_Release(lpDirectXFileEnumObject); ref = IDirectXFile_Release(lpDirectXFileEnumObject);
ok(ref == 0, "Got refcount %ld, expected 0\n", ref); ok(ref == 0, "Got refcount %d, expected 0\n", ref);
ref = IDirectXFile_Release(lpDirectXFile); ref = IDirectXFile_Release(lpDirectXFile);
ok(ref == 0, "Got refcount %ld, expected 0\n", ref); ok(ref == 0, "Got refcount %d, expected 0\n", ref);
CloseHandle(hFile); CloseHandle(hFile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment