~ubuntu-branches/ubuntu/precise/wine1.3/precise

« back to all changes in this revision

Viewing changes to dlls/user32/tests/cursoricon.c

  • Committer: Package Import Robot
  • Author(s): Scott Ritchie
  • Date: 2012-01-17 09:00:34 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120117090034-eyhpp02jawlvrrkc
Tags: 1.3.37-0ubuntu1
* New upstream release
  - Many changes
* Convert to 3.0 source format
* debian/control:
  - Remove pre-multiarch amd64 build depends
  - Remove quilt build depends
  - Recommend proper gecko versions
* debian/rules:
  - Remove manual dh_quilt patch and unpatch
  - No need to uuencode/uudecode anymore with new source format

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21
21
 */
22
22
 
23
 
#include <assert.h>
24
23
#include <stdlib.h>
25
24
#include <stdarg.h>
26
25
#include <stdio.h>
697
696
    ok(error == 0xdeadbeef, "Last error: 0x%08x\n", error);
698
697
}
699
698
 
700
 
static void test_icon_info_dbg(HICON hIcon, UINT exp_cx, UINT exp_cy, UINT exp_bpp, int line)
 
699
static void test_icon_info_dbg(HICON hIcon, UINT exp_cx, UINT exp_cy, UINT exp_mask_cy, UINT exp_bpp, int line)
701
700
{
702
701
    ICONINFO info;
703
702
    DWORD ret;
737
736
 
738
737
        ok_(__FILE__, line)(bmMask.bmBitsPixel == 1, "bmMask.bmBitsPixel = %d\n", bmMask.bmBitsPixel);
739
738
        ok_(__FILE__, line)(bmMask.bmWidth == exp_cx, "bmMask.bmWidth = %d\n", bmMask.bmWidth);
740
 
        ok_(__FILE__, line)(bmMask.bmHeight == exp_cy, "bmMask.bmHeight = %d\n", bmMask.bmHeight);
 
739
        ok_(__FILE__, line)(bmMask.bmHeight == exp_mask_cy, "bmMask.bmHeight = %d\n", bmMask.bmHeight);
741
740
    }
742
741
    else
743
742
    {
744
743
        ok_(__FILE__, line)(bmMask.bmBitsPixel == 1, "bmMask.bmBitsPixel = %d\n", bmMask.bmBitsPixel);
745
744
        ok_(__FILE__, line)(bmMask.bmWidth == exp_cx, "bmMask.bmWidth = %d\n", bmMask.bmWidth);
746
 
        ok_(__FILE__, line)(bmMask.bmHeight == exp_cy * 2, "bmMask.bmHeight = %d\n", bmMask.bmHeight);
 
745
        ok_(__FILE__, line)(bmMask.bmHeight == exp_mask_cy, "bmMask.bmHeight = %d\n", bmMask.bmHeight);
747
746
    }
748
747
    if (pGetIconInfoExA)
749
748
    {
778
777
    }
779
778
}
780
779
 
781
 
#define test_icon_info(a,b,c,d) test_icon_info_dbg((a),(b),(c),(d),__LINE__)
 
780
#define test_icon_info(a,b,c,d,e) test_icon_info_dbg((a),(b),(c),(d),(e),__LINE__)
782
781
 
