#include <cassert>
#include <cstdint>
#include "integration_model.hpp"

int main()
{
    integration::Sample const accepted[ 3 ]{
        { 1U, 10U, integration::MessageKind::sample },
        { 2U, 20U, integration::MessageKind::sample },
        { 3U, 30U, integration::MessageKind::sample }
    };
    integration::Sample const dropped{
        4U, 40U, integration::MessageKind::sample };
    std::uint32_t sum = 0U;
    for( auto const sample : accepted )
    {
        auto const report = integration::transform( sample );
        assert( report.sequence == sample.sequence );
        sum += report.transformed;
    }
    assert( sum == 120U );
    assert( dropped.sequence == 4U );

    integration::TraceEvent const trace[ 3 ]{
        { 1U, 1U, integration::TraceStage::isr_kick, 1U },
        { 2U, 5U, integration::TraceStage::timer_callback, 1U },
        { 3U, 10U, integration::TraceStage::final_report, 1U }
    };
    auto const first = integration::trace_digest( trace, 3U );
    auto const second = integration::trace_digest( trace, 3U );
    assert( first != 0U && first == second );
}
