Le 14/08/2012 21:09, Thomas Neidhart a écrit : > On 08/14/2012 05:25 PM, luc wrote: >> Hi, >> >> Since a few weeks, I have lots of tests failures due to matrix formats. >> >> I'm not sure exactly when this started, but I think this may be related >> to MATH-831 and the fix introduced as of r1364775 in late July. This >> changed the behaviour of toString in AbstractRealMatrix. The difference >> is that despite the default number of digits is set to one, matrix >> entries that happen to be integer are displayed as "1" or "0" and not as >> "1.0" or "0.0" as expected by the Junit tests. >> >> The tests that fail for me are: >> >> MultivariateSummaryStatisticsTest: testToString, >> SparseRealMatrixTest: testToString >> SynchronizedMultivariateSummaryStatisticsTest: testToString >> Array2DRowRealMatrixTest: testToString >> BlockRealMatrixTest: testToString >> >> They fail both when I use eclipse and when I use maven from the command >> line. Eclipse is configured to use Sun Java 1.5.0_22 JVM. Maven is >> configured with OpenJDK 1.6.0_24. I use a Linux computer running Debian, >> configured with the French locale (but the tests do reset the locale >> themselves). >> >> Here is the output from Maven: >> >> Results : >> >> Failed tests: >> testForgottenSeparator(org.apache.commons.math3.linear.RealMatrixFormatTest): >> expected:<7> but was:<5> >> >> testForgottenSuffix(org.apache.commons.math3.linear.RealMatrixFormatTest): >> expected:<9> but was:<5> >> testToString(org.apache.commons.math3.linear.BlockRealMatrixTest): >> expected:<BlockRealMatrix{{1[.0,2.0,3.0},{2.0,5.0,3.0},{1.0,0.0,8.]0}}> >> but was:<BlockRealMatrix{{1[,0,2,0,3,0},{2,0,5,0,3,0},{1,0,0,0,8,]0}}> >> >> testToString(org.apache.commons.math3.linear.Array2DRowRealMatrixTest): >> expected:<...ay2DRowRealMatrix{{1[.0,2.0,3.0},{2.0,5.0,3.0},{1.0,0.0,8.]0}}> >> but was:<...ay2DRowRealMatrix{{1[,0,2,0,3,0},{2,0,5,0,3,0},{1,0,0,0,8,]0}}> >> testToString(org.apache.commons.math3.linear.SparseRealMatrixTest): >> expected:<OpenMapRealMatrix{{1[.0,2.0,3.0},{2.0,5.0,3.0},{1.0,0.0,8.]0}}> but >> was:<OpenMapRealMatrix{{1[,0,2,0,3,0},{2,0,5,0,3,0},{1,0,0,0,8,]0}}> >> >> testToString(org.apache.commons.math3.stat.descriptive.MultivariateSummaryStatisticsTest): >> expected:<...ay2DRowRealMatrix{{1[.0,-1.0},{-1.0,1.]0}}(..) >> >> testToString(org.apache.commons.math3.stat.descriptive.SynchronizedMultivariateSummaryStatisticsTest): >> expected:<...ay2DRowRealMatrix{{1[.0,-1.0},{-1.0,1.]0}}(..) >> >> Tests run: 4067, Failures: 7, Errors: 0, Skipped: 40 >> >> [INFO] >> ------------------------------------------------------------------------ >> [ERROR] BUILD FAILURE >> [INFO] >> ------------------------------------------------------------------------ >> [INFO] There are test failures. >> >> >> Do someone else experience the same problems? > > Hi Luc,
Hi Thomas, > > the problem is that > > * not all tests override the locale with US > * in some locales (like yours) the decimal point is a ',' instead of a > '.' > > The RealMatrixFormat tests have to be improved to include always the > currently configured decimal separator for the expected result (as in > the RealVectorFormatTest class). > > For the RealMatrix.toString, I kept the ',' as element separator for > backwards compatibility, but this will fail for certain locales, so I > guess it would be better to also set the used locale to US instead of > the local configured one to prevent such situations. Yes, your are right. > > The same may also happen if some tests depend on the output of > RealVectorFormat (e.g. in ArrayRealVector), so maybe we should do the > same there? For now, these are the only tests that fail for me. So we can simply wait until it becomes really necessary to get a look at this. This is a minor problem and fairly easy to reproduce (just launch the test with a French locale). thanks for your analysis, Luc > > Thomas > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org