You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2003/12/10 16:49:30 UTC
cvs commit: xml-xerces/c/tests/ThreadTest ThreadTest.cpp
knoaman 2003/12/10 07:49:30
Modified: c/tests/ThreadTest ThreadTest.cpp
Log:
Eliminate the preparsing stage - patch by Stephen Dulin
Revision Changes Path
1.32 +20 -1 xml-xerces/c/tests/ThreadTest/ThreadTest.cpp
Index: ThreadTest.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tests/ThreadTest/ThreadTest.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- ThreadTest.cpp 10 Jun 2003 04:17:29 -0000 1.31
+++ ThreadTest.cpp 10 Dec 2003 15:49:30 -0000 1.32
@@ -409,6 +409,7 @@
{
if (gRunInfo.dom) {
// Do a DOM parse
+ fXercesDOMParser->resetDocumentPool();
if (gRunInfo.inMemory)
fXercesDOMParser->parse(*mbis);
else
@@ -866,6 +867,16 @@
int checkSum = 0;
checkSum = thParser->parse(docNum);
+ // SRD -- for the case where we skip the preparse we will have nothing
+ // to compare the first parse's results to ... so if this looks like
+ // first parser move the checkSum back into the gRunInfo data for this
+ // file.
+
+ if (gRunInfo.files[docNum].checkSum == 0)
+ {
+ gRunInfo.files[docNum].checkSum = checkSum;
+ }
+
if (checkSum != gRunInfo.files[docNum].checkSum)
{
fprintf(stderr, "\nThread %d: Parse Check sum error on file \"%s\". Expected %x, got %x\n",
@@ -939,7 +950,14 @@
//
ReadFilesIntoMemory();
+ // SRD -- initialize checksums to zero so we can check first parse and if
+ // zero then we need to move first parse's checksum into array
+ for (int n = 0; n < gRunInfo.numInputFiles; n++)
+ {
+ gRunInfo.files[n].checkSum = 0;
+ }
+#ifdef DOINITIALPARSE
//
// While we are still single threaded, parse each of the documents
// once, to check for errors, and to note the checksum.
@@ -977,6 +995,7 @@
}
delete mainParser;
+#endif
//
// Fire off the requested number of parallel threads
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org