diff --git a/htmlparser/tests/logparse/TestParser.cpp b/htmlparser/tests/logparse/TestParser.cpp index b931377c2f1..e60b9d602de 100644 --- a/htmlparser/tests/logparse/TestParser.cpp +++ b/htmlparser/tests/logparse/TestParser.cpp @@ -23,7 +23,6 @@ #include "nsParserCIID.h" #include "nsIParser.h" #include "nsILoggingSink.h" -#include "CNavDTD.h" #include "nsIInputStream.h" #include "prprf.h" #include @@ -46,6 +45,8 @@ static NS_DEFINE_IID(kLoggingSinkCID, NS_LOGGING_SINK_CID); static NS_DEFINE_IID(kIParserIID, NS_IPARSER_IID); static NS_DEFINE_IID(kILoggingSinkIID, NS_ILOGGING_SINK_IID); +static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID); + //---------------------------------------------------------------------- static void SetupRegistry() @@ -93,7 +94,7 @@ nsresult ParseData(char* anInputStream,char* anOutputStream) { if (NS_SUCCEEDED(result)) { // Create a dtd nsCOMPtr dtd; - result=NS_NewNavHTMLDTD(getter_AddRefs(dtd)); + result=nsComponentManager::CreateInstance(kNavDTDCID,nsnull,NS_GET_IID(nsIDTD),getter_AddRefs(dtd)); if(NS_SUCCEEDED(result)) { // Parse the document, having the sink write the data to fp PRFileDesc* out; diff --git a/htmlparser/tests/logparse/TestParser.pl b/htmlparser/tests/logparse/TestParser.pl index aefe8eb2a4f..80acc11e7c5 100644 --- a/htmlparser/tests/logparse/TestParser.pl +++ b/htmlparser/tests/logparse/TestParser.pl @@ -7,28 +7,25 @@ $drive=$`; - die "\nUsage: perl TestParser.pl [-b|-v|-c] - b -> creates baseline file(*.b) - v -> creates verification file (*.v) - c -> compare baseline vs verification\n" + die "\nUsage: perl TestParser.pl [-b|-v] + b -> create baseline + v -> verify changes\n" if(@ARGV < 2 || @ARGV > 2); open(FILE_LIST,$ARGV[1]) || die "\nCannot open $ARGV[1]\n"; - if($ARGV[0] eq "-b" || $ARGV[0] eq "-v") { - $ARGV[0]=~s/-//g; # create file extension for the output - + if($ARGV[0] eq "-b") { foreach $input() { @output=split(/\./,$input); - system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].$ARGV[0]"); + system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].b"); } } - elsif($ARGV[0] eq "-c") { - # use windows "fc" to compare files!!! - foreach $input() { + elsif($ARGV[0] eq "-v") { + foreach $input() { @output=split(/\./,$input); - system("fc $output[0].b $output[0].v"); + system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].v"); + system("fc $output[0].b $output[0].v"); } } else { diff --git a/parser/htmlparser/tests/logparse/TestParser.cpp b/parser/htmlparser/tests/logparse/TestParser.cpp index b931377c2f1..e60b9d602de 100644 --- a/parser/htmlparser/tests/logparse/TestParser.cpp +++ b/parser/htmlparser/tests/logparse/TestParser.cpp @@ -23,7 +23,6 @@ #include "nsParserCIID.h" #include "nsIParser.h" #include "nsILoggingSink.h" -#include "CNavDTD.h" #include "nsIInputStream.h" #include "prprf.h" #include @@ -46,6 +45,8 @@ static NS_DEFINE_IID(kLoggingSinkCID, NS_LOGGING_SINK_CID); static NS_DEFINE_IID(kIParserIID, NS_IPARSER_IID); static NS_DEFINE_IID(kILoggingSinkIID, NS_ILOGGING_SINK_IID); +static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID); + //---------------------------------------------------------------------- static void SetupRegistry() @@ -93,7 +94,7 @@ nsresult ParseData(char* anInputStream,char* anOutputStream) { if (NS_SUCCEEDED(result)) { // Create a dtd nsCOMPtr dtd; - result=NS_NewNavHTMLDTD(getter_AddRefs(dtd)); + result=nsComponentManager::CreateInstance(kNavDTDCID,nsnull,NS_GET_IID(nsIDTD),getter_AddRefs(dtd)); if(NS_SUCCEEDED(result)) { // Parse the document, having the sink write the data to fp PRFileDesc* out; diff --git a/parser/htmlparser/tests/logparse/TestParser.pl b/parser/htmlparser/tests/logparse/TestParser.pl index aefe8eb2a4f..80acc11e7c5 100644 --- a/parser/htmlparser/tests/logparse/TestParser.pl +++ b/parser/htmlparser/tests/logparse/TestParser.pl @@ -7,28 +7,25 @@ $drive=$`; - die "\nUsage: perl TestParser.pl [-b|-v|-c] - b -> creates baseline file(*.b) - v -> creates verification file (*.v) - c -> compare baseline vs verification\n" + die "\nUsage: perl TestParser.pl [-b|-v] + b -> create baseline + v -> verify changes\n" if(@ARGV < 2 || @ARGV > 2); open(FILE_LIST,$ARGV[1]) || die "\nCannot open $ARGV[1]\n"; - if($ARGV[0] eq "-b" || $ARGV[0] eq "-v") { - $ARGV[0]=~s/-//g; # create file extension for the output - + if($ARGV[0] eq "-b") { foreach $input() { @output=split(/\./,$input); - system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].$ARGV[0]"); + system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].b"); } } - elsif($ARGV[0] eq "-c") { - # use windows "fc" to compare files!!! - foreach $input() { + elsif($ARGV[0] eq "-v") { + foreach $input() { @output=split(/\./,$input); - system("fc $output[0].b $output[0].v"); + system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].v"); + system("fc $output[0].b $output[0].v"); } } else {