Lines Matching full:data

22 	struct sensor_value data;  member
27 struct sensor_value data; member
109 struct sensor_value data; in ZTEST() local
119 &data), RETURN_SUCCESS, "fail to get channel"); in ZTEST()
120 zassert_equal(data.val1, chan_elements[0].data.val1, in ZTEST()
121 "the data does not match"); in ZTEST()
122 zassert_equal(data.val2, chan_elements[0].data.val2, in ZTEST()
123 "the data does not match"); in ZTEST()
131 &data), RETURN_SUCCESS, "fail to get channel"); in ZTEST()
132 zassert_equal(data.val1, chan_elements[i].data.val1, in ZTEST()
133 "the data does not match"); in ZTEST()
134 zassert_equal(data.val2, chan_elements[i].data.val2, in ZTEST()
135 "the data does not match"); in ZTEST()
138 /* Get data with invalid channel. */ in ZTEST()
140 &data), RETURN_SUCCESS, "should fail for invalid channel"); in ZTEST()
177 * -# Handle different types of triggers, based on time, data,threshold,
196 struct sensor_value data; in ZTEST() local
211 &trigger_elements[i].data), in ZTEST()
218 &data), in ZTEST()
220 zassert_equal(trigger_elements[i].data.val1, in ZTEST()
221 data.val1, "read-back returned wrong val1"); in ZTEST()
222 zassert_equal(trigger_elements[i].data.val2, in ZTEST()
223 data.val2, "read-back returned wrong val2"); in ZTEST()
235 &data), RETURN_SUCCESS, "fail to get channel"); in ZTEST()
238 zassert_equal(data.val1, trigger_elements[i].data.val1, in ZTEST()
239 "retrieved data does not match"); in ZTEST()
240 zassert_equal(data.val2, trigger_elements[i].data.val2, in ZTEST()
241 "retrieved data does not match"); in ZTEST()
247 &trigger_elements[i].data), in ZTEST()
254 &data), in ZTEST()
276 struct sensor_value data; in ZTEST() local
279 sensor_g_to_ms2(1, &data); in ZTEST()
280 zassert_equal(data.val1, SENSOR_G/1000000LL, in ZTEST()
281 "the data does not match"); in ZTEST()
282 zassert_equal(data.val2, SENSOR_G%(data.val1 * 1000000LL), in ZTEST()
283 "the data does not match"); in ZTEST()
284 zassert_equal(sensor_ms2_to_g(&data), 1, in ZTEST()
285 "the data does not match"); in ZTEST()
286 /* set test data to negative value */ in ZTEST()
287 data.val1 = -data.val1; in ZTEST()
288 data.val2 = -data.val2; in ZTEST()
289 zassert_equal(sensor_ms2_to_g(&data), -1, in ZTEST()
290 "the data does not match"); in ZTEST()
293 sensor_degrees_to_rad(180, &data); in ZTEST()
294 zassert_equal(data.val1, SENSOR_PI/1000000LL, in ZTEST()
295 "the data does not match"); in ZTEST()
296 zassert_equal(data.val2, SENSOR_PI%(data.val1 * 1000000LL), in ZTEST()
297 "the data does not match"); in ZTEST()
298 zassert_equal(sensor_rad_to_degrees(&data), 180, in ZTEST()
299 "the data does not match"); in ZTEST()
300 /* set test data to negative value */ in ZTEST()
301 data.val1 = -data.val1; in ZTEST()
302 data.val2 = -data.val2; in ZTEST()
303 zassert_equal(sensor_rad_to_degrees(&data), -180, in ZTEST()
304 "the data does not match"); in ZTEST()
306 /* reset test data to positive value */ in ZTEST()
307 data.val1 = -data.val1; in ZTEST()
308 data.val2 = -data.val2; in ZTEST()
311 zassert_equal((long long)(sensor_value_to_double(&data) * 1000000LL), in ZTEST()
312 SENSOR_PI, "the data does not match"); in ZTEST()
313 zassert_equal((long long)(sensor_value_to_float(&data) * 1000000LL), in ZTEST()
314 SENSOR_PI, "the data does not match"); in ZTEST()
317 sensor_value_from_double(&data, (double)(SENSOR_PI) / 1000000.0); in ZTEST()
318 zassert_equal(data.val1, SENSOR_PI/1000000LL, in ZTEST()
319 "the data does not match"); in ZTEST()
320 zassert_equal(data.val2, SENSOR_PI%(data.val1 * 1000000LL), in ZTEST()
321 "the data does not match"); in ZTEST()
323 sensor_value_from_float(&data, (float)(SENSOR_PI) / 1000000.0f); in ZTEST()
324 zassert_equal(data.val1, SENSOR_PI/1000000LL, in ZTEST()
325 "the data does not match"); in ZTEST()
326 zassert_equal(data.val2, SENSOR_PI%(data.val1 * 1000000LL), in ZTEST()
327 "the data does not match"); in ZTEST()
329 /* reset test data to positive value */ in ZTEST()
330 data.val1 = 3; in ZTEST()
331 data.val2 = 300000; in ZTEST()
332 zassert_equal(sensor_value_to_milli(&data), 3300LL, in ZTEST()
334 zassert_equal(sensor_value_to_micro(&data), 3300000LL, in ZTEST()
336 /* reset test data to negative value */ in ZTEST()
337 data.val1 = -data.val1; in ZTEST()
338 data.val2 = -data.val2; in ZTEST()
339 zassert_equal(sensor_value_to_milli(&data), -3300LL, in ZTEST()
341 zassert_equal(sensor_value_to_micro(&data), -3300000LL, in ZTEST()
344 data.val1 = 5432109; in ZTEST()
345 data.val2 = 876543; in ZTEST()
346 zassert_equal(sensor_value_to_milli(&data), 5432109876LL, in ZTEST()
348 zassert_equal(sensor_value_to_micro(&data), 5432109876543LL, in ZTEST()