Skip to content

Commit

Permalink
Pull in changes from data-products branch
Browse files Browse the repository at this point in the history
  • Loading branch information
bocchino committed Feb 6, 2024
1 parent 0fc6eb2 commit c2bd960
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
20 changes: 20 additions & 0 deletions FppTest/dp/DpTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ void DpTest::schedIn_handler(const NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE con
this->dpRequest_Container2(CONTAINER_2_DATA_SIZE);
// Request a buffer for Container 3
this->dpRequest_Container3(CONTAINER_3_DATA_SIZE);
// Request a buffer for Container 4
this->dpRequest_Container4(CONTAINER_4_DATA_SIZE);
// Request a buffer for Container 5
this->dpRequest_Container5(CONTAINER_5_DATA_SIZE);
// Get a buffer for Container 1
{
DpContainer container;
Expand All @@ -69,6 +73,22 @@ void DpTest::schedIn_handler(const NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE con
// This one should fail
FW_ASSERT(status == Fw::Success::FAILURE);
}
// Get a buffer for Container 4
{
DpContainer container;
Fw::Success status = this->dpGet_Container4(CONTAINER_4_DATA_SIZE, container);
FW_ASSERT(status == Fw::Success::SUCCESS);
// Check the container
this->checkContainer(container, ContainerId::Container4, CONTAINER_4_PACKET_SIZE);
}
// Get a buffer for Container 5
{
DpContainer container;
Fw::Success status = this->dpGet_Container5(CONTAINER_5_DATA_SIZE, container);
FW_ASSERT(status == Fw::Success::SUCCESS);
// Check the container
this->checkContainer(container, ContainerId::Container5, CONTAINER_5_PACKET_SIZE);
}
}

// ----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion FppTest/dp/DpTest.fpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module FppTest {

@ A component for testing data product code gen
@ A component for testing data product code gen
active component DpTest {

# ----------------------------------------------------------------------
Expand Down
18 changes: 16 additions & 2 deletions FppTest/dp/test/ut/Tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ Tester::~Tester() {}
void Tester::schedIn_OK() {
this->invoke_to_schedIn(0, 0);
this->component.doDispatch();
ASSERT_PRODUCT_REQUEST_SIZE(3);
ASSERT_PRODUCT_REQUEST_SIZE(5);
ASSERT_PRODUCT_REQUEST(0, ID_BASE + DpTest::ContainerId::Container1, FwSizeType(DpTest::CONTAINER_1_PACKET_SIZE));
ASSERT_PRODUCT_REQUEST(1, ID_BASE + DpTest::ContainerId::Container2, FwSizeType(DpTest::CONTAINER_2_PACKET_SIZE));
ASSERT_PRODUCT_REQUEST(2, ID_BASE + DpTest::ContainerId::Container3, FwSizeType(DpTest::CONTAINER_3_PACKET_SIZE));
ASSERT_PRODUCT_GET_SIZE(3);
ASSERT_PRODUCT_REQUEST(3, ID_BASE + DpTest::ContainerId::Container4, FwSizeType(DpTest::CONTAINER_4_PACKET_SIZE));
ASSERT_PRODUCT_REQUEST(4, ID_BASE + DpTest::ContainerId::Container5, FwSizeType(DpTest::CONTAINER_5_PACKET_SIZE));
ASSERT_PRODUCT_GET_SIZE(5);
ASSERT_PRODUCT_GET(0, ID_BASE + DpTest::ContainerId::Container1, FwSizeType(DpTest::CONTAINER_1_PACKET_SIZE));
ASSERT_PRODUCT_GET(1, ID_BASE + DpTest::ContainerId::Container2, FwSizeType(DpTest::CONTAINER_2_PACKET_SIZE));
ASSERT_PRODUCT_GET(2, ID_BASE + DpTest::ContainerId::Container3, FwSizeType(DpTest::CONTAINER_3_PACKET_SIZE));
ASSERT_PRODUCT_GET(3, ID_BASE + DpTest::ContainerId::Container4, FwSizeType(DpTest::CONTAINER_4_PACKET_SIZE));
ASSERT_PRODUCT_GET(4, ID_BASE + DpTest::ContainerId::Container5, FwSizeType(DpTest::CONTAINER_5_PACKET_SIZE));
}

void Tester::productRecvIn_Container1_SUCCESS() {
Expand Down Expand Up @@ -308,6 +312,16 @@ Fw::Success::T Tester::productGet_handler(FwDpIdType id, FwSizeType size, Fw::Bu
case DpTest::ContainerId::Container3:
// Make this one fail for testing purposes
break;
case DpTest::ContainerId::Container4:
FW_ASSERT(size == DpTest::CONTAINER_4_PACKET_SIZE);
buffer = this->container4Buffer;
status = Fw::Success::SUCCESS;
break;
case DpTest::ContainerId::Container5:
FW_ASSERT(size == DpTest::CONTAINER_5_PACKET_SIZE);
buffer = this->container5Buffer;
status = Fw::Success::SUCCESS;
break;
default:
break;
}
Expand Down

0 comments on commit c2bd960

Please sign in to comment.