Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions contents.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,6 @@ static char *contents_node_get_text(xmlNode *node)
return ret;
}

static bool contents_entry_is_ignored(xmlNode *node)
{
xmlChar *ignore;
bool ret;

ignore = xmlGetProp(node, (xmlChar *)"ignore");
if (!ignore)
return false;

ret = !xmlStrcmp(ignore, (xmlChar *)"true");

xmlFree(ignore);

return ret;
}

static int contents_parse_pf(struct contents *contents, xmlNode *node)
{
char **new_flavors;
Expand Down Expand Up @@ -335,9 +319,6 @@ static int contents_parse_entry(struct contents *contents, xmlNode *node,
return -1;
}

if (contents_entry_is_ignored(node))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd guess it needs some explanation, why we should not ignore the files flagged to be ignored.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not found any description of what it is that the "ignored" attribute implies that we should ignore, and so far it's only one target that I've run into where we need to ignore the ignore-flag.

I don't think we should merge this until we get clarity in the purpose of this attribute.

return 0;

file_type = contents_detect_file_type(node, &firehose_type);
storage = contents_detect_storage_type(node);

Expand Down
10 changes: 6 additions & 4 deletions tests/test_contents_xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ static void test_load_xml_parses_file_entries(void **state)

init_contents(&contents);
assert_int_equal(contents_load_xml(&contents, fixture->contents_xml), 0);
assert_int_equal(count_entries(&contents), 6);
assert_int_equal(count_entries(&contents), 7);

assert_entry(fixture, &contents, "programmer.xml",
CONTENTS_FILE_PROGRAMMER_XML, QDL_STORAGE_UNKNOWN, NULL, 2,
Expand All @@ -424,18 +424,20 @@ static void test_load_xml_parses_file_entries(void **state)
assert_entry(fixture, &contents, "spinor_rawprogram.xml",
CONTENTS_FILE_PROGRAM, QDL_STORAGE_SPINOR, "flavor_b", 0,
"spinor/spinor_rawprogram.xml");
assert_entry(fixture, &contents, "ignored.bin",
CONTENTS_FILE_OTHER, QDL_STORAGE_UFS, NULL, 0,
"ignored/ignored.bin");

free_contents(&contents);
}

static void test_load_xml_skips_ignored_and_wildcards(void **state)
static void test_load_xml_skips_wildcards(void **state)
{
struct xml_fixture *fixture = *state;
struct contents contents = {};

init_contents(&contents);
assert_int_equal(contents_load_xml(&contents, fixture->contents_xml), 0);
assert_null(find_entry(&contents, "ignored.bin"));
assert_null(find_entry(&contents, "*.bin"));

free_contents(&contents);
Expand Down Expand Up @@ -533,7 +535,7 @@ int main(void)
setup_xml_fixture, teardown_xml_fixture),
cmocka_unit_test_setup_teardown(test_load_xml_parses_file_entries,
setup_xml_fixture, teardown_xml_fixture),
cmocka_unit_test_setup_teardown(test_load_xml_skips_ignored_and_wildcards,
cmocka_unit_test_setup_teardown(test_load_xml_skips_wildcards,
setup_xml_fixture, teardown_xml_fixture),
cmocka_unit_test_setup_teardown(test_load_xml_rejects_non_contents_document,
setup_xml_fixture, teardown_xml_fixture),
Expand Down
Loading