Page MenuHomeFreeBSD

wc: Improve test coverage.
ClosedPublic

Authored by des on Feb 15 2023, 1:11 PM.
Tags
None
Referenced Files
F132475742: D38605.diff
Fri, Oct 17, 6:01 AM
Unknown Object (File)
Tue, Oct 14, 7:54 AM
Unknown Object (File)
Sun, Oct 12, 5:22 PM
Unknown Object (File)
Sun, Oct 12, 5:22 PM
Unknown Object (File)
Sun, Oct 12, 5:22 PM
Unknown Object (File)
Sun, Oct 12, 5:22 PM
Unknown Object (File)
Sun, Oct 12, 5:48 AM
Unknown Object (File)
Mon, Sep 22, 6:43 AM
Subscribers

Details

Summary
  • Add a test that causes mbrtowc() to return 0.
  • Add a test that causes mbrtowc() to return -2.

Sponsred by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Feb 15 2023, 1:11 PM
des retitled this revision from wc: Improve test coverage to wc: Improve test coverage..Feb 15 2023, 2:49 PM

Elegant test implementation! I wonder if the Freudians will find it too scatological.

emaste added a subscriber: emaste.
emaste added inline comments.
usr.bin/wc/tests/wc_test.sh
164

maybe worth a comment demonstrating how the mb char crosses the boundary (to aid in someone updating this if the buffer increases in the future)?

This revision is now accepted and ready to land.Feb 15 2023, 11:59 PM

Parametrize MAXBSIZE, make sure we really do cross a buffer boundary, and explain what we're doing and why.

This revision now requires review to proceed.Feb 16 2023, 12:32 AM
des marked an inline comment as done.Feb 16 2023, 12:32 AM
This revision is now accepted and ready to land.Feb 16 2023, 12:39 AM
This revision was automatically updated to reflect the committed changes.