diff --git a/src/mobility/helper/ns2-mobility-helper.cc b/src/mobility/helper/ns2-mobility-helper.cc index bc1bdc5c4..13a56f09b 100644 --- a/src/mobility/helper/ns2-mobility-helper.cc +++ b/src/mobility/helper/ns2-mobility-helper.cc @@ -353,6 +353,10 @@ ParseNs2Line (const string& str) { string x; s >> x; + if (x.length () == 0) + { + continue; + } ret.tokens.push_back (x); int ii (0); double d (0); diff --git a/src/mobility/test/ns2-mobility-helper-test-suite.cc b/src/mobility/test/ns2-mobility-helper-test-suite.cc index 598a88821..8baa78f0c 100644 --- a/src/mobility/test/ns2-mobility-helper-test-suite.cc +++ b/src/mobility/test/ns2-mobility-helper-test-suite.cc @@ -432,6 +432,13 @@ public: t->AddReferencePoint ("0", 6, Vector (0, 5, 0), Vector (0, -1, 0)); t->AddReferencePoint ("0", 16, Vector (0, -10, 0), Vector (0, 0, 0)); AddTestCase (t); + t = new Ns2MobilityHelperTest ("Bug 1059 testcase", Seconds (16)); + t->SetTrace ("$node_(0) set X_ 10.0\r\n" + "$node_(0) set Y_ 0.0\r\n" + ); + // id t position velocity + t->AddReferencePoint ("0", 0, Vector (10, 0, 0), Vector (0, 0, 0)); + AddTestCase (t); } } g_ns2TransmobilityHelperTestSuite;