ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jgb

Dependencies:   mbed

Heston/Heston_test.h

Committer:
el18jgb
Date:
2020-05-24
Revision:
22:7406068f6c59
Parent:
13:cfdfe60a2327

File content as of revision 22:7406068f6c59:

#ifndef HESTON_TEST_H
#define HESTON_TEST_H
 
/** Heston class Test
 * @brief Checks to do with heston class
 * @author Jospeh Body, University of Leeds
 * @date May 2020
 * @return true if test are passed 
 */
 
bool Heston_test_initial()
{
    // Initialise
    Heston heston;
    heston.init(); //_x = 42 _y = 24

    // Read the position
    Vector2D read_pos_1 = heston.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 = false;
    
    // Fail the test if the initial position is wrong
    if (read_pos_1.x == 42 || read_pos_1.y == 24) {
        success_flag = true;
    }

    return success_flag;
}
 
#endif