dcapwell commented on code in PR #264:
URL: https://github.com/apache/cassandra-accord/pull/264#discussion_r2620253614


##########
accord-core/src/test/java/accord/utils/SimpleBitSetTest.java:
##########
@@ -167,9 +234,27 @@ public int nextSetBit(int fromIndex)
         @Override
         public int getSetBitCount()
         {
+            Assertions.assertThat(sut.getSetBitCount())
+                      .describedAs(toBinaryString())
+                      .isEqualTo(model.cardinality());
             return sut.getSetBitCount();
         }
 
+        public String toBinaryString()
+        {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0; i < size; i++)
+            {
+                boolean m = model.get(i);
+                boolean s = sut.get(i);
+                if (m == s)
+                    sb.append(m ? 1 : 0);
+                else
+                    sb.append("(expected=").append(m ? 1 : 0).append(", 
actual=").append(s ? 1 : 0).append(')');

Review Comment:
   this format was hacked together to aid in debugging `setRange` issue.  Was 
simple and showed exactly what was needed, but open to other formats.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to