Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

alignment(session): replacing isOpen with isClosed. #238

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}

fun info(): SessionInfo {
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
Loading