- g_assert(location.latitude().toString() == "-23.86600833");
- g_assert(location.gpsTime().toString() == "1050585131");
-
- location.parse("GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47");
-
- DebugOut(0)<<"alt: "<<location.altitude().toString()<<endl;
- DebugOut(0)<<"lat: "<<location.latitude().toString()<<endl;
- g_assert(location.altitude().toString() == "545.4");
- g_assert(location.latitude().toString() == "48.1173");
-
- location.parse("GPRMC,060136.00,A,3101.40475,N,12126.87095,E,0.760,,160114,,,A*74");
- DebugOut(0)<<"lon: "<<location.longitude().toString()<<endl;
- DebugOut(0)<<"lat: "<<location.latitude().toString()<<endl;
-
- //Test incomplete message:
- location.parse("GPRMC,023633.00,V,,,,,,,180314,,,N*75");
- DebugOut(0)<<"lon: "<<location.longitude().toString()<<endl;
- DebugOut(0)<<"lat: "<<location.latitude().toString()<<endl;
-
- std::string testChecksuming = "GPRMC,195617.00,V,,,,,,,310314,,,N*74";
-
- g_assert(checksum(testChecksuming));
-
- std::string multimessage1 = "GA,235320.00,4532.48633,N,12257.";
- std::string multimessage2 = "57383,W,";
- std::string multimessage3 = "1,03,7.53,51.6,M,-21.3,M,,*55";
- std::string multimessage4 = "GPGSA,A,";
- std::string multimessage5 = "2,27,23,19,,,,,,,,,,7.60";
- std::string multimessage6 = ",7.53,1.00*0E";
- bool multimessageParse = false;
-
- multimessageParse |= tryParse(multimessage1);
- multimessageParse |= tryParse(multimessage2);
- multimessageParse |= tryParse(multimessage3);
- multimessageParse |= tryParse(multimessage4);
- multimessageParse |= tryParse(multimessage5);
- multimessageParse |= tryParse(multimessage6);
-
- g_assert(multimessageParse);
-
- }