2010-08-24 13:54:10 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS api tests
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* PURPOSE: Test for CreateBitmapIndirect
|
|
|
|
* PROGRAMMERS: Magnus Olsen
|
|
|
|
*/
|
2008-05-11 10:35:09 +00:00
|
|
|
|
2013-09-22 17:52:42 +00:00
|
|
|
#include <apitest.h>
|
|
|
|
|
2013-02-05 17:54:22 +00:00
|
|
|
#include <wingdi.h>
|
2008-05-11 10:35:09 +00:00
|
|
|
|
2010-08-24 13:54:10 +00:00
|
|
|
void Test_CreateBitmapIndirect()
|
2008-05-11 10:35:09 +00:00
|
|
|
{
|
|
|
|
HBITMAP win_hBmp;
|
|
|
|
BITMAP win_bitmap;
|
|
|
|
|
|
|
|
win_bitmap.bmBits = 0;
|
|
|
|
win_bitmap.bmBitsPixel = 1;
|
|
|
|
win_bitmap.bmHeight = 0;
|
|
|
|
win_bitmap.bmPlanes = 1;
|
|
|
|
win_bitmap.bmType = 1;
|
|
|
|
win_bitmap.bmWidth = 0;
|
|
|
|
win_bitmap.bmWidthBytes = 2;
|
|
|
|
win_hBmp = CreateBitmapIndirect(&win_bitmap);
|
2010-08-24 13:54:10 +00:00
|
|
|
ok(win_hBmp != 0, "CreateBitmapIndirect failed\n");
|
2008-05-11 10:35:09 +00:00
|
|
|
|
|
|
|
DeleteObject(win_hBmp);
|
|
|
|
|
|
|
|
RtlZeroMemory(&win_bitmap,sizeof(BITMAP));
|
|
|
|
win_bitmap.bmBits = 0;
|
|
|
|
win_bitmap.bmBitsPixel = 1;
|
|
|
|
win_bitmap.bmHeight = 0;
|
|
|
|
win_bitmap.bmPlanes = 1;
|
|
|
|
win_bitmap.bmType = 1;
|
|
|
|
win_bitmap.bmWidth = 0;
|
|
|
|
win_bitmap.bmWidthBytes = 1;
|
|
|
|
win_hBmp = CreateBitmapIndirect(&win_bitmap);
|
2010-08-24 13:54:10 +00:00
|
|
|
ok(win_hBmp == 0, "CreateBitmapIndirect succeeded\n");
|
2008-05-11 10:35:09 +00:00
|
|
|
|
|
|
|
RtlZeroMemory(&win_bitmap,sizeof(BITMAP));
|
|
|
|
win_bitmap.bmBits = 0;
|
|
|
|
win_bitmap.bmBitsPixel = 1;
|
|
|
|
win_bitmap.bmHeight = 0;
|
|
|
|
win_bitmap.bmPlanes = 1;
|
|
|
|
win_bitmap.bmType = 1;
|
|
|
|
win_bitmap.bmWidth = 0;
|
|
|
|
win_bitmap.bmWidthBytes = 3;
|
|
|
|
win_hBmp = CreateBitmapIndirect(&win_bitmap);
|
2010-08-24 13:54:10 +00:00
|
|
|
ok(win_hBmp == 0, "CreateBitmapIndirect succeeded\n");
|
2008-05-11 10:35:09 +00:00
|
|
|
|
|
|
|
RtlZeroMemory(&win_bitmap,sizeof(BITMAP));
|
|
|
|
win_bitmap.bmBits = 0;
|
|
|
|
win_bitmap.bmBitsPixel = 1;
|
|
|
|
win_bitmap.bmHeight = 0;
|
|
|
|
win_bitmap.bmPlanes = 1;
|
|
|
|
win_bitmap.bmType = 1;
|
|
|
|
win_bitmap.bmWidth = 0;
|
|
|
|
win_bitmap.bmWidthBytes = 4;
|
|
|
|
win_hBmp = CreateBitmapIndirect(&win_bitmap);
|
2010-08-24 13:54:10 +00:00
|
|
|
ok(win_hBmp != 0, "CreateBitmapIndirect failed\n");
|
2008-05-11 10:35:09 +00:00
|
|
|
|
2011-01-16 20:53:48 +00:00
|
|
|
RtlZeroMemory(&win_bitmap,sizeof(BITMAP));
|
|
|
|
win_bitmap.bmBits = 0;
|
|
|
|
win_bitmap.bmBitsPixel = 8;
|
|
|
|
win_bitmap.bmHeight = 0xF000;
|
|
|
|
win_bitmap.bmPlanes = 1;
|
|
|
|
win_bitmap.bmType = 1;
|
|
|
|
win_bitmap.bmWidth = 0x8000;
|
|
|
|
win_bitmap.bmWidthBytes = win_bitmap.bmWidth;
|
|
|
|
win_hBmp = CreateBitmapIndirect(&win_bitmap);
|
2012-05-05 12:21:56 +00:00
|
|
|
//ok(win_hBmp != 0, "CreateBitmapIndirect failed\n"); // fails on win 2003
|
2011-01-16 20:53:48 +00:00
|
|
|
|
2008-05-11 10:35:09 +00:00
|
|
|
DeleteObject(win_hBmp);
|
2010-08-24 13:54:10 +00:00
|
|
|
}
|
2008-05-11 10:35:09 +00:00
|
|
|
|
2010-08-24 13:54:10 +00:00
|
|
|
START_TEST(CreateBitmapIndirect)
|
|
|
|
{
|
|
|
|
Test_CreateBitmapIndirect();
|
2008-05-11 10:35:09 +00:00
|
|
|
}
|
2010-08-24 13:54:10 +00:00
|
|
|
|