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:
bors[bot] 2022-05-12 14:21:46 +00:00 committed by GitHub
commit 32340e3cfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}