Change in libosmocore[master]: tests: Fix tdef_test on 32bit platforms

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Nov 15 22:34:46 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/21162 )

Change subject: tests: Fix tdef_test on 32bit platforms
......................................................................

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
---
M tests/tdef/tdef_test.c
M tests/tdef/tdef_test.ok
2 files changed, 9 insertions(+), 9 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/tests/tdef/tdef_test.c b/tests/tdef/tdef_test.c
index d874231..ede3082 100644
--- a/tests/tdef/tdef_test.c
+++ b/tests/tdef/tdef_test.c
@@ -38,7 +38,7 @@
 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 1770968..4c97dab 100644
--- a/tests/tdef/tdef_test.ok
+++ b/tests/tdef/tdef_test.ok
@@ -12,12 +12,12 @@
 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 @@
 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 @@
 - 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

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21162
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ic0d009f00a69cee59f2d3fc0b40ecdc97d81c75c
Gerrit-Change-Number: 21162
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201115/f59dec32/attachment.htm>


More information about the gerrit-log mailing list