681{
682 const struct {
684 } tests_einval[] = {
685 {"%C"},
686 {"%D"},
687 {"%e"},
688 {"%F"},
689 {"%h"},
690 {"%n"},
691 {"%R"},
692 {"%t"},
693 {"%T"},
694 {"%u"},
695 };
696
697 const struct {
703 {"e%#%e", "e%e", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
704 {"%c", "01/01/70 00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
705 {"%c", "02/30/70 00:00:00", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }},
706 {"%#c", "Thursday, January 01, 1970 00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
707 {"%#c", "Thursday, February 30, 1970 00:00:00", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }},
708 {"%x", "01/01/70", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
709 {"%x", "02/30/70", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }},
710 {"%#x", "Thursday, January 01, 1970", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
711 {"%#x", "Thursday, February 30, 1970", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }},
712 {"%X", "00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
713 {"%X", "14:00:00", { 0, 0, 14, 1, 0, 70, 4, 0, 0 }},
714 {"%a", "Thu", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
715 {"%A", "Thursday", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
716 {"%b", "Jan", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
717 {"%B", "January", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
718 {"%d", "01", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
719 {"%#d", "1", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
720 {"%H", "00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
721 {"%I", "12", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
722 {"%j", "001", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
723 {"%m", "01", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
724 {"%#M", "0", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
725 {"%p", "AM", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
726 {"%U", "00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
727 {"%W", "00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
728 {"%U", "01", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
729 {"%W", "00", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
730 {"%U", "53", { 0, 0, 0, 1, 0, 70, 0, 365, 0 }},
731 {"%W", "52", { 0, 0, 0, 1, 0, 70, 0, 365, 0 }},
732 };
733
734 const struct {
737 const char *short_date;
742 } tests_td[] = {
743 { "%c", "x z", "x", "y", "z", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
744 { "%#c", "y z", "x", "y", "z", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
745 { "%X", "m1", 0, 0, "MMM", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }},
746 { "%X", "1", 0, 0, "h", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }},
747 { "%X", "01", 0, 0, "hh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }},
748 { "%X", "h01", 0, 0, "hhh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }},
749 { "%X", "hh01", 0, 0, "hhhh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }},
750 { "%X", "1", 0, 0, "H", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }},
751 { "%X", "01", 0, 0, "HH", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }},
752 { "%X", "H13", 0, 0, "HHH", { 0, 0, 13, 1, 0, 70, 0, 0, 0 }},
753 { "%X", "0", 0, 0, "m", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
754 { "%X", "00", 0, 0, "mm", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
755 { "%X", "0", 0, 0, "s", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
756 { "%X", "00", 0, 0, "ss", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
757 { "%X", "s00", 0, 0, "sss", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
758 { "%X", "t", 0, 0, "t", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
759 { "%X", "tam", 0, 0, "tt", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
760 { "%X", "tam", 0, 0, "ttttttttt", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
761 { "%X", "tam", 0, 0, "a", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
762 { "%X", "tam", 0, 0, "aaaaa", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
763 { "%X", "tam", 0, 0, "A", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
764 { "%X", "tam", 0, 0, "AAAAA", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
765 { "%x", "1", "d", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
766 { "%x", "01", "dd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
767 { "%x", "d1", "ddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
768 { "%x", "day1", "dddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
769 { "%x", "dday1", "ddddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
770 { "%x", "1", "M", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
771 { "%x", "01", "MM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
772 { "%x", "m1", "MMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
773 { "%x", "mon1", "MMMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
774 { "%x", "Mmon1", "MMMMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
775 { "%x", "y", "y", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
776 { "%x", "70", "yy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
777 { "%x", "y70", "yyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
778 { "%x", "1970", "yyyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
779 { "%x", "y1970", "yyyyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
780 { "%x", "ggggggggggg", "ggggggggggg", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
781 { "%#x", "1", 0, "d", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
782 { "%#x", "01", 0, "dd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
783 { "%#x", "d1", 0, "ddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
784 { "%#x", "day1", 0, "dddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
785 { "%#x", "dday1", 0, "ddddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
786 { "%#x", "1", 0, "M", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
787 { "%#x", "01", 0, "MM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
788 { "%#x", "m1", 0, "MMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
789 { "%#x", "mon1", 0, "MMMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
790 { "%#x", "Mmon1", 0, "MMMMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
791 { "%#x", "y", 0, "y", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
792 { "%#x", "70", 0, "yy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
793 { "%#x", "y70", 0, "yyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
794 { "%#x", "1970", 0, "yyyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
795 { "%#x", "y1970", 0, "yyyyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }},
796 };
797
799 { "d1", "d2", "d3", "d4", "d5", "d6", "d7" },
800 { "day1", "day2", "day3", "day4", "day5", "day6", "day7" },
801 { "m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", "m10", "m11", "m12" },
802 { "mon1", "mon2", "mon3", "mon4", "mon5", "mon6", "mon7", "mon8", "mon9", "mon10", "mon11", "mon12" },
803 "tam", "tpm"
804 };
807 char buf[256], bufA[256];
809 long retA, retW;
811
812 if (!p_strftime || !p_wcsftime || !
p_gmtime)
813 {
814 win_skip(
"strftime, wcsftime or gmtime is not available\n");
815 return;
816 }
817
819
820 gmt = 0;
822 ok(gmt_tm !=
NULL,
"gmtime failed\n");
823
825 {
827 retA = p_strftime(bufA, 256, tests_einval[
i].
format, gmt_tm);
828 ok(retA == 0,
"%d) ret = %ld\n",
i, retA);
830 }
831
833 retA = p_strftime(
NULL, 0,
"copy", gmt_tm);
834 ok(retA == 0,
"expected 0, got %ld\n", retA);
836
837 retA = p_strftime(bufA, 256,
"copy",
NULL);
838 ok(retA == 4,
"expected 4, got %ld\n", retA);
839 ok(!
strcmp(bufA,
"copy"),
"got %s\n", bufA);
840
841 retA = p_strftime(bufA, 256, "copy it", gmt_tm);
842 ok(retA == 7,
"expected 7, got %ld\n", retA);
843 ok(!
strcmp(bufA,
"copy it"),
"got %s\n", bufA);
844
846 retA = p_strftime(bufA, 2, "copy", gmt_tm);
847 ok(retA == 0,
"expected 0, got %ld\n", retA);
850
852 retA = p_strftime(bufA, 256, "a%e", gmt_tm);
853 ok(retA==0 ||
broken(retA==1),
"expected 0, got %ld\n", retA);
856
857 if(0) {
859 retA = p_strftime(bufA, 256,
"%c",
NULL);
860 ok(retA == 0,
"expected 0, got %ld\n", retA);
861 ok(!
strcmp(bufA,
""),
"got %s\n", bufA);
863 }
864
866 {
872 }
873 }
874
875 retA = p_strftime(bufA, 256, "%c", gmt_tm);
876 retW = p_wcsftime(bufW, 256,
L"%c", gmt_tm);
877 ok(retW == 17,
"expected 17, got %ld\n", retW);
878 ok(retA == retW,
"expected %ld, got %ld\n", retA, retW);
883
885 win_skip(
"Japanese_Japan.932 locale not available\n");
886 return;
887 }
888
889
890 retA = p_strftime(bufA, 256, "\x82%c", gmt_tm);
891 ok(retA == 3,
"expected 3, got %ld\n", retA);
892 ok(!
strcmp(bufA,
"\x82%c"),
"got %s\n", bufA);
893
895 if(!p__Strftime) {
896 win_skip(
"_Strftime is not available\n");
897 return;
898 }
899
900
903 {
905 time_data.
date = tests_td[
i].date;
906 time_data.
time = tests_td[
i].time;
907 retA = p__Strftime(
buf,
sizeof(
buf), tests_td[
i].
format, &tests_td[
i].
tm, &time_data);
910 ok(!
strcmp(
buf, tests_td[
i].
ret),
"%d) buf = \"%s\", expected \"%s\"\n",
912 }
913 }
914}
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static struct test_info tests[]