From: Uwe Hermann Date: Tue, 19 Jun 2018 05:03:29 +0000 (+0200) Subject: tests: Fix test_analog_unit_to_string unit test. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=72cb20ed077d5226a7cbf0bc173c80f2ee9cef01;p=libsigrok.git tests: Fix test_analog_unit_to_string unit test. The loop body was never executed. --- diff --git a/tests/analog.c b/tests/analog.c index 85c6afcd..22371857 100644 --- a/tests/analog.c +++ b/tests/analog.c @@ -197,11 +197,11 @@ START_TEST(test_analog_unit_to_string) struct sr_analog_encoding encoding; struct sr_analog_meaning meaning; struct sr_analog_spec spec; - const char *r[] = {" V RMS"}; + const char *r[] = {"V RMS"}; sr_analog_init_(&analog, &encoding, &meaning, &spec, 3); - for (i = -1; i < ARRAY_SIZE(r); i++) { + for (i = 0; i < ARRAY_SIZE(r); i++) { meaning.unit = SR_UNIT_VOLT; meaning.mqflags = SR_MQFLAG_RMS; ret = sr_analog_unit_to_string(&analog, &result);