590{
591 static const wchar_t cW[] = { '%','c',0 };
592 static const char expected[] =
"01/01/70 00:00:00";
595 char buf[256], bufA[256];
597 long retA, retW;
598
599 if (!p_strftime || !p_wcsftime || !
p_gmtime)
600 {
601 win_skip(
"strftime, wcsftime or gmtime is not available\n");
602 return;
603 }
604
606
607 gmt = 0;
609 ok(gmt_tm !=
NULL,
"gmtime failed\n");
610
612 retA = p_strftime(bufA, 256, "%C", gmt_tm);
613 ok(retA == 0,
"expected 0, got %ld\n", retA);
615
617 retA = p_strftime(bufA, 256, "%D", gmt_tm);
618 ok(retA == 0,
"expected 0, got %ld\n", retA);
620
622 retA = p_strftime(bufA, 256, "%e", gmt_tm);
623 ok(retA == 0,
"expected 0, got %ld\n", retA);
625
627 retA = p_strftime(bufA, 256, "%F", gmt_tm);
628 ok(retA == 0,
"expected 0, got %ld\n", retA);
630
632 retA = p_strftime(bufA, 256, "%h", gmt_tm);
633 ok(retA == 0,
"expected 0, got %ld\n", retA);
635
637 retA = p_strftime(bufA, 256, "%n", gmt_tm);
638 ok(retA == 0,
"expected 0, got %ld\n", retA);
640
642 retA = p_strftime(bufA, 256, "%R", gmt_tm);
643 ok(retA == 0,
"expected 0, got %ld\n", retA);
645
647 retA = p_strftime(bufA, 256, "%t", gmt_tm);
648 ok(retA == 0,
"expected 0, got %ld\n", retA);
650
652 retA = p_strftime(bufA, 256, "%T", gmt_tm);
653 ok(retA == 0,
"expected 0, got %ld\n", retA);
655
657 retA = p_strftime(bufA, 256, "%u", gmt_tm);
658 ok(retA == 0,
"expected 0, got %ld\n", retA);
660
662 retA = p_strftime(
NULL, 0,
"copy", gmt_tm);
663 ok(retA == 0,
"expected 0, got %ld\n", retA);
665
666 retA = p_strftime(bufA, 256,
"copy",
NULL);
667 ok(retA == 4,
"expected 4, got %ld\n", retA);
668 ok(!
strcmp(bufA,
"copy"),
"got %s\n", bufA);
669
670 retA = p_strftime(bufA, 256, "copy it", gmt_tm);
671 ok(retA == 7,
"expected 7, got %ld\n", retA);
672 ok(!
strcmp(bufA,
"copy it"),
"got %s\n", bufA);
673
675 retA = p_strftime(bufA, 2, "copy", gmt_tm);
676 ok(retA == 0,
"expected 0, got %ld\n", retA);
679
681 retA = p_strftime(bufA, 256, "a%e", gmt_tm);
682 ok(retA==0 ||
broken(retA==1),
"expected 0, got %ld\n", retA);
685
686 if(0) {
688 retA = p_strftime(bufA, 256,
"%c",
NULL);
689 ok(retA == 0,
"expected 0, got %ld\n", retA);
690 ok(!
strcmp(bufA,
""),
"got %s\n", bufA);
692 }
693
694 retA = p_strftime(bufA, 256, "e%#%e", gmt_tm);
695 ok(retA == 3,
"expected 3, got %ld\n", retA);
696 ok(!
strcmp(bufA,
"e%e"),
"got %s\n", bufA);
697
698 retA = p_strftime(bufA, 256, "%c", gmt_tm);
699 ok(retA == 17,
"expected 17, got %ld\n", retA);
701
702 retW = p_wcsftime(bufW, 256, cW, gmt_tm);
703 ok(retW == 17,
"expected 17, got %ld\n", retW);
704 ok(retA == retW,
"expected %ld, got %ld\n", retA, retW);
709
710 retA = p_strftime(bufA, 256, "%x", gmt_tm);
711 ok(retA == 8,
"expected 8, got %ld\n", retA);
712 ok(!
strcmp(bufA,
"01/01/70"),
"got %s\n", bufA);
713
714 retA = p_strftime(bufA, 256, "%X", gmt_tm);
715 ok(retA == 8,
"expected 8, got %ld\n", retA);
716 ok(!
strcmp(bufA,
"00:00:00"),
"got %s\n", bufA);
717
718 retA = p_strftime(bufA, 256, "%a", gmt_tm);
719 ok(retA == 3,
"expected 3, got %ld\n", retA);
720 ok(!
strcmp(bufA,
"Thu"),
"got %s\n", bufA);
721
722 retA = p_strftime(bufA, 256, "%A", gmt_tm);
723 ok(retA == 8,
"expected 8, got %ld\n", retA);
724 ok(!
strcmp(bufA,
"Thursday"),
"got %s\n", bufA);
725
726 retA = p_strftime(bufA, 256, "%b", gmt_tm);
727 ok(retA == 3,
"expected 3, got %ld\n", retA);
728 ok(!
strcmp(bufA,
"Jan"),
"got %s\n", bufA);
729
730 retA = p_strftime(bufA, 256, "%B", gmt_tm);
731 ok(retA == 7,
"expected 7, got %ld\n", retA);
732 ok(!
strcmp(bufA,
"January"),
"got %s\n", bufA);
733
734 retA = p_strftime(bufA, 256, "%d", gmt_tm);
735 ok(retA == 2,
"expected 2, got %ld\n", retA);
736 ok(!
strcmp(bufA,
"01"),
"got %s\n", bufA);
737
738 retA = p_strftime(bufA, 256, "%#d", gmt_tm);
739 ok(retA == 1,
"expected 1, got %ld\n", retA);
740 ok(!
strcmp(bufA,
"1"),
"got %s\n", bufA);
741
742 retA = p_strftime(bufA, 256, "%H", gmt_tm);
743 ok(retA == 2,
"expected 2, got %ld\n", retA);
744 ok(!
strcmp(bufA,
"00"),
"got %s\n", bufA);
745
746 retA = p_strftime(bufA, 256, "%I", gmt_tm);
747 ok(retA == 2,
"expected 2, got %ld\n", retA);
748 ok(!
strcmp(bufA,
"12"),
"got %s\n", bufA);
749
750 retA = p_strftime(bufA, 256, "%j", gmt_tm);
751 ok(retA == 3,
"expected 3, got %ld\n", retA);
752 ok(!
strcmp(bufA,
"001"),
"got %s\n", bufA);
753
754 retA = p_strftime(bufA, 256, "%m", gmt_tm);
755 ok(retA == 2,
"expected 2, got %ld\n", retA);
756 ok(!
strcmp(bufA,
"01"),
"got %s\n", bufA);
757
758 retA = p_strftime(bufA, 256, "%#M", gmt_tm);
759 ok(retA == 1,
"expected 1, got %ld\n", retA);
760 ok(!
strcmp(bufA,
"0"),
"got %s\n", bufA);
761
762 retA = p_strftime(bufA, 256, "%p", gmt_tm);
763 ok(retA == 2,
"expected 2, got %ld\n", retA);
764 ok(!
strcmp(bufA,
"AM"),
"got %s\n", bufA);
765
766 retA = p_strftime(bufA, 256, "%U", gmt_tm);
767 ok(retA == 2,
"expected 2, got %ld\n", retA);
768 ok(!
strcmp(bufA,
"00"),
"got %s\n", bufA);
769
770 retA = p_strftime(bufA, 256, "%W", gmt_tm);
771 ok(retA == 2,
"expected 2, got %ld\n", retA);
772 ok(!
strcmp(bufA,
"00"),
"got %s\n", bufA);
773
775 retA = p_strftime(bufA, 256, "%U", gmt_tm);
776 ok(retA == 2,
"expected 2, got %ld\n", retA);
777 ok(!
strcmp(bufA,
"01"),
"got %s\n", bufA);
778
779 retA = p_strftime(bufA, 256, "%W", gmt_tm);
780 ok(retA == 2,
"expected 2, got %ld\n", retA);
781 ok(!
strcmp(bufA,
"00"),
"got %s\n", bufA);
782
784 retA = p_strftime(bufA, 256, "%U", gmt_tm);
785 ok(retA == 2,
"expected 2, got %ld\n", retA);
786 ok(!
strcmp(bufA,
"53"),
"got %s\n", bufA);
787
788 retA = p_strftime(bufA, 256, "%W", gmt_tm);
789 ok(retA == 2,
"expected 2, got %ld\n", retA);
790 ok(!
strcmp(bufA,
"52"),
"got %s\n", bufA);
791
794 retA = p_strftime(bufA, 256, "%c", gmt_tm);
796 ok(retA == 17,
"expected 17, got %ld\n", retA);
797 ok(!
strcmp(bufA,
"02/30/70 00:00:00"),
"got %s\n", bufA);
798 }
799
801 win_skip(
"Japanese_Japan.932 locale not available\n");
802 return;
803 }
804
805
806 retA = p_strftime(bufA, 256, "\x82%c", gmt_tm);
807 ok(retA == 3,
"expected 3, got %ld\n", retA);
808 ok(!
strcmp(bufA,
"\x82%c"),
"got %s\n", bufA);
809}
GLenum GLuint GLenum GLsizei const GLchar * buf