You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mnemonic.apache.org by ga...@apache.org on 2020/01/27 09:05:58 UTC

[mnemonic] branch master updated: MNEMONIC-535: Use assert function to handle test results and messages instead of println; import assert library correspondingly

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

garyw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mnemonic.git


The following commit(s) were added to refs/heads/master by this push:
     new 204ad76  MNEMONIC-535: Use assert function to handle test results and messages instead of println; import assert library correspondingly
204ad76 is described below

commit 204ad76d457fbbd19ec9d317006f5969018376d1
Author: Chunyong He <ch...@gmail.com>
AuthorDate: Sat Oct 26 22:06:14 2019 -0700

    MNEMONIC-535: Use assert function to handle test results and messages instead of println; import assert library correspondingly
---
 .../java/org/apache/mnemonic/PMDKNonVolatileMemAllocatorNGTest.java  | 4 +---
 .../java/org/apache/mnemonic/PMDKVolatileMemAllocatorNGTest.java     | 5 ++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/mnemonic-core/src/test/java/org/apache/mnemonic/PMDKNonVolatileMemAllocatorNGTest.java b/mnemonic-core/src/test/java/org/apache/mnemonic/PMDKNonVolatileMemAllocatorNGTest.java
index eb215a9..3015523 100644
--- a/mnemonic-core/src/test/java/org/apache/mnemonic/PMDKNonVolatileMemAllocatorNGTest.java
+++ b/mnemonic-core/src/test/java/org/apache/mnemonic/PMDKNonVolatileMemAllocatorNGTest.java
@@ -49,9 +49,7 @@ public class PMDKNonVolatileMemAllocatorNGTest {
       for (int i = 0; i < size; i++) {
         mbh.get().put((byte) randomGenerator.nextInt(255));
       }
-      Assert.assertEquals(size, mbh.get().capacity());
-      System.out.println(String.format("[Seq.%d] size %d - %d, (%s)", idx, size, mbh.get().capacity(),
-          size == mbh.get().capacity() ? "Correct" : "Failed!!!"));
+      Assert.assertEquals(mbh.get().capacity(), size, String.format("Seq.%d ", idx));
     }
     act.close();
   }
diff --git a/mnemonic-core/src/test/java/org/apache/mnemonic/PMDKVolatileMemAllocatorNGTest.java b/mnemonic-core/src/test/java/org/apache/mnemonic/PMDKVolatileMemAllocatorNGTest.java
index 4324b3d..77ddb7d 100644
--- a/mnemonic-core/src/test/java/org/apache/mnemonic/PMDKVolatileMemAllocatorNGTest.java
+++ b/mnemonic-core/src/test/java/org/apache/mnemonic/PMDKVolatileMemAllocatorNGTest.java
@@ -18,9 +18,8 @@
 package org.apache.mnemonic;
 
 import org.testng.annotations.Test;
-
 import java.util.Random;
-
+import org.testng.Assert;
 /**
  * test the functionality of VolatileMemAllocator class.
  *
@@ -60,7 +59,7 @@ public class PMDKVolatileMemAllocatorNGTest {
     for (int idx = 1; idx <= 5; ++idx) {
       int size = randomGenerator.nextInt(1024 * 1024) + 1024 * 1024;
       mch = act.createChunk(size);
-      System.out.println(String.format("[Seq.%d] addr : %X", idx, size, mch.get()));
+      Assert.assertNotNull(mch, String.format("[Seq.%d] size: %d ", idx, size));
       mch.destroy();
     }
   }