aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tdef
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-11-15 17:52:09 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-11-15 18:01:51 +0100
commite81c2f44f32a49478a7b6d696ae0830b73116ec0 (patch)
treef5bc4b0f5b486c0090fd652cabe95571ec436880 /tests/tdef
parent2299cb52a3619ea9bec49b8b231fa029fcadd76b (diff)
tests: Fix tdef_test on 32bit platforms
100 minutes = 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: Ic0d009f00a69cee59f2d3fc0b40ecdc97d81c75c
Diffstat (limited to 'tests/tdef')
-rw-r--r--tests/tdef/tdef_test.c2
-rw-r--r--tests/tdef/tdef_test.ok16
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/tdef/tdef_test.c b/tests/tdef/tdef_test.c
index d874231a..ede3082e 100644
--- a/tests/tdef/tdef_test.c
+++ b/tests/tdef/tdef_test.c
@@ -38,7 +38,7 @@ static void *ctx = NULL;
static struct osmo_tdef tdefs[] = {
{ .T=1, .default_val=100, .desc="100s" },
{ .T=2, .default_val=100, .unit=OSMO_TDEF_MS, .desc="100ms" },
- { .T=3, .default_val=100, .unit=OSMO_TDEF_M, .desc="100m" },
+ { .T=3, .default_val=50, .unit=OSMO_TDEF_M, .desc="50m" },
{ .T=4, .default_val=100, .unit=OSMO_TDEF_CUSTOM, .desc="100 potatoes" },
{ .T=7, .default_val=50, .desc="Water Boiling Timeout", .min_val=20, .max_val=800 }, // default is .unit=OSMO_TDEF_S == 0
diff --git a/tests/tdef/tdef_test.ok b/tests/tdef/tdef_test.ok
index 1770968d..4c97dabb 100644
--- a/tests/tdef/tdef_test.ok
+++ b/tests/tdef/tdef_test.ok
@@ -12,12 +12,12 @@ osmo_tdef_get(2, ms) = 100
osmo_tdef_get(2, m) = 1
osmo_tdef_get(2, custom-unit) = 100
osmo_tdef_get(2, us) = 100000
-T3=100m
-osmo_tdef_get(3, s) = 6000
-osmo_tdef_get(3, ms) = 6000000
-osmo_tdef_get(3, m) = 100
-osmo_tdef_get(3, custom-unit) = 100
-osmo_tdef_get(3, us) = 6000000000
+T3=50m
+osmo_tdef_get(3, s) = 3000
+osmo_tdef_get(3, ms) = 3000000
+osmo_tdef_get(3, m) = 50
+osmo_tdef_get(3, custom-unit) = 50
+osmo_tdef_get(3, us) = 3000000000
T4=100custom-unit
osmo_tdef_get(4, s) = 100
osmo_tdef_get(4, ms) = 100
@@ -154,7 +154,7 @@ test_tdef_state_timeout()
state=A T=0, no timeout
--> A (configured as T1 100 s) rc=0; state=A T=1, 100.000000 s remaining
--> B (configured as T2 100 ms) rc=0; state=B T=2, 1.000000 s remaining
- --> C (configured as T3 100 m) rc=0; state=C T=3, 6000.000000 s remaining
+ --> C (configured as T3 50 m) rc=0; state=C T=3, 3000.000000 s remaining
--> D (configured as T4 100 custom-unit) rc=0; state=D T=4, 100.000000 s remaining
--> G (configured as T7 50 s) rc=0; state=G T=7, 50.000000 s remaining
--> H (configured as T8 300 s) rc=0; state=H T=8, 300.000000 s remaining
@@ -183,5 +183,5 @@ state=A T=1, 76.954322 s remaining
- test disallowed transition:
--> Z (no timer configured for this state) rc=0; state=Z T=0, no timeout
--> B (configured as T2 100 ms) rc=-1; state=Z T=0, no timeout
- --> C (configured as T3 100 m) rc=-1; state=Z T=0, no timeout
+ --> C (configured as T3 50 m) rc=-1; state=Z T=0, no timeout
--> D (configured as T4 100 custom-unit) rc=-1; state=Z T=0, no timeout