aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tdef
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-11-12 14:00:08 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-11-12 14:00:10 +0100
commitaf10e48c1bf7ec40678b9a4387fc50ab0846b467 (patch)
treeb2eb65321cfd29623e1862519af25cc85df6710f /tests/tdef
parentc2118940aaf15967ec33061a40b50f4a6e2f0ecf (diff)
tests: Fix tdef_test on 32bit platforms
60 seconds = 6000000000 microseconds was too big to be stored in an unsigned long in a 32bit platform, making the test print 4294967295 instead. Let's set a smaller value to have the test happy on 32 bits. Change-Id: I97d53f6b7b410cef4b3f3fbe3162626fcdd7b05a
Diffstat (limited to 'tests/tdef')
-rw-r--r--tests/tdef/tdef_test.c2
-rw-r--r--tests/tdef/tdef_test.ok10
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/tdef/tdef_test.c b/tests/tdef/tdef_test.c
index d874231a..17fd4e5a 100644
--- a/tests/tdef/tdef_test.c
+++ b/tests/tdef/tdef_test.c
@@ -48,7 +48,7 @@ static struct osmo_tdef tdefs[] = {
/* test conversions */
{ .T=1000, .default_val=2*1000, .unit=OSMO_TDEF_MS, .desc="two seconds from ms" },
- { .T=1001, .default_val=60*1000, .unit=OSMO_TDEF_MS, .desc="one minute from ms" },
+ { .T=1001, .default_val=30*1000, .unit=OSMO_TDEF_MS, .desc="half minute from ms" },
{ .T=1004, .default_val=1, .unit=OSMO_TDEF_MS, .desc="one ms" },
{ .T=1005, .default_val=0, .unit=OSMO_TDEF_MS, .desc="zero ms" },
{ .T=1006, .default_val=0, .unit=OSMO_TDEF_S, .desc="zero s" },
diff --git a/tests/tdef/tdef_test.ok b/tests/tdef/tdef_test.ok
index 1770968d..4bdd3d0b 100644
--- a/tests/tdef/tdef_test.ok
+++ b/tests/tdef/tdef_test.ok
@@ -54,12 +54,12 @@ osmo_tdef_get(1000, ms) = 2000
osmo_tdef_get(1000, m) = 1
osmo_tdef_get(1000, custom-unit) = 2000
osmo_tdef_get(1000, us) = 2000000
-T1001=60000ms
-osmo_tdef_get(1001, s) = 60
-osmo_tdef_get(1001, ms) = 60000
+T1001=30000ms
+osmo_tdef_get(1001, s) = 30
+osmo_tdef_get(1001, ms) = 30000
osmo_tdef_get(1001, m) = 1
-osmo_tdef_get(1001, custom-unit) = 60000
-osmo_tdef_get(1001, us) = 60000000
+osmo_tdef_get(1001, custom-unit) = 30000
+osmo_tdef_get(1001, us) = 30000000
T1004=1ms
osmo_tdef_get(1004, s) = 1
osmo_tdef_get(1004, ms) = 1