Uploaded image for project: 'Terrier Core'
  1. Terrier Core
  2. TR-132

Some BitIn implementations dont pass unit tests

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5
    • Component/s: .compression
    • Labels:
      None

      Description


      uk.ac.gla.terrier.compression.TestCompressedBitFiles
      uk.ac.gla.terrier.compression.TestCompressedBitFiles$TestCompressedBitFiles_BitFile
      testBit(uk.ac.gla.terrier.compression.TestCompressedBitFiles$TestCompressedBitFiles_BitFile)
      java.lang.ArrayIndexOutOfBoundsException: 1
      at uk.ac.gla.terrier.compression.BitFile.readUnary(BitFile.java:339)
      at uk.ac.gla.terrier.compression.BitFile.readGamma(BitFile.java:323)
      at uk.ac.gla.terrier.compression.TestCompressedBitFiles$TestCompressedBitFiles_Basic.testBit(TestCompressedBitFiles.java:48)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at junit.framework.TestCase.runTest(TestCase.java:168)
      at junit.framework.TestCase.runBare(TestCase.java:134)
      at junit.framework.TestResult$1.protect(TestResult.java:110)
      at junit.framework.TestResult.runProtected(TestResult.java:128)
      at junit.framework.TestResult.run(TestResult.java:113)
      at junit.framework.TestCase.run(TestCase.java:124)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

      uk.ac.gla.terrier.compression.TestCompressedBitFiles$TestCompressedBitFiles_BitFileBuffered
      testBit(uk.ac.gla.terrier.compression.TestCompressedBitFiles$TestCompressedBitFiles_BitFileBuffered)
      junit.framework.AssertionFailedError: expected:<2> but was:<0>
      at junit.framework.Assert.fail(Assert.java:47)
      at junit.framework.Assert.failNotEquals(Assert.java:277)
      at junit.framework.Assert.assertEquals(Assert.java:64)
      at junit.framework.Assert.assertEquals(Assert.java:130)
      at junit.framework.Assert.assertEquals(Assert.java:136)
      at uk.ac.gla.terrier.compression.TestCompressedBitFiles$TestCompressedBitFiles_Basic.testBit(TestCompressedBitFiles.java:58)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at junit.framework.TestCase.runTest(TestCase.java:168)
      at junit.framework.TestCase.runBare(TestCase.java:134)
      at junit.framework.TestResult$1.protect(TestResult.java:110)
      at junit.framework.TestResult.runProtected(TestResult.java:128)
      at junit.framework.TestResult.run(TestResult.java:113)
      at junit.framework.TestCase.run(TestCase.java:124)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

      uk.ac.gla.terrier.compression.TestCompressedBitFiles$TestCompressedBitFiles_BitFile_RandomDataInputMemory
      testBit(uk.ac.gla.terrier.compression.TestCompressedBitFiles$TestCompressedBitFiles_BitFile_RandomDataInputMemory)
      junit.framework.AssertionFailedError: expected:<0> but was:<32>
      at junit.framework.Assert.fail(Assert.java:47)
      at junit.framework.Assert.failNotEquals(Assert.java:277)
      at junit.framework.Assert.assertEquals(Assert.java:64)
      at junit.framework.Assert.assertEquals(Assert.java:156)
      at junit.framework.Assert.assertEquals(Assert.java:162)
      at uk.ac.gla.terrier.compression.TestCompressedBitFiles$TestCompressedBitFiles_Basic.testBit(TestCompressedBitFiles.java:47)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at junit.framework.TestCase.runTest(TestCase.java:168)
      at junit.framework.TestCase.runBare(TestCase.java:134)
      at junit.framework.TestResult$1.protect(TestResult.java:110)
      at junit.framework.TestResult.runProtected(TestResult.java:128)
      at junit.framework.TestResult.run(TestResult.java:113)
      at junit.framework.TestCase.run(TestCase.java:124)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

        Attachments

          Activity

          Hide
          craigm Craig Macdonald added a comment -

          I resolved the issue in BitFileBuffered, so now only BitFile is remaining. Given that BitFile isnt used by the core anywhere, I decided to deprecate BitFile in favour of BitOutputStream and BitFileBuffered.

          Show
          craigm Craig Macdonald added a comment - I resolved the issue in BitFileBuffered, so now only BitFile is remaining. Given that BitFile isnt used by the core anywhere, I decided to deprecate BitFile in favour of BitOutputStream and BitFileBuffered.
          Hide
          craigm Craig Macdonald added a comment -

          Moving this to 3.1. No other tests seems to be affected.

          Show
          craigm Craig Macdonald added a comment - Moving this to 3.1. No other tests seems to be affected.

            People

            • Assignee:
              craigm Craig Macdonald
              Reporter:
              craigm Craig Macdonald
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: