summaryrefslogtreecommitdiff
path: root/legacy/eeze
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@datenfreihafen.org>2012-09-19 12:41:31 +0000
committerStefan Schmidt <stefan@datenfreihafen.org>2012-09-19 12:41:31 +0000
commiteaa278444c2c54004f06b945d0196add2bf0d578 (patch)
treee3a9c94e54cb79b22e0eaa1f3f695e52beef2407 /legacy/eeze
parent087937b7f33ace9049bda62f91fb2446e676f95d (diff)
eeze/tests: Cover more eeze_sensor functions
Also start with testing for some error pathes by giving in wrong values. SVN revision: 76857
Diffstat (limited to 'legacy/eeze')
-rw-r--r--legacy/eeze/src/tests/eeze_suite.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/legacy/eeze/src/tests/eeze_suite.c b/legacy/eeze/src/tests/eeze_suite.c
index 1e6ac68ad9..efa18bf0a1 100644
--- a/legacy/eeze/src/tests/eeze_suite.c
+++ b/legacy/eeze/src/tests/eeze_suite.c
@@ -386,6 +386,18 @@ START_TEST(eeze_test_sensor_read)
386 rc = eeze_sensor_xyz_get(sens, &x, &y, &z); 386 rc = eeze_sensor_xyz_get(sens, &x, &y, &z);
387 fail_if(rc == EINA_FALSE); 387 fail_if(rc == EINA_FALSE);
388 388
389 /* Use gyro with xz here even if it offers xzy */
390 sens = eeze_sensor_new(EEZE_SENSOR_TYPE_GYROSCOPE);
391 fail_if(sens == NULL);
392 rc = eeze_sensor_read(sens);
393 fail_if(rc == EINA_FALSE);
394 rc = eeze_sensor_accuracy_get(sens, &acc);
395 fail_if(rc == EINA_FALSE);
396 rc = eeze_sensor_timestamp_get(sens, &timestamp);
397 fail_if(rc == EINA_FALSE);
398 rc = eeze_sensor_xy_get(sens, &x, &y);
399 fail_if(rc == EINA_FALSE);
400
389 sens = eeze_sensor_new(EEZE_SENSOR_TYPE_PROXIMITY); 401 sens = eeze_sensor_new(EEZE_SENSOR_TYPE_PROXIMITY);
390 fail_if(sens == NULL); 402 fail_if(sens == NULL);
391 rc = eeze_sensor_read(sens); 403 rc = eeze_sensor_read(sens);
@@ -408,6 +420,9 @@ START_TEST(eeze_test_sensor_read)
408 rc = eeze_sensor_x_get(sens, &x); 420 rc = eeze_sensor_x_get(sens, &x);
409 fail_if(rc == EINA_FALSE); 421 fail_if(rc == EINA_FALSE);
410 422
423 /* Call non existing type */
424 sens = eeze_sensor_new(42);
425
411 eeze_sensor_free(sens); 426 eeze_sensor_free(sens);
412 427
413 ret = eeze_shutdown(); 428 ret = eeze_shutdown();
@@ -503,6 +518,9 @@ START_TEST(eeze_test_sensor_obj_get)
503 obj = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_ACCELEROMETER); 518 obj = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_ACCELEROMETER);
504 fail_if(obj == obj_tmp); 519 fail_if(obj == obj_tmp);
505 520
521 /* Try to get non existing obj */
522 eeze_sensor_obj_get(42);
523
506 free(obj); 524 free(obj);
507 525
508 ret = eeze_shutdown(); 526 ret = eeze_shutdown();