projects
/
psensor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed restoration of the panel divider position.
[psensor.git]
/
tests
/
test_psensor_value_to_str.c
diff --git
a/tests/test_psensor_value_to_str.c
b/tests/test_psensor_value_to_str.c
index
2d237ea
..
5d08867
100644
(file)
--- a/
tests/test_psensor_value_to_str.c
+++ b/
tests/test_psensor_value_to_str.c
@@
-24,22
+24,24
@@
#include "../src/lib/psensor.h"
#include "../src/lib/psensor.h"
-#define CEL
C
IUS "\302\260C"
+#define CEL
S
IUS "\302\260C"
#define FAHRENHEIT "\302\260F"
static int
test_psensor_value_to_str(unsigned int type,
double value,
#define FAHRENHEIT "\302\260F"
static int
test_psensor_value_to_str(unsigned int type,
double value,
- int cel
c
ius,
+ int cel
s
ius,
const char *ref)
{
char *str;
const char *ref)
{
char *str;
- str = psensor_value_to_str(type, value, celcius);
- if (strcmp(ref, str))
+ str = psensor_value_to_str(type, value, celsius);
+ 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)
@@
-47,13
+49,13
@@
int main(int argc, char **argv)
int errs;
errs = test_psensor_value_to_str(SENSOR_TYPE_TEMP, 13, 1,
int errs;
errs = test_psensor_value_to_str(SENSOR_TYPE_TEMP, 13, 1,
- "13"CEL
C
IUS);
+ "13"CEL
S
IUS);
errs += test_psensor_value_to_str(SENSOR_TYPE_TEMP, 13, 0,
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,
errs += test_psensor_value_to_str(SENSOR_TYPE_TEMP, 13.4, 1,
- "13"CEL
C
IUS);
- errs += test_psensor_value_to_str(SENSOR_TYPE_TEMP, 13.5,
0
,
- "14"
FAHRENHEIT
);
+ "13"CEL
S
IUS);
+ errs += test_psensor_value_to_str(SENSOR_TYPE_TEMP, 13.5,
1
,
+ "14"
CELSIUS
);
if (errs)
exit(EXIT_FAILURE);
if (errs)
exit(EXIT_FAILURE);