From: Jeff Smith Subject: Re: [RFC PATCH 1/9] ntdll/tests: Add tests for iswctype. Message-Id: Date: Thu, 9 Jan 2020 10:36:37 -0600 In-Reply-To: <13f30b0a-3cf4-980e-afef-b7beaa3c0f01@codeweavers.com> References: <20200109065349.2549777-1-whydoubt@gmail.com> <13f30b0a-3cf4-980e-afef-b7beaa3c0f01@codeweavers.com> On Thu, Jan 9, 2020 at 8:56 AM Jacek Caban wrote: > > Hi Jeff, > > On 09.01.2020 07:53, Jeff Smith wrote: > > @@ -1501,6 +1515,63 @@ static void test_sscanf(void) > > ok(d == 0.0, "d = %lf\n", f); > > } > > > > +static void test_iswctype(void) > > +{ > > + unsigned int c, i; > > + unsigned short types = 0; > > + unsigned short base_wctype[65536]; > > + static const struct > > + { > > + unsigned int c; > > + unsigned int wctype; > > + } > > + iswctype_tests[] = > > + { > > + { '\t', C1_CNTRL | C1_SPACE | C1_BLANK }, > > + { 0xa0, C1_SPACE | C1_BLANK }, > > + { 0x85, C1_CNTRL }, > > + { 0xad, C1_PUNCT }, > > + { 0xaa, C1_PUNCT }, > > + { 0xb5, C1_PUNCT }, > > + { 0xba, C1_PUNCT }, > > + { 0xb2, C1_PUNCT | C1_DIGIT }, > > + { 0xb3, C1_PUNCT | C1_DIGIT }, > > + { 0xb9, C1_PUNCT | C1_DIGIT }, > > + }; > > + > > + for (c = 0; c <= 0xff; c++) > > + { > > + base_wctype[c] = p_iswctype(c, 0xffff); > > + types |= base_wctype[c]; > > + } > > + todo_wine ok(types == 0x1ff, "Unexpected wctype bits present\n"); Hi Jacek, > How about copying NTDLL_wctype to tests so that you can test exact > return values for 0..255 ranges? You wouldn't need base_wctype array. > You could just iterate all values and compare iswctype result to the > value from wctype array. Also, it would be nice to test return values of > isw* functions for those characters. I like that idea for checking the whole table. Adding the isw tests shouldn't be too hard to do as well. Thanks, Jeff