Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ case class StateMachineCppWriter(

private def getClassMembers: List[CppDoc.Class.Member] =
List.concat(
getFriendClassMembers,
getTypeMembers,
getConstructorDestructorMembers,
getInitMembers,
Expand Down Expand Up @@ -295,4 +296,22 @@ case class StateMachineCppWriter(
CppDoc.Lines.Hpp
)

private def getFriendClassMembers: List[CppDoc.Class.Member] = {
List(
linesClassMember(
List(
CppDocWriter.writeBannerComment(
"Friend classes"
),
lines(
s"""|
|//! Friend class tester implementation to support white-box testing
|friend class ${name}Tester;
|"""
)
).flatten
)
)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine with a choice
class BasicStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine with a U32 choice
class BasicU32StateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicU32Tester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ namespace FppTest {
//! with hierarchy
class ChoiceToChoiceStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class ChoiceToChoiceTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ namespace FppTest {
//! with hierarchy
class ChoiceToStateStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class ChoiceToStateTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A state machine with two inputs to a choice
class InputPairU16U32StateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class InputPairU16U32Tester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine with a choice sequence
class SequenceStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class SequenceTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine with a U32 choice sequence
class SequenceU32StateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class SequenceU32Tester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine
class BasicStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A state machine with an initial choice
class ChoiceStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class ChoiceTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A state machine with nested initial transitions
class NestedStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class NestedTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine with a guard
class BasicGuardStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicGuardTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine with a string guard
class BasicGuardStringStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicGuardStringTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ namespace FppTest {
//! A basic state machine with a TestAbsType guard
class BasicGuardTestAbsTypeStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicGuardTestAbsTypeTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ namespace FppTest {
//! A basic state machine with a TestArray guard
class BasicGuardTestArrayStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicGuardTestArrayTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ namespace FppTest {
//! A basic state machine with a TestEnum guard
class BasicGuardTestEnumStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicGuardTestEnumTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ namespace FppTest {
//! A basic state machine with a TestStruct guard
class BasicGuardTestStructStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicGuardTestStructTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine with a U32 guard
class BasicGuardU32StateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicGuardU32Tester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine with an internal transition
class BasicInternalStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicInternalTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine with a self transition
class BasicSelfStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicSelfTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine
class BasicStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine with string actions
class BasicStringStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicStringTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ namespace FppTest {
//! A basic state machine with TestAbsType actions
class BasicTestAbsTypeStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicTestAbsTypeTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ namespace FppTest {
//! A basic state machine with TestArray actions
class BasicTestArrayStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicTestArrayTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ namespace FppTest {
//! A basic state machine with TestEnum actions
class BasicTestEnumStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicTestEnumTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ namespace FppTest {
//! A basic state machine with TestStruct actions
class BasicTestStructStateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicTestStructTester;

public:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ namespace FppTest {
//! A basic state machine with U32 actions
class BasicU32StateMachineBase {

// ----------------------------------------------------------------------
// Friend classes
// ----------------------------------------------------------------------

//! Friend class tester implementation to support white-box testing
friend class BasicU32Tester;

public:

// ----------------------------------------------------------------------
Expand Down
Loading