osmo-pcu/tests
Pau Espin 5fc6e010a5 llc_queue::{dequeue,enqueue}() refactor
As seen in OS#4420, setting the MetaInfo.recv_time outside of
llc_queue before calling llc_queue::enqueue() and later on using that
value in llc_queue itself at dequeue time is not a good idea, since it
can provoke errors if the recv_time was not set correctly.
For instance, LlcTest was not setting the value for recv_time on some
test, which ended up with a huge millisec value when substracting now()
from it:
"""
llc.cpp:215:29: runtime error: signed integer overflow: 1582738663 * 1000 cannot be represented in type 'long int'
"""
This issue only appeared when started building on a raspberrypi4.

Let's better set/store the MetaInfo.recv_time internally during
llc_queue::enqueue(). Then, enqueue() only needs the
MetaInfo.expire_time, so let's change its arg list to only receive that
to avoid confusions.

Take the chance to move the llc_queue APIs to use osmo_gettimeofday,
since we need to fake the time now that the API itself sets that time.

Also take the chance during this refactor to disallow passing null
pointer by default since no user needs that.

Finally, update the LlcTest accordingly with all API/behavior changes.

Related: OS#4420
Change-Id: Ief6b1464dc779ff22adc2b02da7a006cd772ebce
2020-03-02 12:05:06 +01:00
..
alloc tests/alloc: fix implicit conversion from 'double' to 'int8_t' 2020-01-29 06:17:50 +07:00
app_info tests/app_info: fix compiling with older g++ 2019-09-18 13:58:42 +02:00
bitcomp decompress_crbb: add length argument for search_runlen 2019-06-24 13:51:06 +00:00
codel use osmo_init_logging2() with proper talloc ctx 2018-04-01 16:57:42 +02:00
edge Remove undefined param passed to {logging,osmo_stats}_vty_add_cmds 2019-08-05 14:30:47 +02:00
emu Introduce osmo_tdef infra and timer VTY commands 2019-09-12 14:17:07 +02:00
fn use osmo_init_logging2() with proper talloc ctx 2018-04-01 16:57:42 +02:00
llc llc_queue::{dequeue,enqueue}() refactor 2020-03-02 12:05:06 +01:00
llist llist: Add missing const qualifier in llist cast method 2015-08-24 12:23:50 +02:00
ms Move out tbf subclasses from tbf.h to their own headers 2019-09-25 17:50:06 +02:00
rlcmac tests/rlcmac: fix malformed MS RA capability in testRAcap() 2020-02-19 00:07:56 +07:00
tbf Check return code of rlcmac decode/encode functions 2020-02-05 17:26:02 +01:00
types Move out tbf subclasses from tbf.h to their own headers 2019-09-25 17:50:06 +02:00
Makefile.am tests/rlcmac: additionally match debug output of the CSN.1 codec 2020-02-17 02:30:58 +07:00
testsuite.at tests/rlcmac: additionally match debug output of the CSN.1 codec 2020-02-17 02:30:58 +07:00