Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Map/map_test.h
- Revision:
- 39:dfc489594f11
- Child:
- 40:a1cdb6ab08af
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Map/map_test.h Thu May 09 01:58:36 2019 +0000 @@ -0,0 +1,26 @@ +#ifndef MAP_TEST_H +#define MAP_TEST_H + +/** Map test +@brief Check that the map generates 1s and 0s correctly without the accelerometer +@returns true if it generates values as expected, false if not +*/ + +bool map_test(){ + Map map; + map.init(); + bool passed = true; + Vector2D coord = {0,0}; //top left coord + + if (map.get_coordinate(coord) != true) { passed = false; } //test 1 + coord = {60,60}; //start area coord + if (map.get_coordinate(coord) != 0) { passed = false; } //test 2 + coord = {224,590}; //bottom right coord + if (map.get_coordinate(coord) != 1) { passed = false; } //test 3 + coord = {405,120}; //finish area coord + if (map.get_coordinate(coord) != 0) { passed = false; } //test 4 + + return passed; +} + +#endif \ No newline at end of file