Merge pull request #578 from Dmitry-Me/checkReadingResults

Check various stages of reading the XML file
This commit is contained in:
Lee Thomason 2017-07-06 16:55:09 -07:00 committed by GitHub
commit fc2a0017d7
1 changed files with 4 additions and 1 deletions

View File

@ -2013,12 +2013,15 @@ int main( int argc, const char ** argv )
#endif
FILE* perfFP = fopen("resources/dream.xml", "r");
XMLTest("Open dream.xml", true, perfFP != 0);
fseek(perfFP, 0, SEEK_END);
long size = ftell(perfFP);
fseek(perfFP, 0, SEEK_SET);
char* mem = new char[size + 1];
fread(mem, size, 1, perfFP);
memset(mem, 0xfe, size);
size_t bytesRead = fread(mem, size, 1, perfFP);
XMLTest("Read dream.xml", size, bytesRead);
fclose(perfFP);
mem[size] = 0;