wing32: Add tests.
This commit is contained in:
parent
fad3e416f8
commit
edf0635ed4
5 changed files with 72 additions and 0 deletions
1
configure
vendored
1
configure
vendored
|
@ -22440,6 +22440,7 @@ wine_fn_config_makefile dlls/winex11.drv enable_winex11_drv
|
|||
wine_fn_config_makefile dlls/winexinput.sys enable_winexinput_sys
|
||||
wine_fn_config_makefile dlls/wing.dll16 enable_win16
|
||||
wine_fn_config_makefile dlls/wing32 enable_wing32
|
||||
wine_fn_config_makefile dlls/wing32/tests enable_tests
|
||||
wine_fn_config_makefile dlls/winhttp enable_winhttp
|
||||
wine_fn_config_makefile dlls/winhttp/tests enable_tests
|
||||
wine_fn_config_makefile dlls/wininet enable_wininet
|
||||
|
|
|
@ -3257,6 +3257,7 @@ WINE_CONFIG_MAKEFILE(dlls/winex11.drv)
|
|||
WINE_CONFIG_MAKEFILE(dlls/winexinput.sys)
|
||||
WINE_CONFIG_MAKEFILE(dlls/wing.dll16,enable_win16)
|
||||
WINE_CONFIG_MAKEFILE(dlls/wing32)
|
||||
WINE_CONFIG_MAKEFILE(dlls/wing32/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/winhttp)
|
||||
WINE_CONFIG_MAKEFILE(dlls/winhttp/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/wininet)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
MODULE = wing32.dll
|
||||
IMPORTLIB = wing32
|
||||
IMPORTS = user32 gdi32
|
||||
|
||||
SOURCES = \
|
||||
|
|
5
dlls/wing32/tests/Makefile.in
Normal file
5
dlls/wing32/tests/Makefile.in
Normal file
|
@ -0,0 +1,5 @@
|
|||
TESTDLL = wing32.dll
|
||||
IMPORTS = wing32 gdi32
|
||||
|
||||
SOURCES = \
|
||||
wing32.c
|
64
dlls/wing32/tests/wing32.c
Normal file
64
dlls/wing32/tests/wing32.c
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Unit test suite for wing32 functions
|
||||
*
|
||||
* Copyright 2024 Bernhard Übelacker
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "wine/test.h"
|
||||
|
||||
HDC WINAPI WinGCreateDC(void);
|
||||
HBITMAP WINAPI WinGCreateBitmap(HDC, BITMAPINFO*, void **);
|
||||
void* WINAPI WinGGetDIBPointer(HBITMAP, BITMAPINFO*);
|
||||
|
||||
static void test_WinGGetDIBPointer(void)
|
||||
{
|
||||
HDC dc;
|
||||
BITMAPINFO bmi;
|
||||
void *bits;
|
||||
HBITMAP bmp;
|
||||
void* dib;
|
||||
|
||||
dc = WinGCreateDC();
|
||||
ok(dc != NULL, "WinGCreateDC failed\n");
|
||||
|
||||
memset(&bmi, 0, sizeof(bmi));
|
||||
bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);
|
||||
bmi.bmiHeader.biWidth = 1;
|
||||
bmi.bmiHeader.biHeight = 1;
|
||||
bmi.bmiHeader.biPlanes = 1;
|
||||
bmi.bmiHeader.biBitCount= 24;
|
||||
bmi.bmiHeader.biCompression= BI_RGB;
|
||||
bmi.bmiHeader.biSizeImage = 0;
|
||||
bmp = WinGCreateBitmap(dc, &bmi, &bits);
|
||||
ok(bmp != NULL, "WinGCreateBitmap failed\n");
|
||||
|
||||
dib = WinGGetDIBPointer(NULL, NULL);
|
||||
ok(dib == NULL, "WinGGetDIBPointer returned unexpected value %p\n", dib);
|
||||
|
||||
dib = WinGGetDIBPointer(bmp, &bmi);
|
||||
ok(dib != NULL, "WinGGetDIBPointer failed\n");
|
||||
|
||||
DeleteObject(bmp);
|
||||
DeleteDC(dc);
|
||||
}
|
||||
|
||||
START_TEST(wing32)
|
||||
{
|
||||
test_WinGGetDIBPointer();
|
||||
}
|
Loading…
Add table
Reference in a new issue