-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from LoiNguyenCS/primitive-array
add codes and tests for primitive array
- Loading branch information
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/test/java/org/checkerframework/specimin/PrimitiveArrayTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.checkerframework.specimin; | ||
|
||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* This test checks if Specimin can handle fields of type primitive array. | ||
*/ | ||
public class PrimitiveArrayTest { | ||
@Test | ||
public void runTest() throws IOException { | ||
SpeciminTestExecutor.runTestWithoutJarPaths( | ||
"primitivearray", | ||
new String[] {"com/example/Simple.java"}, | ||
new String[] {"com.example.Simple#bar()"}); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/test/resources/primitivearray/expected/com/example/Simple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.example; | ||
|
||
class Simple { | ||
|
||
static final byte[] VALUES = null; | ||
|
||
void bar() { | ||
int length = VALUES.length; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/test/resources/primitivearray/input/com/example/Simple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.example; | ||
|
||
class Simple { | ||
|
||
static final byte[] VALUES = new byte[]; | ||
// Target method. | ||
void bar() { | ||
int length = VALUES.length; | ||
} | ||
} |