forked from enlightenment/efl
eeze/tests: Cover more eeze_sensor functions
Also start with testing for some error pathes by giving in wrong values. SVN revision: 76857
This commit is contained in:
parent
087937b7f3
commit
eaa278444c
|
@ -386,6 +386,18 @@ START_TEST(eeze_test_sensor_read)
|
||||||
rc = eeze_sensor_xyz_get(sens, &x, &y, &z);
|
rc = eeze_sensor_xyz_get(sens, &x, &y, &z);
|
||||||
fail_if(rc == EINA_FALSE);
|
fail_if(rc == EINA_FALSE);
|
||||||
|
|
||||||
|
/* Use gyro with xz here even if it offers xzy */
|
||||||
|
sens = eeze_sensor_new(EEZE_SENSOR_TYPE_GYROSCOPE);
|
||||||
|
fail_if(sens == NULL);
|
||||||
|
rc = eeze_sensor_read(sens);
|
||||||
|
fail_if(rc == EINA_FALSE);
|
||||||
|
rc = eeze_sensor_accuracy_get(sens, &acc);
|
||||||
|
fail_if(rc == EINA_FALSE);
|
||||||
|
rc = eeze_sensor_timestamp_get(sens, ×tamp);
|
||||||
|
fail_if(rc == EINA_FALSE);
|
||||||
|
rc = eeze_sensor_xy_get(sens, &x, &y);
|
||||||
|
fail_if(rc == EINA_FALSE);
|
||||||
|
|
||||||
sens = eeze_sensor_new(EEZE_SENSOR_TYPE_PROXIMITY);
|
sens = eeze_sensor_new(EEZE_SENSOR_TYPE_PROXIMITY);
|
||||||
fail_if(sens == NULL);
|
fail_if(sens == NULL);
|
||||||
rc = eeze_sensor_read(sens);
|
rc = eeze_sensor_read(sens);
|
||||||
|
@ -408,6 +420,9 @@ START_TEST(eeze_test_sensor_read)
|
||||||
rc = eeze_sensor_x_get(sens, &x);
|
rc = eeze_sensor_x_get(sens, &x);
|
||||||
fail_if(rc == EINA_FALSE);
|
fail_if(rc == EINA_FALSE);
|
||||||
|
|
||||||
|
/* Call non existing type */
|
||||||
|
sens = eeze_sensor_new(42);
|
||||||
|
|
||||||
eeze_sensor_free(sens);
|
eeze_sensor_free(sens);
|
||||||
|
|
||||||
ret = eeze_shutdown();
|
ret = eeze_shutdown();
|
||||||
|
@ -503,6 +518,9 @@ START_TEST(eeze_test_sensor_obj_get)
|
||||||
obj = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_ACCELEROMETER);
|
obj = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_ACCELEROMETER);
|
||||||
fail_if(obj == obj_tmp);
|
fail_if(obj == obj_tmp);
|
||||||
|
|
||||||
|
/* Try to get non existing obj */
|
||||||
|
eeze_sensor_obj_get(42);
|
||||||
|
|
||||||
free(obj);
|
free(obj);
|
||||||
|
|
||||||
ret = eeze_shutdown();
|
ret = eeze_shutdown();
|
||||||
|
|
Loading…
Reference in New Issue