testing/sensortest: fix bug because of adding custom type

Change-Id: I69fc7881e3fa7f94b549b1a342339fe5a9ec13ab
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu 2020-11-25 12:17:18 +08:00 committed by Abdelatif Guettouche
parent eff52fefcf
commit 89376af38d

View File

@ -36,6 +36,7 @@
* Pre-processor Definitions
****************************************************************************/
#define ARRAYSIZE(a) (sizeof(a) / sizeof(a)[0])
#define DEVNAME_FMT "/dev/sensor/%s"
#define DEVNAME_MAX 64
@ -201,7 +202,7 @@ int main(int argc, FAR char *argv[])
g_should_exit = false;
name = argv[1];
for (idx = 0; idx < SENSOR_TYPE_COUNT; idx++)
for (idx = 0; idx < ARRAYSIZE(g_sensor_info); idx++)
{
if (!strncmp(name, g_sensor_info[idx].name,
strlen(g_sensor_info[idx].name)))