ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jgb

Dependencies:   mbed

Revision:
13:cfdfe60a2327
Child:
21:a0f3651f56c4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Spikes/Spikes_test.h	Mon May 18 15:46:04 2020 +0000
@@ -0,0 +1,32 @@
+#ifndef SPIKES_TEST_H
+#define SPIKES_TEST_H
+ 
+/** ENG Test
+ * @brief Checks that the calulate_map_movement caluclates correct map_movement
+ * @author Jospeh Body, University of Leeds
+ * @date May 2020
+ * @return true if test are passed 
+ */
+ 
+bool Spikes_test_initial()
+{
+    // Initialise
+    Spikes spikes;
+    spikes.init(); //_x = 0 _y = 0
+
+    // Read the position
+    Vector2D read_pos_1 = spikes.get_pos();
+    printf("%f, %f\n", read_pos_1.x, read_pos_1.y);
+
+    // Now check that both the position is as expected
+    bool success_flag = true;
+    
+    // Fail the test if the initial position is wrong
+    if (read_pos_1.x != 0 || read_pos_1.y != 0) {
+        success_flag = false;
+    }
+
+    return success_flag;
+}
+ 
+#endif
\ No newline at end of file