From: Jean-Philippe Orsini Date: Mon, 21 Jan 2013 07:20:30 +0000 (+0000) Subject: fixed test X-Git-Tag: v0.8.0.5~178 X-Git-Url: https://git.wpitchoune.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=45fdd29cae5c689560584860b6b39531dfea18bb;p=psensor.git fixed test --- diff --git a/tests/test_psensor_value_to_str.c b/tests/test_psensor_value_to_str.c index 2d237ea..780c815 100644 --- a/tests/test_psensor_value_to_str.c +++ b/tests/test_psensor_value_to_str.c @@ -36,10 +36,12 @@ test_psensor_value_to_str(unsigned int type, char *str; str = psensor_value_to_str(type, value, celcius); - if (strcmp(ref, str)) + if (strcmp(ref, str)) { + fprintf(stderr, "returns: %s expected: %s\n", str, ref); return 1; - else + } else { return 0; + } } int main(int argc, char **argv) @@ -49,11 +51,11 @@ int main(int argc, char **argv) errs = test_psensor_value_to_str(SENSOR_TYPE_TEMP, 13, 1, "13"CELCIUS); errs += test_psensor_value_to_str(SENSOR_TYPE_TEMP, 13, 0, - "13"FAHRENHEIT); + "55"FAHRENHEIT); errs += test_psensor_value_to_str(SENSOR_TYPE_TEMP, 13.4, 1, "13"CELCIUS); - errs += test_psensor_value_to_str(SENSOR_TYPE_TEMP, 13.5, 0, - "14"FAHRENHEIT); + errs += test_psensor_value_to_str(SENSOR_TYPE_TEMP, 13.5, 1, + "14"CELCIUS); if (errs) exit(EXIT_FAILURE);