Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests failed #549

Open
MaJeg opened this issue May 3, 2019 · 1 comment
Open

Tests failed #549

MaJeg opened this issue May 3, 2019 · 1 comment

Comments

@MaJeg
Copy link

MaJeg commented May 3, 2019

I cloned the git repository with git clone https://github.com/numenta/htm.java.git
Then, when running gradle -Pskipbench check, I have two failed tests :

org.numenta.nupic.BitHistoryTest > testPFormatArray FAILED
    org.junit.ComparisonFailure at BitHistoryTest.java:22

org.numenta.nupic.monitor.mixin.MonitoredTemporalMemoryTest > test_mmPrettyPrintConnections FAILED
    java.lang.AssertionError at MonitoredTemporalMemoryTest.java:42
654 tests completed, 2 failed
:test FAILED 

I tested with java 8 and java 11 it didn't change anything, I have Ubuntu 18.04.

@msche
Copy link

msche commented May 11, 2019

I encountered a similar problem within this test and it seems to be caused by the locale settings. It expects that the decimal seperator is a . but for certain locales it is ,.

I quick fixed this locally by changing the test in BitHistory in

    @Test
    public void testPFormatArray() {
        BitHistory history = new BitHistory(null, 1, 1);
        Method m = null;
        try {
            m = BitHistory.class.getDeclaredMethod("pFormatArray", new Class[] {double[].class});
            m.setAccessible(true);
            double[] da = { 2.0, 4.0 };
            String output = (String)m.invoke(history, da);

            // Correct for locale
            DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance();
            char decimalSeparator = symbols.getDecimalSeparator();

            assertEquals("[ 2" +decimalSeparator + "00 4" + decimalSeparator + "00 ]", output);
        }catch(Exception e) {
            e.printStackTrace();
        }
    }

ps: saw just that there is already a pull request for fixing this issue: #536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants