diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2020-07-25 11:33:48 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2020-07-26 10:24:34 +0200 |
| commit | 9cdb1656ee5b75350bb0114bab1ce212b2f65381 (patch) | |
| tree | 2552520ca1cae8e55ea335839f6915c0e7432575 | |
| parent | e83cc6536f2b536693fe424c080ce635a65993f7 (diff) | |
| download | vis-9cdb1656ee5b75350bb0114bab1ce212b2f65381.tar.gz vis-9cdb1656ee5b75350bb0114bab1ce212b2f65381.tar.xz | |
test/fuzz: add % command to print data structure memory information
| -rw-r--r-- | fuzz/text-fuzzer.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fuzz/text-fuzzer.c b/fuzz/text-fuzzer.c index 956c44b..559f90c 100644 --- a/fuzz/text-fuzzer.c +++ b/fuzz/text-fuzzer.c @@ -221,11 +221,23 @@ static enum CmdStatus cmd_print(Text *txt, const char *cmd) { return rem == 0; } +static enum CmdStatus cmd_info(Text *txt, const char *cmd) { +#ifdef text_info + TextInfo info = text_info(txt); + printf("meta data: %zu\nblocks: %zu\ndata: %zu\nrevisions: %zu\n" + "changes: %zu\nchanges total: %zu\npieces: %zu\npieces total: %zu\n", + info.metadata, info.blocks, info.data, info.revisions, + info.changes, info.changes_total, info.pieces, info.pieces_total); +#endif + return CMD_OK; +} + static enum CmdStatus cmd_quit(Text *txt, const char *cmd) { return CMD_QUIT; } static Cmd commands[] = { + ['%'] = cmd_info, ['-'] = cmd_earlier, ['+'] = cmd_later, ['?'] = cmd_mark_get, |
