Author: janderwald Date: Sat Jul 14 14:24:02 2007 New Revision: 27647
URL: http://svn.reactos.org/svn/reactos?rev=27647&view=rev Log: - fix command line handlung - fix configuration and file parser - remove hack
Modified: trunk/reactos/tools/sysreg/conf_parser.cpp trunk/reactos/tools/sysreg/file_reader.cpp trunk/reactos/tools/sysreg/sysreg.cpp
Modified: trunk/reactos/tools/sysreg/conf_parser.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/conf_parser.cp... ============================================================================== --- trunk/reactos/tools/sysreg/conf_parser.cpp (original) +++ trunk/reactos/tools/sysreg/conf_parser.cpp Sat Jul 14 14:24:02 2007 @@ -16,7 +16,6 @@ namespace Sysreg_ { using std::ifstream; - extern "C" FILE * open(char * filename, char* filemode); //--------------------------------------------------------------------------------------- ConfigParser::ConfigParser() { @@ -36,14 +35,13 @@ #ifdef UNICODE file = _tfopen(FileName, _T("rt,ccs=UNICODE")); #else - file = open(FileName, "rt"); + file = fopen(FileName, "rt"); #endif if (!file) { cerr << "Error: ConfigParser::parseFile failed to open configuration file " << FileName << endl; return false; } - bool ret = false; while (!feof(file)) {
Modified: trunk/reactos/tools/sysreg/file_reader.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/file_reader.cp... ============================================================================== --- trunk/reactos/tools/sysreg/file_reader.cpp (original) +++ trunk/reactos/tools/sysreg/file_reader.cpp Sat Jul 14 14:24:02 2007 @@ -12,7 +12,6 @@ #include <cstdio> namespace System_ { - extern "C" FILE * open(char * filename, char* filemode); //--------------------------------------------------------------------------------------- FileReader::FileReader() : DataSource(), m_File(NULL) { @@ -27,7 +26,7 @@ #ifdef UNICODE m_File = (FILE*)_tfopen(filename.c_str(), _T("rb,ccs=UNICODE")); #else - m_File = open((char*)filename.c_str(), (char*)"rb"); + m_File = fopen((char*)filename.c_str(), (char*)"rb"); #endif
if (m_File)
Modified: trunk/reactos/tools/sysreg/sysreg.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/sysreg.cpp?rev... ============================================================================== --- trunk/reactos/tools/sysreg/sysreg.cpp (original) +++ trunk/reactos/tools/sysreg/sysreg.cpp Sat Jul 14 14:24:02 2007 @@ -23,7 +23,7 @@ #endif
static const TCHAR USAGE[] = -_T("sysreg.exe -l | [conf_file] <testname>\n\n-l - list available tests\nconf_file - (optional) path to a configuration file (default: sysreg.cfg)\ntest_name - name of test to execute\n"); +_T("sysreg.exe [conf_file]\nconfiguration file (default: sysreg.cfg)");
@@ -33,9 +33,8 @@ ConfigParser config; TCHAR DefaultConfig[] = _T("sysreg.cfg"); TCHAR *ConfigFile; - TCHAR * TestName;
- if ((argc != 3) && (argc != 2)) + if ((argc >= 2)) { cerr << USAGE << endl; return -1; @@ -45,13 +44,11 @@
if (argc == 2) { - ConfigFile = DefaultConfig; - TestName = argv[1]; + ConfigFile = argv[1]; } else { - ConfigFile = argv[1]; - TestName = argv[2]; + ConfigFile = DefaultConfig; }
@@ -64,7 +61,7 @@ RosBootTest * regtest = new RosBootTest(); if (!regtest) { - cerr << "Error: the requested regression test does not exist" << endl; + cerr << "Error: failed to create regression test" << endl; return -1; }