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:
Stefan Schmidt 2012-09-19 12:41:31 +00:00
parent 087937b7f3
commit eaa278444c
1 changed files with 18 additions and 0 deletions

View File

@ -386,6 +386,18 @@ START_TEST(eeze_test_sensor_read)
rc = eeze_sensor_xyz_get(sens, &x, &y, &z);
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, &timestamp);
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);
fail_if(sens == NULL);
rc = eeze_sensor_read(sens);
@ -408,6 +420,9 @@ START_TEST(eeze_test_sensor_read)
rc = eeze_sensor_x_get(sens, &x);
fail_if(rc == EINA_FALSE);
/* Call non existing type */
sens = eeze_sensor_new(42);
eeze_sensor_free(sens);
ret = eeze_shutdown();
@ -503,6 +518,9 @@ START_TEST(eeze_test_sensor_obj_get)
obj = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_ACCELEROMETER);
fail_if(obj == obj_tmp);
/* Try to get non existing obj */
eeze_sensor_obj_get(42);
free(obj);
ret = eeze_shutdown();