projects
/
psensor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3f4fc88
)
fixed test
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Mon, 21 Jan 2013 07:20:30 +0000
(07:20 +0000)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Mon, 21 Jan 2013 07:20:30 +0000
(07:20 +0000)
tests/test_psensor_value_to_str.c
patch
|
blob
|
history
diff --git
a/tests/test_psensor_value_to_str.c
b/tests/test_psensor_value_to_str.c
index
2d237ea
..
780c815
100644
(file)
--- 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);
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;
return 1;
- else
+ } else {
return 0;
return 0;
+ }
}
int main(int argc, char **argv)
}
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,
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.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);
if (errs)
exit(EXIT_FAILURE);