pauldick 01/09/14 14:04:16
Modified: c/Tests/Extensions extensions.cpp
Log:
Numerous changes; provide better logging and results
Revision Changes Path
1.7 +22 -27 xml-xalan/c/Tests/Extensions/extensions.cpp
Index: extensions.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Extensions/extensions.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- extensions.cpp 2001/08/30 17:45:39 1.6
+++ extensions.cpp 2001/09/14 21:04:16 1.7
@@ -239,12 +239,13 @@
// This test verifies that the Nodeset function was properly
installed with the transformer. All
// functions are preinstalled globally. Output file should
contain data.
//
-void TestCase1(XalanTransformer &transformEngine, const XalanDOMString
&fileName)
+void TestCase1(XalanTransformer &transformEngine, const XalanDOMString
&fileName, XMLFileReporter &log)
{
XalanDOMString xml, xsl, result, gold;
generateFiles(fileName, xml, xsl, result, gold, "TestCase1");
+ futil.data.testOrFile = XalanDOMString("TestCase1");
// Create the InputSources and ResultTraget.
const XSLTInputSource xmlInputSource(c_wstr(xml));
@@ -255,9 +256,7 @@
int theResult = transformEngine.transform(xmlInputSource,
xslInputSource, theResultTarget);
if (!theResult)
{
- const XSLTInputSource resultInputSource(c_wstr(result));
- const XSLTInputSource goldInputSource(c_wstr(gold));
- futil.compareSerializedResults(resultInputSource,
goldInputSource, fileName, "TestCase1");
+ futil.checkResults(result, gold, log);
}
else
{
@@ -272,12 +271,13 @@
// This test verifies that the following functions: difference,
distinct, evaluate, hasSameNodes,
// and intersection are defined and working. Output file should
contain data.
//
-void TestCase2(XalanTransformer &transformEngine, const XalanDOMString
&fileName)
+void TestCase2(XalanTransformer &transformEngine, const XalanDOMString
&fileName, XMLFileReporter &log)
{
XalanDOMString xml, xsl, result, gold;
generateFiles(fileName, xml, xsl, result, gold, "TestCase2");
+ futil.data.testOrFile = XalanDOMString("TestCase2");
// Create the InputSources and ResultTraget.
const XSLTInputSource xmlInputSource(c_wstr(xml));
@@ -289,9 +289,7 @@
int theResult = transformEngine.transform(xmlInputSource,
xslInputSource, theResultTarget);
if (!theResult)
{
- const XSLTInputSource resultInputSource(c_wstr(result));
- const XSLTInputSource goldInputSource(c_wstr(gold));
- futil.compareSerializedResults(resultInputSource,
goldInputSource, fileName, "TestCase2");
+ futil.checkResults(result, gold, log);
}
else
{
@@ -307,12 +305,13 @@
// This test verifies that the 'nodeset' function is properly
uninstalled via the api.
// Output file should NOT contain data.
//
-void TestCase3(XalanTransformer &transformEngine, const XalanDOMString
&fileName)
+void TestCase3(XalanTransformer &transformEngine, const XalanDOMString
&fileName, XMLFileReporter &log)
{
XalanDOMString xml, xsl, result, gold;
generateFiles(fileName, xml, xsl, result, gold, "TestCase3");
+ futil.data.testOrFile = XalanDOMString("TestCase3");
// Create the InputSources and ResultTraget.
const XSLTInputSource xmlInputSource(c_wstr(xml));
@@ -352,13 +351,14 @@
// This tests the installExternalFunction method of
XalanTransformer using the nodeset function.
// Output file should NOT contain data.
//
-void TestCase4(XalanTransformer &transformEngine, const XalanDOMString
&fileName)
+void TestCase4(XalanTransformer &transformEngine, const XalanDOMString
&fileName, XMLFileReporter &log)
{
XalanDOMString xml, xsl, result, gold;
generateFiles(fileName, xml, xsl, result, gold, "TestCase4");
+ futil.data.testOrFile = XalanDOMString("TestCase4");
// Create the InputSources and ResultTraget.
const XSLTInputSource xmlInputSource(c_wstr(xml));
@@ -375,10 +375,8 @@
int theResult = transformEngine.transform(xmlInputSource,
xslInputSource, theResultTarget);
if (!theResult)
{
- const XSLTInputSource resultInputSource(c_wstr(result));
- const XSLTInputSource goldInputSource(c_wstr(gold));
- futil.compareSerializedResults(resultInputSource,
goldInputSource, fileName, "TestCase4a");
- }
+ futil.checkResults(result, gold, log);
+ }
else
{
cout << endl << "Failed: TestCase4a" ;
@@ -436,12 +434,13 @@
// This tests uses transformer method
installExternalFunctionGlobal to add the nodeset function.
// The output file should contain data.
//
-void TestCase5(XalanTransformer &transformEngine, const XalanDOMString
&fileName)
+void TestCase5(XalanTransformer &transformEngine, const XalanDOMString
&fileName, XMLFileReporter &log)
{
XalanDOMString xml, xsl, result, gold;
generateFiles(fileName, xml, xsl, result, gold, "TestCase5");
+ futil.data.testOrFile = XalanDOMString("TestCase5");
// Create the InputSources and ResultTraget.
const XSLTInputSource xmlInputSource(c_wstr(xml));
@@ -458,9 +457,7 @@
int theResult = transformEngine.transform(xmlInputSource,
xslInputSource, theResultTarget);
if (!theResult)
{
- const XSLTInputSource resultInputSource(c_wstr(result));
- const XSLTInputSource goldInputSource(c_wstr(gold));
- futil.compareSerializedResults(resultInputSource,
goldInputSource, fileName, "TestCase5a");
+ futil.checkResults(result, gold, log);
}
else
{
@@ -469,11 +466,9 @@
XalanTransformer newEngine;
int secondResult = newEngine.transform(xmlInputSource, xslInputSource,
theResultTarget);
- if (!secondResult)
+ if (!theResult)
{
- const XSLTInputSource resultInputSource(c_wstr(result));
- const XSLTInputSource goldInputSource(c_wstr(gold));
- futil.compareSerializedResults(resultInputSource,
goldInputSource, fileName, "TestCase5b");
+ futil.checkResults(result, gold, log);
}
else
{
@@ -523,11 +518,11 @@
// Get the files found in the "cextension" directory
const FileNameVectorType files =
futil.getTestFileNames(baseDir, testDir, true);
- TestCase1(transformEngine, files[0]);
- TestCase2(transformEngine, files[1]);
- TestCase3(transformEngine, files[0]);
- TestCase4(transformEngine, files[0]);
- TestCase5(transformEngine, files[0]);
+ TestCase1(transformEngine, files[0], logFile);
+ TestCase2(transformEngine, files[1], logFile);
+ TestCase3(transformEngine, files[0], logFile);
+ TestCase4(transformEngine, files[0], logFile);
+ TestCase5(transformEngine, files[0], logFile);
cout << endl;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]