mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #578 from Dmitry-Me/checkReadingResults
Check various stages of reading the XML file
This commit is contained in:
commit
fc2a0017d7
|
@ -2013,12 +2013,15 @@ int main( int argc, const char ** argv )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FILE* perfFP = fopen("resources/dream.xml", "r");
|
FILE* perfFP = fopen("resources/dream.xml", "r");
|
||||||
|
XMLTest("Open dream.xml", true, perfFP != 0);
|
||||||
fseek(perfFP, 0, SEEK_END);
|
fseek(perfFP, 0, SEEK_END);
|
||||||
long size = ftell(perfFP);
|
long size = ftell(perfFP);
|
||||||
fseek(perfFP, 0, SEEK_SET);
|
fseek(perfFP, 0, SEEK_SET);
|
||||||
|
|
||||||
char* mem = new char[size + 1];
|
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);
|
fclose(perfFP);
|
||||||
mem[size] = 0;
|
mem[size] = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue