From: Uwe Hermann Date: Tue, 19 Jun 2018 05:22:12 +0000 (+0200) Subject: tests: Expand test_analog_unit_to_string unit test. X-Git-Url: http://sigrok.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=32054b0963b84dca07c088d526b7f7936b73ac10;p=libsigrok.git tests: Expand test_analog_unit_to_string unit test. --- diff --git a/tests/analog.c b/tests/analog.c index 22371857..98d55b1c 100644 --- a/tests/analog.c +++ b/tests/analog.c @@ -197,13 +197,15 @@ 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 int u[] = {SR_UNIT_VOLT, SR_UNIT_AMPERE, SR_UNIT_CELSIUS}; + const int f[] = {SR_MQFLAG_RMS, 0, 0}; + const char *r[] = {"V RMS", "A", "°C"}; sr_analog_init_(&analog, &encoding, &meaning, &spec, 3); for (i = 0; i < ARRAY_SIZE(r); i++) { - meaning.unit = SR_UNIT_VOLT; - meaning.mqflags = SR_MQFLAG_RMS; + meaning.unit = u[i]; + meaning.mqflags = f[i]; ret = sr_analog_unit_to_string(&analog, &result); fail_unless(ret == SR_OK); fail_unless(result != NULL);