mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #5090
5090: Output corresponding array to EXPECTED in teehistorian test cases r=def- a=Zwelf Written this for #5032, might be helpful for others :) ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Zwelf <zwelf@strct.cc>
This commit is contained in:
commit
32340e3cfd
|
@ -144,6 +144,27 @@ protected:
|
|||
}
|
||||
|
||||
ASSERT_FALSE(m_Buffer.Error());
|
||||
|
||||
printf("pOutput = {");
|
||||
int Start = 0; // skip over header;
|
||||
for(int i = 0; i < m_Buffer.Size(); i++)
|
||||
{
|
||||
if(Start == 0)
|
||||
{
|
||||
if(m_Buffer.Data()[i] == 0)
|
||||
Start = i + 1;
|
||||
continue;
|
||||
}
|
||||
if(Start + i != 0)
|
||||
{
|
||||
if((Start + i) % 10 == 0)
|
||||
printf("\n\t");
|
||||
else
|
||||
printf(", ");
|
||||
}
|
||||
printf("0x%.2x", m_Buffer.Data()[i]);
|
||||
}
|
||||
printf("\n}\n");
|
||||
ASSERT_EQ(m_Buffer.Size(), OutputSize);
|
||||
ASSERT_TRUE(mem_comp(m_Buffer.Data(), pOutput, OutputSize) == 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue