ColinPitrat / kalenji-gps-watch-reader

A tool to import data from some Kalenji running watches
GNU General Public License v3.0
30 stars 11 forks source link

Google map dev #68

Closed MarioTrentini closed 6 years ago

MarioTrentini commented 6 years ago

Hello,

I recently got a GPS watch and have been using your program (thanks by the way).

Please, find some suggestions on the Google Map generation.

Comments are welcomed.

Thanks

ColinPitrat commented 6 years ago

Actually, the tests (integrated test case 6) are failing with the following:

/usr/include/c++/4.8/debug/safe_iterator.h:264:
Error: attempt to dereference a past-the-end iterator.
Objects involved in the operation:
    iterator "this" @ 0x0x4e3ee0 {
      type = Segmentation fault (core dumped)

This may well come from the following line when there are lest than 10 points (dereferencing end()):

+         it = std::prev(speedList.end(), pointCnt/10);

You could simply replace it by 1+pointCnt/10, verifying before that that you have more than one point !

A very nice thing would be to split the GoogleMap::dumpContent method and to write unit tests to verify the part generating the array of points. But I totally understand if you don't want to do it :-)

ColinPitrat commented 6 years ago

OK, the test is still failing but this is now due to your change: the expected output needs to be changed. I'll handle it.

Thanks for the contribution ! Do not hesitate if you have other ideas.

MarioTrentini commented 6 years ago

With my latest changes the integrated tests don't segfault anymore but, they fail since the new html outputs are different from the references. Should I push a commit updating the references myself ? By the way, it seems the integration tests are missing a test with laps. I would rather add that first (it would have detected the print of the pointer instead of the lap count).

ColinPitrat commented 6 years ago

You can fix the tests and add laps (or add the HTML output in another case that has laps) in another PR if you wish. Otherwise, I can handle it.

MarioTrentini commented 6 years ago

OK, thanks. I have actually other ideas (a friend suggested me to add slope statistics). And I have to push improvements for my watch...