James Cummins / Mbed 2 deprecated el17jnc

Dependencies:   mbed

Revision:
40:a1cdb6ab08af
Parent:
39:dfc489594f11
--- a/Map/map_test.h	Thu May 09 01:58:36 2019 +0000
+++ b/Map/map_test.h	Thu May 09 10:52:00 2019 +0000
@@ -11,15 +11,23 @@
     map.init();
     bool passed = true;
     Vector2D coord = {0,0};     //top left coord
+    printf("Running...\n");
     
-    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
+    int pixel = map.get_coordinate(coord);
+    printf("1st pixel = %d\n", pixel);
+    if (pixel != 1) {      //test 1 - test what should be a black pixel
+        passed = false;
+        printf("Coord 1 failed\n");
+        }
+    coord.x = 60;        //start area coord
+    coord.y = 60;
     
+    pixel = map.get_coordinate(coord);
+    printf("2nd pixel = %d\n", pixel);
+    if (pixel != 0) {         //test 2 - test what should be a white pixel
+        passed = false;
+        printf("Coord 2 failed\n");
+        }
     return passed;
 }