Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B7EBE18894 for ; Fri, 11 Dec 2015 21:22:53 +0000 (UTC) Received: (qmail 69478 invoked by uid 500); 11 Dec 2015 21:22:53 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 69416 invoked by uid 500); 11 Dec 2015 21:22:53 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 69399 invoked by uid 99); 11 Dec 2015 21:22:53 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2015 21:22:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 1534C180A93 for ; Fri, 11 Dec 2015 21:22:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.227 X-Spam-Level: X-Spam-Status: No, score=0.227 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ocyPXBh7w9jM for ; Fri, 11 Dec 2015 21:22:41 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 23B7E2598B for ; Fri, 11 Dec 2015 21:22:36 +0000 (UTC) Received: (qmail 66398 invoked by uid 99); 11 Dec 2015 21:22:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2015 21:22:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EDFC9E0946; Fri, 11 Dec 2015 21:22:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Fri, 11 Dec 2015 21:22:52 -0000 Message-Id: In-Reply-To: <696653637cf04b7db23d9c6088fc9419@git.apache.org> References: <696653637cf04b7db23d9c6088fc9419@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [18/50] [abbrv] incubator-geode git commit: GEODE-626: add unit tests for MemoryChunk GEODE-626: add unit tests for MemoryChunk Added testGetSize and testCopyBytes. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/9283282c Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/9283282c Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/9283282c Branch: refs/heads/feature/GEODE-217 Commit: 9283282c64076c5f8e599f3d47895f3c48e205e8 Parents: 3259c02 Author: Darrel Schneider Authored: Fri Dec 4 16:33:50 2015 -0800 Committer: Darrel Schneider Committed: Fri Dec 4 16:47:24 2015 -0800 ---------------------------------------------------------------------- .../offheap/MemoryChunkJUnitTestBase.java | 47 ++++++++++++++++++++ 1 file changed, 47 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9283282c/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/MemoryChunkJUnitTestBase.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/MemoryChunkJUnitTestBase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/MemoryChunkJUnitTestBase.java index 2e4eabb..c8c0b2b 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/MemoryChunkJUnitTestBase.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/MemoryChunkJUnitTestBase.java @@ -50,6 +50,53 @@ public abstract class MemoryChunkJUnitTestBase { } @Test + public void testGetSize() { + MemoryChunk mc = createChunk(5); + try { + assertEquals(5, mc.getSize()); + } finally { + mc.release(); + } + mc = createChunk(0); + try { + assertEquals(0, mc.getSize()); + } finally { + mc.release(); + } + mc = createChunk(1024); + try { + assertEquals(1024, mc.getSize()); + } finally { + mc.release(); + } + } + + @Test + public void testCopyBytes() { + int CHUNK_SIZE = 1024; + MemoryChunk mc = createChunk(CHUNK_SIZE*2); + try { + for (int i=0; i