Page MenuHomeFreeBSD

queue(3): Add simple tests for some macros for all list/tailq types
ClosedPublic

Authored by olce on Apr 23 2025, 10:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Aug 5, 3:49 PM
Unknown Object (File)
Sun, Aug 3, 7:16 AM
Unknown Object (File)
Sun, Jul 27, 2:55 PM
Unknown Object (File)
Sun, Jul 27, 1:20 AM
Unknown Object (File)
Jul 8 2025, 4:55 PM
Unknown Object (File)
Jul 7 2025, 9:31 AM
Unknown Object (File)
Jun 26 2025, 6:29 AM
Unknown Object (File)
Jun 25 2025, 8:13 PM
Subscribers

Details

Summary

These essentially test building a list/tailq of 100 elements with
_INSERT_HEAD(), iterating over them with _FOREACH(), splitting it with
_SPLIT_AFTER() and concatenating back the results with _CONCAT(),
checking that the lists/tailqs at each step have the right number of
elements and at the expected positions.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 63754
Build 60638: arc lint + arc unit

Event Timeline

olce requested review of this revision.Apr 23 2025, 10:05 AM

Define QUEUE_MACRO_DEBUG_ASSERTIONS explicitly (as this is not automatically enabled for userland programs).

tests/sys/sys/queue_test.c
4

This file is missing a license header.

Why is cdefs.h needed?

olce added inline comments.
tests/sys/sys/queue_test.c
4

Why is cdefs.h needed?

It doesn't seem so, removed. Probably a leftover from an earlier version that needed it.

olce marked an inline comment as done.
  • Add license header.
  • Remove include of <cdefs.h>.
  • unsigned => u_int
  • Fix a typo in a comment

Thanks for adding these.

This revision is now accepted and ready to land.Apr 29 2025, 1:10 AM