Skip to content

Commit 4e23853

Browse files
Godinmarchof
authored andcommitted
Add unit test for NoneProbeArrayStrategy (bazel-contrib#855)
1 parent 23d835d commit 4e23853

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Evgeny Mandrikov - initial API and implementation
10+
*
11+
*******************************************************************************/
12+
package org.jacoco.core.internal.instr;
13+
14+
import static org.junit.Assert.assertEquals;
15+
16+
import org.junit.Before;
17+
import org.junit.Test;
18+
import org.objectweb.asm.tree.ClassNode;
19+
20+
/**
21+
* Unit tests for {@link NoneProbeArrayStrategy}.
22+
*/
23+
public class NoneProbeArrayStrategyTest {
24+
25+
private NoneProbeArrayStrategy strategy;
26+
27+
@Before
28+
public void setup() {
29+
strategy = new NoneProbeArrayStrategy();
30+
}
31+
32+
@Test(expected = UnsupportedOperationException.class)
33+
public void storeInstance_should_throw_UnsupportedOperationException() {
34+
strategy.storeInstance(null, false, 0);
35+
}
36+
37+
@Test
38+
public void addMembers_should_not_add_members() {
39+
final ClassNode c = new ClassNode();
40+
strategy.addMembers(c, 0);
41+
42+
assertEquals(0, c.methods.size());
43+
assertEquals(0, c.fields.size());
44+
}
45+
46+
}

0 commit comments

Comments
 (0)