783
782
static void test_CreateIcon(void)
784
783
{
790
789
    HDC hdc;
791
790
    void *bits;
792
791
    UINT display_bpp;
 
792
    int i;
793
793
 
794
794
    hdc = GetDC(0);
795
795
    display_bpp = GetDeviceCaps(hdc, BITSPIXEL);
801
801
 
802
802
    hIcon = CreateIcon(0, 16, 16, 1, 1, bmp_bits, bmp_bits);
803
803
    ok(hIcon != 0, "CreateIcon failed\n");
804
 
    test_icon_info(hIcon, 16, 16, 1);
 
804
    test_icon_info(hIcon, 16, 16, 32, 1);
805
805
    DestroyIcon(hIcon);
806
806
 
807
807
    hIcon = CreateIcon(0, 16, 16, 1, display_bpp, bmp_bits, bmp_bits);
808
808
    ok(hIcon != 0, "CreateIcon failed\n");
809
 
    test_icon_info(hIcon, 16, 16, display_bpp);
 
809
    test_icon_info(hIcon, 16, 16, 16, display_bpp);
810
810
    DestroyIcon(hIcon);
811
811
 
812
812
    hbmMask = CreateBitmap(16, 16, 1, 1, bmp_bits);
841
841
    info.hbmColor = hbmColor;
842
842
    hIcon = CreateIconIndirect(&info);
843
843
    ok(hIcon != 0, "CreateIconIndirect failed\n");
844
 
    test_icon_info(hIcon, 16, 16, display_bpp);
 
844
    test_icon_info(hIcon, 16, 16, 16, display_bpp);
845
845
    DestroyIcon(hIcon);
846
846
 
847
847
    DeleteObject(hbmMask);
858
858
    SetLastError(0xdeadbeaf);
859
859
    hIcon = CreateIconIndirect(&info);
860
860
    ok(hIcon != 0, "CreateIconIndirect failed\n");
861
 
    test_icon_info(hIcon, 16, 16, 1);
 
861
    test_icon_info(hIcon, 16, 16, 32, 1);
862
862
    DestroyIcon(hIcon);
863
 
 
864
863
    DeleteObject(hbmMask);
865
 
    DeleteObject(hbmColor);
 
864
 
 
865
    for (i = 0; i <= 4; i++)
 
866
    {
 
867
        hbmMask = CreateBitmap(1, i, 1, 1, bmp_bits);
 
868
        ok(hbmMask != 0, "CreateBitmap failed\n");
 
869
 
 
870
        info.fIcon = TRUE;
 
871
        info.xHotspot = 0;
 
872
        info.yHotspot = 0;
 
873
        info.hbmMask = hbmMask;
 
874
        info.hbmColor = 0;
 
875
        SetLastError(0xdeadbeaf);
 
876
        hIcon = CreateIconIndirect(&info);
 
877
        ok(hIcon != 0, "CreateIconIndirect failed\n");
 
878
        test_icon_info(hIcon, 1, i / 2, max(i,1), 1);
 
879
        DestroyIcon(hIcon);
 
880
        DeleteObject(hbmMask);
 
881
    }
866
882
 
867
883
    /* test creating an icon from a DIB section */
868
884
 
891
907
    SetLastError(0xdeadbeaf);
892
908
    hIcon = CreateIconIndirect(&info);
893
909
    ok(hIcon != 0, "CreateIconIndirect failed\n");
894
 
    test_icon_info(hIcon, 32, 32, 8);
 
910
    test_icon_info(hIcon, 32, 32, 32, 8);
895
911
    DestroyIcon(hIcon);
896
912
    DeleteObject(hbmColor);
897
913
 
909
925
    SetLastError(0xdeadbeaf);
910
926
    hIcon = CreateIconIndirect(&info);
911
927
    ok(hIcon != 0, "CreateIconIndirect failed\n");
912
 
    test_icon_info(hIcon, 32, 32, 8);
 
928
    test_icon_info(hIcon, 32, 32, 32, 8);
913
929
    DestroyIcon(hIcon);
914
930
    DeleteObject(hbmColor);
915
931
 
927
943
    SetLastError(0xdeadbeaf);
928
944
    hIcon = CreateIconIndirect(&info);
929
945
    ok(hIcon != 0, "CreateIconIndirect failed\n");
930
 
    test_icon_info(hIcon, 32, 32, 8);
 
946
    test_icon_info(hIcon, 32, 32, 32, 8);
931
947
    DestroyIcon(hIcon);
932
948
 
933
949
    DeleteObject(hbmMask);