test: lib: Use CONFIG_64BIT to detect 64 bit compile
Should use CONFIG_64BIT to detect a 64 bit compile and not
CONFIG_PHYS_64BIT. This allows more platforms to run the
full test code.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
(cherry picked from commit 43ca65b305)
This commit is contained in:
committed by
Simon Glass
parent
c347fb4b1a
commit
86c381e54d
@@ -224,13 +224,13 @@ static int str_itoa(struct unit_test_state *uts)
|
|||||||
ut_asserteq_str("4294967295", simple_itoa(0xffffffff));
|
ut_asserteq_str("4294967295", simple_itoa(0xffffffff));
|
||||||
|
|
||||||
/* Use #ifdef here to avoid a compiler warning on 32-bit machines */
|
/* Use #ifdef here to avoid a compiler warning on 32-bit machines */
|
||||||
#ifdef CONFIG_PHYS_64BIT
|
#ifdef CONFIG_64BIT
|
||||||
if (sizeof(ulong) == 8) {
|
if (sizeof(ulong) == 8) {
|
||||||
ut_asserteq_str("9223372036854775807",
|
ut_asserteq_str("9223372036854775807",
|
||||||
simple_itoa((1UL << 63) - 1));
|
simple_itoa((1UL << 63) - 1));
|
||||||
ut_asserteq_str("18446744073709551615", simple_itoa(-1));
|
ut_asserteq_str("18446744073709551615", simple_itoa(-1));
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PHYS_64BIT */
|
#endif /* CONFIG_64BIT */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -244,13 +244,13 @@ static int str_xtoa(struct unit_test_state *uts)
|
|||||||
ut_asserteq_str("ffffffff", simple_xtoa(0xffffffff));
|
ut_asserteq_str("ffffffff", simple_xtoa(0xffffffff));
|
||||||
|
|
||||||
/* Use #ifdef here to avoid a compiler warning on 32-bit machines */
|
/* Use #ifdef here to avoid a compiler warning on 32-bit machines */
|
||||||
#ifdef CONFIG_PHYS_64BIT
|
#ifdef CONFIG_64BIT
|
||||||
if (sizeof(ulong) == 8) {
|
if (sizeof(ulong) == 8) {
|
||||||
ut_asserteq_str("7fffffffffffffff",
|
ut_asserteq_str("7fffffffffffffff",
|
||||||
simple_xtoa((1UL << 63) - 1));
|
simple_xtoa((1UL << 63) - 1));
|
||||||
ut_asserteq_str("ffffffffffffffff", simple_xtoa(-1));
|
ut_asserteq_str("ffffffffffffffff", simple_xtoa(-1));
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PHYS_64BIT */
|
#endif /* CONFIG_64BIT */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user