Skip to content

Commit 2ce1c76

Browse files
committed
gh-279 Remove dead code, add test for code coverage
1 parent a9228db commit 2ce1c76

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎src/main/java/org/lmdbjava/Env.java‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -777,11 +777,6 @@ public static final class EnvInUseException extends LmdbException {
777777

778778
private static final long serialVersionUID = 1L;
779779

780-
/** Creates a new instance. */
781-
public EnvInUseException() {
782-
super("Environment has open transactions/cursors so cannot be closed.");
783-
}
784-
785780
/**
786781
* Creates a new instance.
787782
*

‎src/test/java/org/lmdbjava/EnvTest.java‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,15 @@ void singleThreaded(final BooleanArg safeClose, final BooleanArg singleThreaded)
11011101
testEnvUse(safeClose, singleThreaded);
11021102
}
11031103

1104+
@Test
1105+
void testToString() {
1106+
final Path dir = tempDir.createTempDir();
1107+
try (Env<ByteBuffer> env =
1108+
Env.create().setSafeClose().setMaxReaders(64).setMaxDbs(1).open(dir)) {
1109+
assertThat(env.toString()).doesNotStartWith("@");
1110+
}
1111+
}
1112+
11041113
private void testEnvUse(final BooleanArg safeClose, final BooleanArg singleThreaded) {
11051114
final Path file = tempDir.createTempFile();
11061115

0 commit comments

Comments
 (0)