cli: print map value in ASCII-betical order of keys
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 30 Sep 2019 19:13:25 +0000 (15:13 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Oct 2019 14:45:11 +0000 (10:45 -0400)
commit501e2500aef53c7c7c3ce9138e4cbf5882dc86c7
treee037fa8d609d54279352395dfa3b269008630565
parente94c29e819a1e0cfece20193883bd59e95ac68d6
cli: print map value in ASCII-betical order of keys

The test plugins/src.ctf.fs/query/test_query_metadata_info (and maybe
others that I don't know about) relies on the CLI outputting query
results in a constant way.  However, it isn't currently the case, as the
map entries are printed in the order that
bt_value_map_foreach_entry_const, therefore g_hash_table_iter_next,
provides them.  This test currently fails on the CI Windows machine for
this reason.

This patch makes the CLI print map values in a sorted order (defined by
comparing keys with strcmp).  This makes the tests stable, but it is
also convenient for the user, as the results will be sorted and in a
stable order.

Change-Id: I034b295bc238e146337844ac5d2c43a305fb90e0
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2109
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
src/cli/babeltrace2.c
tests/data/plugins/src.ctf.fs/query/metadata-info-succeed1.expect
This page took 0.024172 seconds and 4 git commands to generate.