From ahughes@redhat.com Thu Jan 12 17:27:00 2012 From: ahughes@redhat.com (Dr Andrew John Hughes) Date: Thu, 12 Jan 2012 17:27:00 -0000 Subject: FYI: SanityCheck for DateFormatSymbols Message-ID: <20120112172700.GA6667@rivendell.middle-earth.co.uk> I've been looking into a number of issues with the DateFormatSymbols locale data; see https://bugzilla.redhat.com/show_bug.cgi?id=712013 As part of this, I'm adding a test to Mauve which checks each locale's symbols to make sure: 1. The array is the right size. 2. All elements are not null. 3. All elements are not empty, unless allowed (weekday[0] and month[12]). With gcj 4.6.2, we have 783 failures out of 29216 tests. With the patch I'm about to post to GNU Classpath applied, this reduces to 235 out of 30456 (the test increase is due to some arrays now being their correct larger size, such as de_AT mentioned in the bug). For reference, OpenJDK has 0 failures out of 14288 tests (they have much less locale data). I should be able to get our failure rate down further by fixing further bugs in the locale data. The generator is currently picking up the wrong incomplete set of month & week names for locales like be and cy. 2012-01-12 Andrew John Hughes * gnu/testlet/java/text/DateFormatSymbols/SanityCheck.java: Extend test to also check array content for null/empty values. (checkArray(TestHarness, Locale, String, String[], int)): Helper method for checking locale data. Runs harness checks to ensure the array is the right size and has all non-null non-empty values (except where empty values are allowed for weekday[0] and month[12]). -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 -------------- next part -------------- Index: gnu/testlet/java/text/DateFormatSymbols/SanityCheck.java =================================================================== RCS file: /cvs/mauve/mauve/gnu/testlet/java/text/DateFormatSymbols/SanityCheck.java,v retrieving revision 1.1 diff -u -u -r1.1 SanityCheck.java --- gnu/testlet/java/text/DateFormatSymbols/SanityCheck.java 5 Jan 2012 14:36:31 -0000 1.1 +++ gnu/testlet/java/text/DateFormatSymbols/SanityCheck.java 12 Jan 2012 17:15:28 -0000 @@ -25,6 +25,8 @@ import gnu.testlet.Testlet; import java.text.DateFormatSymbols; +import java.util.Arrays; +import java.util.Calendar; import java.util.Locale; /** @@ -46,12 +48,40 @@ for (int a = 0; a < locales.length; ++a) { DateFormatSymbols dfs = DateFormatSymbols.getInstance(locales[a]); - harness.check(dfs.getAmPmStrings().length == 2, "AM/PM check (" + locales[a] + ")"); - harness.check(dfs.getEras().length == 2, "Eras check (" + locales[a] + ")"); - harness.check(dfs.getMonths().length == 13, "Months check (" + locales[a] + ")"); - harness.check(dfs.getShortMonths().length == 13, "Short months check (" + locales[a] + ")"); - harness.check(dfs.getShortWeekdays().length == 8, "Short weekdays check (" + locales[a] + ")"); - harness.check(dfs.getWeekdays().length == 8, "Weekdays check (" + locales[a] + ")"); + checkArray(harness, locales[a], "AM/PM", dfs.getAmPmStrings(), 2); + checkArray(harness, locales[a], "Eras", dfs.getEras(), 2); + checkArray(harness, locales[a], "Months", dfs.getMonths(), 13); + checkArray(harness, locales[a], "Short months", dfs.getShortMonths(), 13); + checkArray(harness, locales[a], "Weekdays", dfs.getWeekdays(), 8); + checkArray(harness, locales[a], "Short weekdays", dfs.getShortWeekdays(), 8); + } + } + + /** + * Checks an array of locale data is of the correct size. + * + * @param harness the test harness. + * @param locale the locale being tested (for display purposes). + * @param type the type of data (for display purposes). + * @param array the array of strings. + * @param size the expected size of the array. + */ + private void checkArray(TestHarness harness, Locale locale, String type, + String[] array, int size) + { + harness.check(array.length == size, type + "check (" + locale + ")"); + harness.debug(locale + ": " + type + "=" + Arrays.toString(array)); + // Check entries are non-null and also non-empty (unless allowed). + for (int a = 0; a < array.length; ++a) + { + harness.check(array[a] != null, type + "[" + a + "] null check (" + + locale + ")"); + // Weekdays are indexed 1 to 7 not 0 to 6. The 13th month is not + // used by the Gregorian calendar. + if (!(type.contains("onths") && a == Calendar.UNDECIMBER) && + !(type.contains("days") && a == 0)) + harness.check(!array[a].isEmpty(), type + "[" + a + "] empty check (" + + locale + ")"); } } -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From ptisnovs@redhat.com Tue Jan 17 13:55:00 2012 From: ptisnovs@redhat.com (Pavel Tisnovsky) Date: Tue, 17 Jan 2012 13:55:00 -0000 Subject: FYI: Support for new tag were added to a Mauve harness tool Message-ID: <4F157E44.50709@redhat.com> I've added support for new tag to a Mauve harness tool. This new tag is named "CompileOptions:" and allows developers to specify various options which are passed to a compiled in case test is automatically compiled by the Harness itself. Any option could by used, for example "-target x.x -source x.x -bootclasspath foo" etc. Pavel 2012-01-17 Pavel Tisnovsky * Harness.java: Added support for the new tag with name "CompileOptions:" which allows authors of the tests to specify various options which are then passed to a compiler. From test@hayiyao.com Wed May 2 20:08:00 2012 From: test@hayiyao.com (=?gb2312?Q?=D6=B2=CE=EF=CE=B0=B8=E7?=) Date: Wed, 02 May 2012 20:08:00 -0000 Subject: =?gb2312?Q?=D6=B2=CE=EF=CE=B0=B8=E7=A3=BA2012=D7=EE=BA=C3=D7=B3=D1=F4=B2=FA=C6=B7=A3=AC=B3=B9=B5=D7=B8=E6=B1=F0=D1=F4=F0=F4=D4=E7=D0=B9=A1=A3?= Message-ID: ?????2012 ?????????,100%?????,?? ??????,??! ????: ??,??,??,??,??,???? ??20??????????????????????????? ?????,????????,????????100%! ???????,?????! ????.??100%? ????QQ:1716381632 ????QQ:1716381632 ??? http://zzt.so/qqmh ??? http://zzt.so/qqmh ??? http://zzt.so/qqmh ??? http://zzt.so/qqmh ??????????????? ????????? ????????? ???QQ: 1716381632 ???QQ: 1716381632 ???QQ: 1716381632 ???QQ: 1716381632