Skip to content
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
2 changes: 1 addition & 1 deletion include/rcp/rcp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ inline const std::error_category& rcp_category() noexcept {
case Errc::busy: return re == relay::Errc::timeout;
case Errc::not_found: return re == relay::Errc::not_connected;
case Errc::zone_mismatch: return re == relay::Errc::not_connected;
case Errc::already_exists: return re == relay::Errc::closed; // §5.3; see RELAY issue #8
case Errc::already_exists: return false; // standalone per §5.4 (RELAY spec updated)
default: return false;
}
}
Expand Down
8 changes: 8 additions & 0 deletions tests/test_relay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ TEST_CASE("relay: rcp::ErrZoneMismatch maps to relay::ErrNotConnected", "[relay]
REQUIRE(rcp::ErrZoneMismatch == relay::ErrNotConnected);
}

TEST_CASE("relay: rcp::ErrAlreadyExists is standalone (no relay sentinel)", "[relay][conformance]") {
// Per RELAY spec §5.4 update: ErrAlreadyExists is not a relay sentinel.
REQUIRE(rcp::ErrAlreadyExists != relay::ErrClosed);
REQUIRE(rcp::ErrAlreadyExists != relay::ErrNotConnected);
REQUIRE(rcp::ErrAlreadyExists != relay::ErrTimeout);
REQUIRE(rcp::ErrAlreadyExists != relay::ErrPayloadTooLarge);
}

// ── §18.2: Context aliased from relay::Context ───────────────────────────────

TEST_CASE("relay: rcp::Context is relay::Context", "[relay][conformance]") {
Expand Down
Loading