Attention is currently required from: arehbein, dexter, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34444?usp=email )
Change subject: write_queue: Enable updating max_length field ......................................................................
Patch Set 3: Code-Review-1
(2 comments)
File src/core/write_queue.c:
https://gerrit.osmocom.org/c/libosmocore/+/34444/comment/e8b97450_647808f4 PS3, Line 161: queue->current_length > queue->max_length This condition can never be true because you're updating the `queue->max_length` after the loop, not before. So now this function would not remove any items at all. Do you have a unit test for the scenario of removing exceeding items? Oh, you do. See my other comment then.
File tests/write_queue/wqueue_test.c:
https://gerrit.osmocom.org/c/libosmocore/+/34444/comment/a0b9fb44_a447ccb2 PS3, Line 98: OSMO_ASSERT Somehow this `assert()` does not assert at all, no matter how I change the expected value. This is weird. If I add a `printf()` here, I clearly see that the amount of dropped messages is 0, as expected with the current implementation (see my other comment).
Ah, well... I see now. You're doing `=` instead of `==`!