1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-09 12:58:26 +03:00

test-format-table: add test for unsetting table name

This should extend coverage to another part that previously wasn't covered.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2024-12-03 10:36:09 +01:00
parent e0be4dc563
commit 116eab8e7a

View File

@ -372,6 +372,8 @@ TEST(json) {
TABLE_HEADER, "piep miau",
TABLE_HEADER, "asdf",
TABLE_SET_JSON_FIELD_NAME, "asdf-custom"));
ASSERT_OK(table_set_json_field_name(t, 2, "ZZZ"));
ASSERT_OK(table_set_json_field_name(t, 2, NULL));
ASSERT_OK(table_set_json_field_name(t, 2, "zzz"));
ASSERT_OK(table_add_many(t,
@ -715,6 +717,8 @@ TEST(vertical) {
TABLE_FIELD, "quux", TABLE_STRING, "asdf", TABLE_SET_JSON_FIELD_NAME, "custom-quux",
TABLE_FIELD, "lllllllllllo", TABLE_STRING, "jjjjjjjjjjjjjjjjj"));
ASSERT_OK(table_set_json_field_name(t, 1, "DIMPFELMOSER"));
ASSERT_OK(table_set_json_field_name(t, 1, NULL));
ASSERT_OK(table_set_json_field_name(t, 1, "dimpfelmoser"));
ASSERT_OK(table_format(t, &formatted));