Skip to content

Commit

Permalink
Add event text logging to FPP component tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffany1618 authored and LeStarch committed Sep 27, 2023
1 parent 270304c commit 627127a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions FppTest/component/tests/EventTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ void Tester ::testEvent(NATIVE_INT_TYPE portNum, FppTest::Types::NoParams& data)

ASSERT_EVENTS_SIZE(1);
ASSERT_EVENTS_EventNoArgs_SIZE(1);

this->printTextLogHistory(stdout);
}

void Tester ::testEventHelper(NATIVE_INT_TYPE portNum, FppTest::Types::PrimitiveParams& data, NATIVE_UINT_TYPE size) {
Expand All @@ -50,6 +52,8 @@ void Tester ::testEvent(NATIVE_INT_TYPE portNum, FppTest::Types::PrimitiveParams
// Test throttle reset
component.log_ACTIVITY_LO_EventPrimitive_ThrottleClear();
testEventHelper(portNum, data, component.EVENTID_EVENTPRIMITIVE_THROTTLE + 1);

this->printTextLogHistory(stdout);
}

void Tester ::testEvent(NATIVE_INT_TYPE portNum, FppTest::Types::LogStringParams& data) {
Expand All @@ -58,6 +62,8 @@ void Tester ::testEvent(NATIVE_INT_TYPE portNum, FppTest::Types::LogStringParams
ASSERT_EVENTS_SIZE(1);
ASSERT_EVENTS_EventString_SIZE(1);
ASSERT_EVENTS_EventString(portNum, data.args.val1.toChar(), data.args.val2.toChar());

this->printTextLogHistory(stdout);
}

void Tester ::testEvent(NATIVE_INT_TYPE portNum, FppTest::Types::EnumParam& data) {
Expand All @@ -69,6 +75,8 @@ void Tester ::testEvent(NATIVE_INT_TYPE portNum, FppTest::Types::EnumParam& data
ASSERT_EVENTS_SIZE(1);
ASSERT_EVENTS_EventEnum_SIZE(1);
ASSERT_EVENTS_EventEnum(portNum, data.args.val);

this->printTextLogHistory(stdout);
}

void Tester ::testEventHelper(NATIVE_INT_TYPE portNum, FppTest::Types::ArrayParam& data, NATIVE_UINT_TYPE size) {
Expand Down Expand Up @@ -96,6 +104,8 @@ void Tester ::testEvent(NATIVE_INT_TYPE portNum, FppTest::Types::ArrayParam& dat
// Test throttle reset
component.log_FATAL_EventArray_ThrottleClear();
testEventHelper(portNum, data, component.EVENTID_EVENTARRAY_THROTTLE + 1);

this->printTextLogHistory(stdout);
}

void Tester ::testEvent(NATIVE_INT_TYPE portNum, FppTest::Types::StructParam& data) {
Expand All @@ -107,6 +117,8 @@ void Tester ::testEvent(NATIVE_INT_TYPE portNum, FppTest::Types::StructParam& da
ASSERT_EVENTS_SIZE(1);
ASSERT_EVENTS_EventStruct_SIZE(1);
ASSERT_EVENTS_EventStruct(portNum, data.args.val);

this->printTextLogHistory(stdout);
}

void Tester ::testEventHelper(NATIVE_INT_TYPE portNum, FppTest::Types::BoolParam& data, NATIVE_UINT_TYPE size) {
Expand Down Expand Up @@ -134,4 +146,6 @@ void Tester ::testEvent(NATIVE_INT_TYPE portNum, FppTest::Types::BoolParam& data
// Test throttle reset
component.log_WARNING_LO_EventBool_ThrottleClear();
testEventHelper(portNum, data, component.EVENTID_EVENTBOOL_THROTTLE + 1);

this->printTextLogHistory(stdout);
}

0 comments on commit 627127a

Please sign in to comment.