Skip to content
Open
Changes from all 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
6 changes: 3 additions & 3 deletions unit-test/sc_loads_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ void SC_LoadAts_Test_AtsEntryOverflow(void)
{
SC_AtsEntryHeader_t *Entry;
SC_AtsInfoTable_t AtsInfoTbl;
uint32 AtsTable[SC_ATS_BUFF_SIZE32];
uint32 Big_AtsTable[SC_ATS_BUFF_SIZE32 * 2];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the rationale for doubling the table size?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there was a specific rationale for doubling it. I just wanted to make sure it was big enough to prevent an overflow.

uint8 AtsIndex = 0;
size_t MsgSize1;
size_t MsgSize2;
Expand All @@ -423,12 +423,12 @@ void SC_LoadAts_Test_AtsEntryOverflow(void)
int j;

memset(&AtsInfoTbl, 0, sizeof(AtsInfoTbl));
memset(&AtsTable, 0, sizeof(AtsTable));
memset(&Big_AtsTable, 0, sizeof(Big_AtsTable));

SC_InitTables();

SC_OperData.AtsCmdStatusTblAddr[AtsIndex] = &SC_APP_TEST_GlobalAtsCmdStatusTbl[0];
SC_OperData.AtsTblAddr[AtsIndex] = &AtsTable[0];
SC_OperData.AtsTblAddr[AtsIndex] = &Big_AtsTable[0];
SC_OperData.AtsInfoTblAddr = &AtsInfoTbl;

MsgSize1 = SC_PACKET_MAX_SIZE;
Expand Down