Skip to content

Commit

Permalink
Fix CI failure
Browse files Browse the repository at this point in the history
  • Loading branch information
tehampson committed Nov 8, 2023
1 parent dd6300b commit 53c62fe
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/lib/dnssd/minimal_mdns/tests/TestResponseSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,40 +280,40 @@ void AddManyQueryResponders(nlTestSuite * inSuite, void * inContext)

void PtrSrvTxtMultipleRespondersToInstance(nlTestSuite * inSuite, void * inContext)
{
CommonTestElements common1(inSuite, "test1");
CommonTestElements common2(inSuite, "test2");
auto common1 = new CommonTestElements(inSuite, "test1");
auto common2 = new CommonTestElements(inSuite, "test2");

// Just use the server from common1.
ResponseSender responseSender(&common1.server);
ResponseSender responseSender(&common1->server);

NL_TEST_ASSERT(inSuite, responseSender.AddQueryResponder(&common1.queryResponder) == CHIP_NO_ERROR);
common1.queryResponder.AddResponder(&common1.ptrResponder).SetReportInServiceListing(true);
common1.queryResponder.AddResponder(&common1.srvResponder);
common1.queryResponder.AddResponder(&common1.txtResponder);
NL_TEST_ASSERT(inSuite, responseSender.AddQueryResponder(&common1->queryResponder) == CHIP_NO_ERROR);
common1->queryResponder.AddResponder(&common1->ptrResponder).SetReportInServiceListing(true);
common1->queryResponder.AddResponder(&common1->srvResponder);
common1->queryResponder.AddResponder(&common1->txtResponder);

NL_TEST_ASSERT(inSuite, responseSender.AddQueryResponder(&common2.queryResponder) == CHIP_NO_ERROR);
common2.queryResponder.AddResponder(&common2.ptrResponder).SetReportInServiceListing(true);
common2.queryResponder.AddResponder(&common2.srvResponder);
common2.queryResponder.AddResponder(&common2.txtResponder);
NL_TEST_ASSERT(inSuite, responseSender.AddQueryResponder(&common2->queryResponder) == CHIP_NO_ERROR);
common2->queryResponder.AddResponder(&common2->ptrResponder).SetReportInServiceListing(true);
common2->queryResponder.AddResponder(&common2->srvResponder);
common2->queryResponder.AddResponder(&common2->txtResponder);

// Build a query for the second instance.
common2.recordWriter.WriteQName(common2.instance);
QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common2.requestNameStart, common2.requestBytesRange);
common2->recordWriter.WriteQName(common2->instance);
QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common2->requestNameStart, common2->requestBytesRange);

// Should get back answers from second instance only.
common1.server.AddExpectedRecord(&common2.srvRecord);
common1.server.AddExpectedRecord(&common2.txtRecord);
common1->server.AddExpectedRecord(&common2->srvRecord);
common1->server.AddExpectedRecord(&common2->txtRecord);

responseSender.Respond(1, queryData, &common1.packetInfo, ResponseConfiguration());
responseSender.Respond(1, queryData, &common1->packetInfo, ResponseConfiguration());

NL_TEST_ASSERT(inSuite, common1.server.GetSendCalled());
NL_TEST_ASSERT(inSuite, common1.server.GetHeaderFound());
NL_TEST_ASSERT(inSuite, common1->server.GetSendCalled());
NL_TEST_ASSERT(inSuite, common1->server.GetHeaderFound());
delete common1;
delete common2;
}

void PtrSrvTxtMultipleRespondersToServiceListing(nlTestSuite * inSuite, void * inContext)
{
// CommonTestElements common1(inSuite, "test1");
// CommonTestElements common2(inSuite, "test2");
auto common1 = new CommonTestElements(inSuite, "test1");
auto common2 = new CommonTestElements(inSuite, "test2");
// Just use the server from common1.
Expand Down

0 comments on commit 53c62fe

Please sign in to comment.