diff options
author | Evgeny Mandrikov <138671+Godin@users.noreply.github.com> | 2019-03-09 00:36:35 +0100 |
---|---|---|
committer | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2019-03-09 00:36:35 +0100 |
commit | 4e2385364ab4b02487e96bcaea0d7774b2f039cc (patch) | |
tree | cf7438499e8c708364d482ac65e51d7276337f6e | |
parent | 23d835d5eb0f62a7ff036c5e74d933f0de407e7c (diff) | |
download | platform_external_jacoco-4e2385364ab4b02487e96bcaea0d7774b2f039cc.tar.gz platform_external_jacoco-4e2385364ab4b02487e96bcaea0d7774b2f039cc.tar.bz2 platform_external_jacoco-4e2385364ab4b02487e96bcaea0d7774b2f039cc.zip |
Add unit test for NoneProbeArrayStrategy (#855)
-rw-r--r-- | org.jacoco.core.test/src/org/jacoco/core/internal/instr/NoneProbeArrayStrategyTest.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/NoneProbeArrayStrategyTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/NoneProbeArrayStrategyTest.java new file mode 100644 index 00000000..0c21f02c --- /dev/null +++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/NoneProbeArrayStrategyTest.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Evgeny Mandrikov - initial API and implementation + * + *******************************************************************************/ +package org.jacoco.core.internal.instr; + +import static org.junit.Assert.assertEquals; + +import org.junit.Before; +import org.junit.Test; +import org.objectweb.asm.tree.ClassNode; + +/** + * Unit tests for {@link NoneProbeArrayStrategy}. + */ +public class NoneProbeArrayStrategyTest { + + private NoneProbeArrayStrategy strategy; + + @Before + public void setup() { + strategy = new NoneProbeArrayStrategy(); + } + + @Test(expected = UnsupportedOperationException.class) + public void storeInstance_should_throw_UnsupportedOperationException() { + strategy.storeInstance(null, false, 0); + } + + @Test + public void addMembers_should_not_add_members() { + final ClassNode c = new ClassNode(); + strategy.addMembers(c, 0); + + assertEquals(0, c.methods.size()); + assertEquals(0, c.fields.size()); + } + +} |