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
180 changes: 180 additions & 0 deletions .fusa-reqs-pending.json

Large diffs are not rendered by default.

338 changes: 338 additions & 0 deletions .fusa-reqs.json

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions include/rcp/adapt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
// fusa:req REQ-RELAY-003
// fusa:req REQ-RELAY-004
// fusa:req REQ-RELAY-005
// fusa:req REQ-RELAY-006
// fusa:req REQ-RELAY-008
// fusa:req REQ-RELAY-009
// fusa:req REQ-RELAY-010
// fusa:req REQ-RELAY-012
//
// REQ-RELAY-014/016/017 (Phase 6 batch 12): genuinely implemented, but in
// include/relay/relay.hpp (relay::relay_category()/Channel::is_closed()) and
// include/rcp/rcp.hpp (rcp::ErrClosed/ErrTimeout/ErrBusy/ErrNotFound/
// ErrAlreadyExists's std::error_condition equivalence to relay::Errc) rather
// than in this file -- tagged here anyway, matching this codebase's own
// pre-existing convention of concentrating every REQ-RELAY-* //fusa:req tag
// in this one header regardless of which file the behavior actually lives
// in (see REQ-RELAY-001..005 above, whose own real implementations already
// span clock.c/relay.c/rcp.c-equivalent territory in c-RCP terms). Tests
// live in tests/test_relay.cpp, the file that actually exercises them.
// fusa:req REQ-RELAY-014
// fusa:req REQ-RELAY-016
// fusa:req REQ-RELAY-017

// RELAY application interface adapter for cpp-RCP (§10.3, §18.2).
//
Expand Down
5 changes: 5 additions & 0 deletions include/rcp/discovery.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
// fusa:req REQ-DISC-022
// fusa:req REQ-DISC-023
// fusa:req REQ-DISC-024
// fusa:req REQ-DISC-025
// fusa:req REQ-DISC-026
// fusa:req REQ-DISC-027
// fusa:req REQ-DISC-028
// fusa:req REQ-DISC-030

// TC18 requirements-corpus completeness pass: REQ-DISC-029 is catalogued in
// this module's own requirements catalog with a "tc18" citation and a
Expand Down
5 changes: 5 additions & 0 deletions tests/test_adapt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
// fusa:test REQ-RELAY-003
// fusa:test REQ-RELAY-004
// fusa:test REQ-RELAY-005
// fusa:test REQ-RELAY-006
// fusa:test REQ-RELAY-008
// fusa:test REQ-RELAY-009
// fusa:test REQ-RELAY-010
// fusa:test REQ-RELAY-012

// rcp/adapt.hpp conformance and behavioral-equivalence tests (RELAY spec
// §10.3, §15.7.5) — cpp-RCP issue #129, ROADMAP.md Phase 17 ("Phase 4")
Expand Down
36 changes: 36 additions & 0 deletions tests/test_relay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
// fusa:test REQ-RELAY-003
// fusa:test REQ-RELAY-004
// fusa:test REQ-RELAY-005
// fusa:test REQ-RELAY-006
// fusa:test REQ-RELAY-008
// fusa:test REQ-RELAY-009
// fusa:test REQ-RELAY-010
// fusa:test REQ-RELAY-012
// fusa:test REQ-RELAY-014
// fusa:test REQ-RELAY-016
// fusa:test REQ-RELAY-017

// RELAY conformance tests (RELAY spec §18.2, §5.1, §5.2, §10.3, §14, §19.4).
//
Expand Down Expand Up @@ -48,6 +56,24 @@ TEST_CASE("relay: Protocol enum values match spec §3", "[relay][conformance]")
REQUIRE(static_cast<int>(relay::Protocol::SOMEIP) == 6);
}

// to_string(Protocol) — c-RCP's relay_protocol_string() equivalent: a
// unique, non-empty name per defined protocol constant.
TEST_CASE("relay: to_string(Protocol) returns a unique, non-empty name per protocol",
"[relay][conformance]") {
const relay::Protocol protos[] = {relay::Protocol::CAN, relay::Protocol::DDS,
relay::Protocol::LIN, relay::Protocol::MQTT,
relay::Protocol::RCP, relay::Protocol::SOMEIP};
const size_t proto_count = sizeof(protos) / sizeof(protos[0]);
for (size_t i = 0; i < proto_count; ++i) {
auto name = relay::to_string(protos[i]);
REQUIRE_FALSE(name.empty());
for (size_t j = 0; j < i; ++j) {
REQUIRE(name != relay::to_string(protos[j]));
}
}
REQUIRE(relay::to_string(relay::Protocol::RCP) == "RCP");
}

// ── §5.1: Mandatory error sentinels ───────────────────────────────────────────

TEST_CASE("relay: mandatory error sentinels exist", "[relay][conformance]") {
Expand Down Expand Up @@ -134,6 +160,16 @@ TEST_CASE("relay: Channel recv returns nullopt after close with empty queue", "[
REQUIRE_FALSE(ch.recv().has_value());
}

// is_closed() reports the channel's closed state (REQ-RELAY-016) — c-RCP's
// relay_message_channel_is_closed() equivalent.
TEST_CASE("relay: Channel is_closed reports false before close and true after",
"[relay][channel]") {
relay::Channel<int> ch(4);
REQUIRE_FALSE(ch.is_closed());
ch.close();
REQUIRE(ch.is_closed());
}

// ── §10.3: Adapt() wraps a RequestFn as relay::Caller ────────────────────────
// mock_request_fn wires a fresh rcp::mock::Server (v2.12.0) as the RequestFn
// every test case below adapts — the same "client-side send-equivalent
Expand Down
Loading