Message ID | 20241120100157.485418-5-andrew.goodbody@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | Select CONFIG_64BIT for sandbox64 and x86_64 | expand |
On Wed, 20 Nov 2024 at 03:02, Andrew Goodbody <andrew.goodbody@linaro.org> wrote: > > 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. > > Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> > --- > > Changes in v3: > New patch added for this version. > > test/lib/str.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Simon Glass <sjg@chromium.org> > > diff --git a/test/lib/str.c b/test/lib/str.c > index 3cc9dfea6a..0505aed09d 100644 > --- a/test/lib/str.c > +++ b/test/lib/str.c > @@ -206,13 +206,13 @@ static int str_itoa(struct unit_test_state *uts) > ut_asserteq_str("4294967295", simple_itoa(0xffffffff)); > > /* Use #ifdef here to avoid a compiler warning on 32-bit machines */ > -#ifdef CONFIG_PHYS_64BIT > +#ifdef CONFIG_64BIT > if (sizeof(ulong) == 8) { > ut_asserteq_str("9223372036854775807", > simple_itoa((1UL << 63) - 1)); > ut_asserteq_str("18446744073709551615", simple_itoa(-1)); > } > -#endif /* CONFIG_PHYS_64BIT */ > +#endif /* CONFIG_64BIT */ > > return 0; > } > @@ -226,13 +226,13 @@ static int str_xtoa(struct unit_test_state *uts) > ut_asserteq_str("ffffffff", simple_xtoa(0xffffffff)); > > /* Use #ifdef here to avoid a compiler warning on 32-bit machines */ > -#ifdef CONFIG_PHYS_64BIT > +#ifdef CONFIG_64BIT > if (sizeof(ulong) == 8) { > ut_asserteq_str("7fffffffffffffff", > simple_xtoa((1UL << 63) - 1)); > ut_asserteq_str("ffffffffffffffff", simple_xtoa(-1)); > } > -#endif /* CONFIG_PHYS_64BIT */ > +#endif /* CONFIG_64BIT */ > > return 0; > } > -- > 2.39.5 >
diff --git a/test/lib/str.c b/test/lib/str.c index 3cc9dfea6a..0505aed09d 100644 --- a/test/lib/str.c +++ b/test/lib/str.c @@ -206,13 +206,13 @@ static int str_itoa(struct unit_test_state *uts) ut_asserteq_str("4294967295", simple_itoa(0xffffffff)); /* Use #ifdef here to avoid a compiler warning on 32-bit machines */ -#ifdef CONFIG_PHYS_64BIT +#ifdef CONFIG_64BIT if (sizeof(ulong) == 8) { ut_asserteq_str("9223372036854775807", simple_itoa((1UL << 63) - 1)); ut_asserteq_str("18446744073709551615", simple_itoa(-1)); } -#endif /* CONFIG_PHYS_64BIT */ +#endif /* CONFIG_64BIT */ return 0; } @@ -226,13 +226,13 @@ static int str_xtoa(struct unit_test_state *uts) ut_asserteq_str("ffffffff", simple_xtoa(0xffffffff)); /* Use #ifdef here to avoid a compiler warning on 32-bit machines */ -#ifdef CONFIG_PHYS_64BIT +#ifdef CONFIG_64BIT if (sizeof(ulong) == 8) { ut_asserteq_str("7fffffffffffffff", simple_xtoa((1UL << 63) - 1)); ut_asserteq_str("ffffffffffffffff", simple_xtoa(-1)); } -#endif /* CONFIG_PHYS_64BIT */ +#endif /* CONFIG_64BIT */ return 0; }
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. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> --- Changes in v3: New patch added for this version. test/lib/str.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)