~ubuntu-branches/ubuntu/saucy/wine1.4/saucy-proposed

« back to all changes in this revision

Viewing changes to dlls/imm32/tests/imm32.c

  • Committer: Package Import Robot
  • Author(s): Scott Ritchie
  • Date: 2012-03-04 19:51:50 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120304195150-2lmdcr1d09y4xnqf
Tags: 1.4~rc6-0ubuntu1
* New upstream release
  - Bug fixes only, we are in code freeze.
* debian/control: 
  - explicitly depend on libncurses5 (LP: #938310)
  - bump breaks/replaces to packages before rc6

Show diffs side-by-side

added added

removed removed

Lines of Context:
573
573
    ok(ImmReleaseContext(hwnd, himc), "ImmReleaseContext failed\n");
574
574
}
575
575
 
 
576
static void test_ImmGetDescription(void)
 
577
{
 
578
    HKL hkl;
 
579
    WCHAR japime[] = { 'E', '0', '0', '1', '0', '4', '1', '1', 0 };
 
580
    WCHAR descW[100];
 
581
    CHAR descA[100];
 
582
    UINT ret, lret;
 
583
 
 
584
    /* FIXME: invalid keyboard layouts should not pass */
 
585
    ret = ImmGetDescriptionW(NULL, NULL, 0);
 
586
    todo_wine ok(!ret, "ImmGetDescriptionW failed, expected 0 received %d.\n", ret);
 
587
 
 
588
    /* load a language with valid IMM descriptions */
 
589
    hkl = LoadKeyboardLayoutW(japime, KLF_ACTIVATE);
 
590
    todo_wine ok(hkl != 0, "LoadKeyboardLayoutW failed, expected != 0.\n");
 
591
 
 
592
    ret = ImmGetDescriptionW(hkl, NULL, 0);
 
593
    if(!ret)
 
594
    {
 
595
        win_skip("ImmGetDescriptionW is not working for current loaded keyboard.\n");
 
596
        return;
 
597
    }
 
598
 
 
599
    ret = ImmGetDescriptionW(hkl, descW, 0);
 
600
    ok(ret, "ImmGetDescriptionW failed, expected != 0 received 0.\n");
 
601
 
 
602
    lret = ImmGetDescriptionW(hkl, descW, ret + 1);
 
603
    ok(lret, "ImmGetDescriptionW failed, expected != 0 received 0.\n");
 
604
    ok(lret == ret, "ImmGetDescriptionW failed to return the correct amount of data. Expected %d, got %d.\n", ret, lret);
 
605
 
 
606
    lret = ImmGetDescriptionA(hkl, descA, ret + 1);
 
607
    ok(lret, "ImmGetDescriptionA failed, expected != 0 received 0.\n");
 
608
    todo_wine ok(lret == ret, "ImmGetDescriptionA failed to return the correct amount of data. Expected %d, got %d.\n", ret, lret);
 
609
 
 
610
    ret /= 2; /* try to copy partially */
 
611
    lret = ImmGetDescriptionW(hkl, descW, ret + 1);
 
612
    ok(lret, "ImmGetDescriptionW failed, expected != 0 received 0.\n");
 
613
    ok(lret == ret, "ImmGetDescriptionW failed to return the correct amount of data. Expected %d, got %d.\n", ret, lret);
 
614
 
 
615
    ret = ImmGetDescriptionW(hkl, descW, 1);
 
616
    ok(!ret, "ImmGetDescriptionW failed, expected 0 received %d.\n", ret);
 
617
 
 
618
    UnloadKeyboardLayout(hkl);
 
619
}
 
620
 
576
621
START_TEST(imm32) {
577
622
    if (init())
578
623
    {
584
629
        test_ImmThreads();
585
630
        test_ImmIsUIMessage();
586
631
        test_ImmGetContext();
 
632
        test_ImmGetDescription();
587
633
    }
588
634
    cleanup();
589
635
}