TEST_F(SENSOR_API, GetBackendP)
{
+ SKIP_NO_FEATURE();
+
int ret_val;
ret_val = hal_sensor_get_backend();
EXPECT_EQ(ret_val, 0) << strerr("Failed to get sensor device", ret_val);
TEST_F(SENSOR_API, CreateP)
{
+ SKIP_NO_FEATURE();
+
int ret_val;
void **devices;
ret_val = hal_sensor_create(&devices);
int SENSOR_DEV::device_count = 0;
device_registry_t SENSOR_DEV::devices;
+#define SKIP_NO_FEATURE() \
+ if (!check_feature_all()) { \
+ return; \
+ }
+
#define SKIP_NO_DEV() \
if (device_count <= 0) { \
SKIP_MESSAGE("There is no sensor devices."); \
TEST_F(SENSOR_DEV, get_poll_fdP)
{
+ SKIP_NO_FEATURE()
SKIP_NO_DEV()
for (auto it = devices.begin(); it != devices.end(); ++it) {
const sensor_info_t *sensors = nullptr;
int ret_func;
+ SKIP_NO_FEATURE()
SKIP_NO_DEV()
for (auto it = devices.begin(); it != devices.end(); ++it) {
TEST_F(SENSOR_DEV, get_sensorsN)
{
+ SKIP_NO_FEATURE()
SKIP_NO_DEV()
for (auto it = devices.begin(); it != devices.end(); ++it) {
sensor_data_t *data = NULL;
const sensor_info_t *sensors = nullptr;
+ SKIP_NO_FEATURE()
SKIP_NO_DEV()
for (auto it = devices.begin(); it != devices.end(); ++it) {
int length = 0;
sensor_data_t *data = NULL;
+ SKIP_NO_FEATURE()
SKIP_NO_DEV()
for (auto it = devices.begin(); it != devices.end(); ++it) {
#include <string.h>
#if (GTEST_VERSION_MAJOR < 1 || (GTEST_VERSION_MAJOR == 1 && GTEST_VERSION_MINOR < 10))
+#define GTEST_SKIP() ;
// hack gtest internal for print message
namespace testing
{
testing::internal::ColoredPrintf(testing::internal::COLOR_DEFAULT, "\n"); \
} while (0)
+#define SKIP_NO_FEATURE() \
+ if (!check_feature_all()) { \
+ return; \
+ }
+
// SetUp/TearDown function for a testsuite differ by gtest version
#if (GTEST_VERSION_MAJOR >= 2 || (GTEST_VERSION_MAJOR == 1 && GTEST_VERSION_MINOR >= 10))
#define SetUpHalTestSuite SetUpTestSuite