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)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 2 Oct 2019 16:24:52 +0000 (12:24 -0400)
commit1376311317cd9d9a390ad758174e6340f3e3f96f
tree1ba1f1707e1db0f696211ea20a562b246173daf9
parent1f8a86911ddc6dac133d136f39fdd2c6ad0d1f30
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.024545 seconds and 4 git commands to generate.