Skip to content

Commit

Permalink
alignment(session): replacing isOpen with isClosed. (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP authored Sep 20, 2024
1 parent 90d60f4 commit 3345e92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Session.kt
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,8 @@ class Session private constructor(private val config: Config) : AutoCloseable {
}

/** Returns if session is open or has been closed. */
fun isOpen(): Boolean {
return jniSession != null
fun isClosed(): Boolean {
return jniSession == null
}

/**
Expand Down
4 changes: 2 additions & 2 deletions zenoh-kotlin/src/commonTest/kotlin/io/zenoh/SessionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class SessionTest {
@Test
fun sessionStartCloseTest() {
val session = Session.open(Config.default()).getOrThrow()
assertTrue(session.isOpen())
assertFalse(session.isClosed())
session.close()
assertFalse(session.isOpen())
assertTrue(session.isClosed())
}

@Test
Expand Down

0 comments on commit 3345e92

Please # to comment.