You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by re...@apache.org on 2022/02/10 11:05:11 UTC

[uima-uimaj] branch bugfix/no-jira-fix-test created (now 24ea5fe)

This is an automated email from the ASF dual-hosted git repository.

rec pushed a change to branch bugfix/no-jira-fix-test
in repository https://gitbox.apache.org/repos/asf/uima-uimaj.git.


      at 24ea5fe  [NO JIRA] Remove an assert which could randomly fail depending on which numbers the RNG was interting into the RB tree and which was superseded by another assert anyway

This branch includes the following new commits:

     new 24ea5fe  [NO JIRA] Remove an assert which could randomly fail depending on which numbers the RNG was interting into the RB tree and which was superseded by another assert anyway

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[uima-uimaj] 01/01: [NO JIRA] Remove an assert which could randomly fail depending on which numbers the RNG was interting into the RB tree and which was superseded by another assert anyway

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rec pushed a commit to branch bugfix/no-jira-fix-test
in repository https://gitbox.apache.org/repos/asf/uima-uimaj.git

commit 24ea5fec41ec67d1aa7d0c7b407dc85647248696
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Thu Feb 10 12:05:07 2022 +0100

    [NO JIRA] Remove an assert which could randomly fail depending on which numbers the RNG was interting into the RB tree and which was superseded by another assert anyway
---
 .../apache/uima/internal/util/rb_trees/IntArrayRBTTest.java   | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/uimaj-core/src/test/java/org/apache/uima/internal/util/rb_trees/IntArrayRBTTest.java b/uimaj-core/src/test/java/org/apache/uima/internal/util/rb_trees/IntArrayRBTTest.java
index 87c4419..c191fea 100644
--- a/uimaj-core/src/test/java/org/apache/uima/internal/util/rb_trees/IntArrayRBTTest.java
+++ b/uimaj-core/src/test/java/org/apache/uima/internal/util/rb_trees/IntArrayRBTTest.java
@@ -19,6 +19,7 @@
 
 package org.apache.uima.internal.util.rb_trees;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -189,16 +190,17 @@ public class IntArrayRBTTest {
     for (int j = 0; j < 10; j++) {
 
       // insert values
-      int shadowSize = 0;
+      int expectedSize = 0;
       for (int i = 0; i < 1000; i++) {
         int k = rand.nextInt(1000);
         ks[i] = k;
         boolean wasInserted = ia.insertKeyShowNegative(k) >= 0;
         if (wasInserted) {
-          shadowSize++;
+          expectedSize++;
         }
       }
-      assertEquals(shadowSize, ia.size);
+
+      assertThat(ia.size).isEqualTo(expectedSize);
 
       // debug
       // int[] iv = new int[1000];
@@ -208,7 +210,6 @@ public class IntArrayRBTTest {
       // iv[iiv++] = it.next();
       // }
 
-      assertTrue(ia.size <= 1000 && ia.size > 600);
       // check all values are present
       // Set<Integer> presentValues = new HashSet<>();
       for (int i = 0; i < 1000; i++) {
@@ -248,7 +249,7 @@ public class IntArrayRBTTest {
       // iv[iiv++] = it.next();
       // }
 
-      assertEquals(0, ia.size);
+      assertThat(ia.size).isZero();
       System.gc();
       System.out.print(Runtime.getRuntime().freeMemory() + " ");