test_storage_integration.cpp

tests/integration/test_storage_integration.cpp

@file test_storage_integration.cpp @brief Integration tests for storage wiring into core engine.

Owners: @tvanfossen

test_complete_delegation

static bool test_complete_delegation(const char *del_id, const char *status, const char *summary, void *ud)

Complete delegation callback.

tests/integration/test_storage_integration.cpp:87

Result: absent

Verifies

requirementlinkedpath to the implementer
REQ-STOR-002inferredtest_complete_delegation → complete_delegation → execute
REQ-STOR-003inferredtest_complete_delegation → complete_delegation → utc_timestamp
REQ-STOR-005inferredtest_complete_delegation → complete_delegation
Source · 9 lines
static bool test_complete_delegation(
        const char* del_id, const char* status,
        const char* summary, void* ud) {
    auto* h = static_cast<StorageHarness*>(ud);
    h->complete_delegation_calls++;
    return h->storage.complete_delegation(
        del_id, status,
        summary ? std::optional<std::string>(summary) : std::nullopt);
}
Activity · 3 steps
lines 90–90auto* h = static_cast<StorageHarness*>(ud);lines 91–91h->complete_delegation_calls++;lines 92–94return h->storage.complete_delegation( del_id, status, summary ? std::optional<std::string>(summary) : std::nullopt);

test_create_delegation

static bool test_create_delegation(const char *parent_id, const char *del_tier, const char *target_tier, const char *task, int max_turns, std::string &del_id, std::string &child_id, void *ud)

Create delegation callback that delegates to real storage.

tests/integration/test_storage_integration.cpp:67

Show on the map →

Called by SCENARIO

Calls create_delegation

Result: absent

Verifies

requirementlinkedpath to the implementer
REQ-STOR-002inferredtest_create_delegation → create_delegation → execute
REQ-STOR-003inferredtest_create_delegation → create_delegation → create_conversation
REQ-STOR-005inferredtest_create_delegation → create_delegation
Source · 14 lines
static bool test_create_delegation(
        const char* parent_id, const char* del_tier,
        const char* target_tier, const char* task,
        int max_turns, std::string& del_id,
        std::string& child_id, void* ud) {
    auto* h = static_cast<StorageHarness*>(ud);
    h->create_delegation_calls++;
    bool ok = h->storage.create_delegation(
        parent_id, del_tier, target_tier, task, max_turns,
        del_id, child_id);
    h->last_delegation_id = del_id;
    h->last_child_id = child_id;
    return ok;
}
Activity · 6 steps
lines 72–72auto* h = static_cast<StorageHarness*>(ud);lines 73–73h->create_delegation_calls++;lines 74–76bool ok = h->storage.create_delegation( parent_id, del_tier, target_tier, task, max_turns, del_id, child_id);lines 77–77h->last_delegation_id = del_id;lines 78–78h->last_child_id = child_id;lines 79–79return ok;

test_save_snapshot

static bool test_save_snapshot(const char *conv_id, const char *msgs_json, void *ud)

Snapshot callback that delegates to real storage.

tests/integration/test_storage_integration.cpp:55

Show on the map →

Called by SCENARIO

Calls save_snapshot

Result: absent

Verifies

requirementlinkedpath to the implementer
REQ-STOR-002inferredtest_save_snapshot → save_snapshot → execute
REQ-STOR-003inferredtest_save_snapshot → save_snapshot
Source · 6 lines
static bool test_save_snapshot(
        const char* conv_id, const char* msgs_json, void* ud) {
    auto* h = static_cast<StorageHarness*>(ud);
    h->snapshot_calls++;
    return h->storage.save_snapshot(conv_id, msgs_json);
}
Activity · 3 steps
lines 57–57auto* h = static_cast<StorageHarness*>(ud);lines 58–58h->snapshot_calls++;lines 59–59return h->storage.save_snapshot(conv_id, msgs_json);