Conversation
tamnd/zu-c#7 put a C test harness and a fifteen case misuse suite in the repository that had, until now, no C tests at all. The row goes 22 to 39 of the 90 it owes. Worth saying why that was the shape of the work rather than a file of new cases. The wrapper is header-only, so a C++ test reaches the ABI through it, and every promise the wrapper keeps for a caller is one the suite had never asked the ABI to keep. Most of the misuse item is in that gap: a destructor does not run twice, a zu::Connection has no null state to pass, a Result cannot outlive its Connection by accident. Two findings out of it, both filed: the progress watcher may call zu_conn_rows_read though the header says only zu_conn_interrupt crosses threads, which is #618, and a bad path answers ZU_CORRUPT or ZU_IO rather than the ZU_ERROR I had reported on #614.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tamnd/zu-c#7 landed a C test harness and a fifteen case misuse suite. zu-c goes from 22 to 39 of the 90 its tier asks for.
The item asks for the misuse and lifecycle suite of dx/15 section 4: deliberately wrong programs, and for each one no crash, no leak, and a clear message. What made it more than a file of new cases is that zu-c had no C tests at all. The repository whose reason for existing is the C ABI was testing that ABI entirely through the header-only C++ wrapper, which means every promise the wrapper keeps on a caller's behalf was a promise the suite had never asked the ABI to keep. A destructor does not run twice. A
zu::Connectionhas no null state to pass. AResultcannot outlive itsConnectionby accident, because the wrapper arranged that it cannot.Most of the misuse item lives in exactly that gap, so the work was a C harness first and then the suite.
Two things came out of writing it, both filed rather than absorbed:
The progress watcher may call
zu_conn_rows_readand the header says it may not.zu_query,zu_prepareandzu_beginfrom in there all answerZU_MISUSE_CONCURRENTas promised, butzu_conn_rows_readanswersZU_OKwhile the header nameszu_conn_interruptas the only call meant to cross threads. The behaviour is right and the sentence is wrong, since a watcher reporting a rate has no other way to the row count. That is #618, and all five statuses are asserted in the suite so that resolving it either way is a failing test rather than a surprise.A bad path answers
ZU_CORRUPTorZU_IO, not theZU_ERRORI reported on #614. A file that is there and is not a database is corrupt; a path with nothing at it, or one that is a directory, is io. That is the distinction a user needs and the engine already draws it well. The correction is on #614.The overview was regenerated with
cargo run -q -p xtask -- clients. One line moved.