Rob Bocchino b89b5d91c4
Add DpWriter (#2593)
* Pull in framework changes from data-products branch

* Pull in changes to DpManager from data-products branch

* Pull in DpWriter from data-products branch

* Fix spelling

* Revise FileNameString

* Fix warnings in CI

* Fix static analysis warnings

* Fix static analysis warnings

* Revise formatting and comments

* Revise banner comments

* Revise FileNameString per PR comment

* Revise path names in config headers

If a header H.hpp exists in the F Prime source base, then

is dangerous. Because [project root] and [fprime root] are both
in the list of include paths, it's not clear whether this means "include
[project root]/config/H.hpp" or "include [fprime root]/config/H.hpp."

On the other hand,

or

has no such ambiguity, because only one of [project root]/config
and [fprime root]/config is in the list of include paths.

* Revise path names in config headers

If a header H.hpp exists in the F Prime source base, then

`#include "config/H.hpp"`

is dangerous. Because [project root] and [fprime root] are both
in the list of include paths, it's not clear whether this means "include
[project root]/config/H.hpp" or "include [fprime root]/config/H.hpp."

On the other hand,

include <config/H.hpp>

or

`#include "config/H.hpp"`

has no such ambiguity, because only one of [project root]/config
and [fprime root]/config is in the list of include paths.
2024-03-28 16:09:38 -07:00

55 lines
2.3 KiB
C++

// ======================================================================
// \title Rules.hpp
// \author Rob Bocchino
// \brief Rules for testing DpWriter
//
// \copyright
// Copyright (C) 2024 California Institute of Technology.
// ALL RIGHTS RESERVED. United States Government sponsorship
// acknowledged.
// ======================================================================
#ifndef Svc_Rules_HPP
#define Svc_Rules_HPP
#include "STest/Rule/Rule.hpp"
#include "Svc/DpWriter/test/ut/TestState/TestState.hpp"
#define RULES_DEF_RULE(GROUP_NAME, RULE_NAME) \
namespace GROUP_NAME { \
\
struct RULE_NAME : public STest::Rule<TestState> { \
RULE_NAME() : Rule<TestState>(#GROUP_NAME "." #RULE_NAME) {} \
\
bool precondition(const TestState& state) { return state.precondition__##GROUP_NAME##__##RULE_NAME(); } \
\
void action(TestState& state) { state.action__##GROUP_NAME##__##RULE_NAME(); } \
}; \
}
namespace Svc {
namespace Rules {
RULES_DEF_RULE(BufferSendIn, BufferTooSmallForData)
RULES_DEF_RULE(BufferSendIn, BufferTooSmallForPacket)
RULES_DEF_RULE(BufferSendIn, FileOpenError)
RULES_DEF_RULE(BufferSendIn, FileWriteError)
RULES_DEF_RULE(BufferSendIn, InvalidBuffer)
RULES_DEF_RULE(BufferSendIn, InvalidHeader)
RULES_DEF_RULE(BufferSendIn, InvalidHeaderHash)
RULES_DEF_RULE(BufferSendIn, OK)
RULES_DEF_RULE(CLEAR_EVENT_THROTTLE, OK)
RULES_DEF_RULE(FileOpenStatus, Error)
RULES_DEF_RULE(FileOpenStatus, OK)
RULES_DEF_RULE(FileWriteStatus, Error)
RULES_DEF_RULE(FileWriteStatus, OK)
RULES_DEF_RULE(SchedIn, OK)
} // namespace Rules
} // namespace Svc
#endif