From 56345c1378fba058046d9d9d7d9adc701b3b88f0 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 12 Dec 2017 14:04:47 +0000 Subject: [PATCH 6/9] header-fields test: Exercise _dbus_message_remove_unknown_fields Signed-off-by: Simon McVittie --- Only add the test, don't also change the implementation --- test/header-fields.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/header-fields.c b/test/header-fields.c index 150a02ac..09b4f99c 100644 --- a/test/header-fields.c +++ b/test/header-fields.c @@ -456,7 +456,11 @@ test_weird_header_field (void *user_data, goto out; } - /* TODO: Actually filter its header */ + if (!_dbus_message_remove_unknown_fields (filtered)) + { + g_assert_false (have_memory); + goto out; + } /* All known headers are the same as in the modified message that was * deserialized from the same blob */ @@ -520,10 +524,7 @@ test_weird_header_field (void *user_data, ==, DBUS_TYPE_BYTE); _dbus_type_reader_read_basic (&sub, &field_code); - if (field_code == NOT_A_HEADER_FIELD) - { - g_test_message ("TODO: header field was not filtered out"); - } + g_assert_cmpuint (field_code, !=, NOT_A_HEADER_FIELD); _dbus_type_reader_next (&array); } -- 2.15.1