Fixed the negative test and made the input file name the comand line argument

git-svn-id: http://svn.code.sf.net/p/utfcpp/code@88 a809a056-fc17-0410-9590-b4f493f8b08e

Conflicts:
	v2_0/test_drivers/runtests.pl
This commit is contained in:
ntrifunovic 2009-07-02 23:56:52 +00:00 committed by King_DuckZ
parent 1976a0584c
commit a57cc04c75
2 changed files with 11 additions and 5 deletions

View file

@ -7,16 +7,22 @@ using namespace utf8;
#include <algorithm>
using namespace std;
const char* TEST_FILE_PATH = "../../../test_data/negative/utf8_invalid.txt";
const unsigned INVALID_LINES[] = { 75, 76, 82, 83, 84, 85, 93, 102, 103, 105, 106, 107, 108, 109, 110, 114, 115, 116, 117, 124, 125, 130, 135, 140, 145, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 169, 175, 176, 177, 207, 208, 209, 210, 211, 220, 221, 222, 223, 224, 232, 233, 234, 235, 236, 247, 248, 249, 250, 251, 252, 253, 257, 258, 259, 260, 261, 262, 263, 264, 268, 269};
const unsigned* INVALID_LINES_END = INVALID_LINES + sizeof(INVALID_LINES)/sizeof(unsigned);
int main()
int main(int argc, char** argv)
{
string test_file_path;
if (argc == 2)
test_file_path = argv[1];
else {
cout << "Wrong number of arguments" << endl;
exit(0);
}
// Open the test file
ifstream fs8(TEST_FILE_PATH);
ifstream fs8(test_file_path.c_str());
if (!fs8.is_open()) {
cout << "Could not open " << TEST_FILE_PATH << endl;
cout << "Could not open " << test_file_path << endl;
return 0;
}

View file

@ -33,7 +33,7 @@ print REPORT "\n";
print REPORT "==================Negative Test ==================\n";
close($report_name);
chdir 'negative';
`./negative >> ../$report_name`;
`./negative ../../test_data/negative/utf8_invalid.txt >> ../$report_name`;
chdir '..';
die if !open(REPORT, ">>$report_name");
print REPORT "==================End of negative test==================\n";