Correct runtest so it passes the correct line length
parent
a5aefed2bf
commit
d96eec6697
|
|
@ -160,13 +160,16 @@ void RunTest(const char* infile)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Tle::IsValidLine(line, 1);
|
if (line.length() >= Tle::GetLineLength())
|
||||||
|
{
|
||||||
|
Tle::IsValidLine(line.substr(0, Tle::GetLineLength()), 1);
|
||||||
/*
|
/*
|
||||||
* store line and now read in second line
|
* store line and now read in second line
|
||||||
*/
|
*/
|
||||||
got_first_line = true;
|
got_first_line = true;
|
||||||
line1 = line;
|
line1 = line;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (TleException& e)
|
catch (TleException& e)
|
||||||
{
|
{
|
||||||
std::cerr << "Error: " << e.what() << std::endl;
|
std::cerr << "Error: " << e.what() << std::endl;
|
||||||
|
|
@ -183,14 +186,15 @@ void RunTest(const char* infile)
|
||||||
* split line, first 69 is the second line of the tle
|
* split line, first 69 is the second line of the tle
|
||||||
* the rest is the test parameters, if there is any
|
* the rest is the test parameters, if there is any
|
||||||
*/
|
*/
|
||||||
line2 = line.substr(0, 69);
|
line2 = line.substr(0, Tle::GetLineLength());
|
||||||
double start = 0.0;
|
double start = 0.0;
|
||||||
double end = 1440.0;
|
double end = 1440.0;
|
||||||
double inc = 120.0;
|
double inc = 120.0;
|
||||||
if (line.length() > 69)
|
if (line.length() > 69)
|
||||||
{
|
{
|
||||||
std::vector<std::string> tokens;
|
std::vector<std::string> tokens;
|
||||||
parameters = line.substr(70, line.length() - 69);
|
parameters = line.substr(Tle::GetLineLength() + 1,
|
||||||
|
line.length() - Tle::GetLineLength());
|
||||||
tokenize(parameters, tokens);
|
tokenize(parameters, tokens);
|
||||||
if (tokens.size() >= 3)
|
if (tokens.size() >= 3)
|
||||||
{
|
{
|
||||||
|
|
@ -205,10 +209,13 @@ void RunTest(const char* infile)
|
||||||
*/
|
*/
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Tle::IsValidLine(line2, 2);
|
if (line.length() >= Tle::GetLineLength())
|
||||||
|
{
|
||||||
|
Tle::IsValidLine(line.substr(0, Tle::GetLineLength()), 2);
|
||||||
Tle tle("Test", line1, line2);
|
Tle tle("Test", line1, line2);
|
||||||
RunTle(tle, start, end, inc);
|
RunTle(tle, start, end, inc);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (TleException& e)
|
catch (TleException& e)
|
||||||
{
|
{
|
||||||
std::cerr << "Error: " << e.what() << std::endl;
|
std::cerr << "Error: " << e.what() << std::endl;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue