pauldick 01/09/14 14:04:33
Modified: c/Tests/InputSource inputsource.cpp
Log:
Numerous changes; provide better logging and results
Revision Changes Path
1.4 +60 -12 xml-xalan/c/Tests/InputSource/inputsource.cpp
Index: inputsource.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/InputSource/inputsource.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- inputsource.cpp 2001/08/16 18:12:00 1.3
+++ inputsource.cpp 2001/09/14 21:04:33 1.4
@@ -223,6 +223,7 @@
const XalanDOMString theOutputFile = futil.GenerateFileName(outBase,
"out1");
const XSLTResultTarget theResultTarget(theOutputFile);
+ futil.data.testOrFile = xsl;
// This code excersized the stated methods of XSLTInputSource
const XSLTInputSource xmlInputSource(c_wstr(xml));
@@ -231,10 +232,17 @@
// Do the transform and report the results.
int theResult = xalan.transform(xmlInputSource, xslInputSource,
theResultTarget);
if (!theResult)
- {
- const XSLTInputSource resultInputSource(c_wstr(theOutputFile));
- const XSLTInputSource goldInputSource(c_wstr(goldInputFile));
- futil.compareSerializedResults(resultInputSource,
goldInputSource, fileName, "TestCase1");
+ {
+ if(futil.compareSerializedResults(theOutputFile, goldInputFile))
+ {
+ cout << "Passed: " << "TestCase1" << endl;
+// logFile.logCheckPass(currentFile);
+ }
+ else
+ {
+// logFile.logCheckFail(currentFile);
+ }
+
}
}
@@ -250,19 +258,27 @@
const XalanDOMString theOutputFile = futil.GenerateFileName(outBase,
"one2");
const XSLTResultTarget theResultTarget2(theOutputFile);
+ futil.data.testOrFile = "TestCase2";
// This code excersized the stated methods of XSLTInputSource
- const XSLTInputSource
xslStringSource("\\xslt\\xsl-test\\conf\\capi\\capi01.xsl","public-smublic");
- const XSLTInputSource
xmlStringSource("\\xslt\\xsl-test\\conf\\capi\\capi01.xml");
+ const XSLTInputSource
xslStringSource("\\xml-xalan\\test\\tests\\capi\\smoke\\smoke01.xsl","public-smublic");
+ const XSLTInputSource
xmlStringSource("\\xml-xalan\\test\\tests\\capi\\smoke\\smoke01.xml");
// Do the transform and report the results.
int theResult = xalan.transform(xmlStringSource, xslStringSource,
theResultTarget2);
if (!theResult)
- {
- const XSLTInputSource resultInputSource(c_wstr(theOutputFile));
- const XSLTInputSource goldInputSource(c_wstr(goldInputFile));
- futil.compareSerializedResults(resultInputSource,
goldInputSource, fileName, "TestCase2");
+ {
+ if(futil.compareSerializedResults(theOutputFile, goldInputFile))
+ {
+ cout << "Passed: " << "TestCase2" << endl;
+// logFile.logCheckPass(currentFile);
+ }
+ else
+ {
+// logFile.logCheckFail(currentFile);
+ }
+
}
}
@@ -317,7 +333,7 @@
xObjectFactory);
// Create the XSL Input Source
- const XSLTInputSource
xslStringSource("\\xslt\\xsl-test\\conf\\capi\\capi01.xsl","public-smublic");
+ const XSLTInputSource
xslStringSource("\\xml-xalan\\test\\tests\\capi\\smoke\\smoke01.xsl","public-smublic");
XalanDocument* domXSL = parserLiaison.createXalanSourceTreeDocument();
domXSL = parserLiaison.parseXMLStream(xslStringSource);
@@ -353,6 +369,35 @@
}
+// TestCase4 will use the following API. Default constructor of
XSLTInputSource will take a string.
+// - XSLTInputSource(const char*)
+// - XSLTInputSource(const char*)
+void testCase4(XalanTransformer &xalan)
+{
+ // This code excersized the stated methods of XSLTInputSource
+
+ // Do the transform and report the results.
+ int theResult =
xalan.transform("\\xml-xalan\\test\\tests\\capi\\smoke\\smoke01.xml",
+
"\\xml-xalan\\test\\tests\\capi\\smoke\\smoke01.xsl",
+
"\\xml-xalan\\test\\tests\\ISOURCE-results\\smoke\\testCase4.out");
+ if (!theResult)
+ {
+ const XalanDOMString
result("\\xml-xalan\\test\\tests\\ISOURCE-results\\smoke\\testCase4.out");
+ const XalanDOMString
gold("\\xml-xalan\\test\\tests\\capi-gold\\smoke\\capi01.out");
+ if(futil.compareSerializedResults(result, gold))
+ {
+ cout << "Passed: " << "TestCase4" << endl;
+// logFile.logCheckPass(currentFile);
+ }
+ else
+ {
+// logFile.logCheckFail(currentFile);
+ }
+
+ }
+
+}
+
int
main(
int argc,
@@ -413,7 +458,8 @@
// Output file name to result log and
console.
//logFile.logTestCaseInit(files[i]);
fileName = files[i];
- cout << fileName << endl;
+ futil.data.testOrFile = fileName;
+ //cout << fileName << endl;
// Set up the input/output files.
const XalanDOMString theXSLFile=
baseDir + xDir + pathSep + fileName;
@@ -434,6 +480,8 @@
testCase2(transformEngine, theOutput,
theGoldFile, fileName);
//testCase3(transformEngine, logFile,
theXMLFile, theXSLFile, theOutput);
+
+ testCase4(transformEngine);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]