From a011f9429a56f5569a720538c4f5a3c4cd02a3b1 Mon Sep 17 00:00:00 2001 From: William Douglas Date: Tue, 28 Feb 2023 10:23:52 -0800 Subject: [PATCH] Remove logic for flag not in use The logic is testing a flag that mixer does not set and would like to change the purpose of in a new version. Remove the test (needs a format bump before mixer can use the flag) for the flag. Signed-off-by: William Douglas --- src/swupd_lib/manifest_parser.c | 8 -------- test/unit/data/mom2 | 9 +++------ test/unit/test_manifest.c | 32 +++++++++++++------------------- 3 files changed, 16 insertions(+), 33 deletions(-) diff --git a/src/swupd_lib/manifest_parser.c b/src/swupd_lib/manifest_parser.c index 04f777a8..b80e906f 100644 --- a/src/swupd_lib/manifest_parser.c +++ b/src/swupd_lib/manifest_parser.c @@ -193,14 +193,6 @@ struct manifest *manifest_parse(const char *component, const char *filename, boo file->is_experimental = 1; } - if (line[2] == 'C') { - file->is_config = 1; - } else if (line[2] == 's') { - file->is_state = 1; - } else if (line[2] == 'b') { - file->is_boot = 1; - } - if (line[3] == 'r') { /* rename flag is ignored */ } else if (line[3] == 'x') { diff --git a/test/unit/data/mom2 b/test/unit/data/mom2 index 83a6bc76..b30bb39f 100644 --- a/test/unit/data/mom2 +++ b/test/unit/data/mom2 @@ -16,9 +16,6 @@ X... 0000000000000000000000000000000000000000000000000000000000000004 30 f4 .d.. 0000000000000000000000000000000000000000000000000000000000000005 30 f5 .g.. 0000000000000000000000000000000000000000000000000000000000000006 30 f6 .e.. 0000000000000000000000000000000000000000000000000000000000000007 30 f7 -..C. 0000000000000000000000000000000000000000000000000000000000000008 30 f8 -..s. 0000000000000000000000000000000000000000000000000000000000000009 30 f9 -..b. 0000000000000000000000000000000000000000000000000000000000000010 30 f10 -..X. 0000000000000000000000000000000000000000000000000000000000000011 30 f11 -...r 0000000000000000000000000000000000000000000000000000000000000012 30 f12 -...X 0000000000000000000000000000000000000000000000000000000000000013 30 f13 +..X. 0000000000000000000000000000000000000000000000000000000000000008 30 f8 +...r 0000000000000000000000000000000000000000000000000000000000000009 30 f9 +...X 0000000000000000000000000000000000000000000000000000000000000010 30 f10 diff --git a/test/unit/test_manifest.c b/test/unit/test_manifest.c index 39c07535..d8ad8437 100644 --- a/test/unit/test_manifest.c +++ b/test/unit/test_manifest.c @@ -23,7 +23,7 @@ #include "swupd.h" #include "test_helper.h" -static void validate_file(struct list *files, const char *filename, int version, int hash, int is_dir, int is_file, int is_link, int is_deleted, int is_ghosted, int is_manifest, int is_config, int is_state, int is_boot, int is_experimental) +static void validate_file(struct list *files, const char *filename, int version, int hash, int is_dir, int is_file, int is_link, int is_deleted, int is_ghosted, int is_manifest, int is_experimental) { struct list *list; char hash_str[SWUPD_HASH_LEN]; @@ -39,9 +39,6 @@ static void validate_file(struct list *files, const char *filename, int version, check(file->is_deleted == is_deleted); check(file->is_ghosted == is_ghosted); check(file->is_manifest == is_manifest); - check(file->is_config == is_config); - check(file->is_state == is_state); - check(file->is_boot == is_boot); check(file->is_experimental == is_experimental); check(file->last_change == version); @@ -92,24 +89,21 @@ static void test_manifest_parse() // Check if parser can parse all different flags supported for the file list manifest = manifest_parse_test("test", dir, "data/mom2", false); check(manifest != NULL); - check(list_len(manifest->files) == 13); + check(list_len(manifest->files) == 10); check(list_len(manifest->manifests) == 1); - validate_file(manifest->manifests, "m1", 10, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0); + validate_file(manifest->manifests, "m1", 10, 1, 0, 0, 0, 0, 0, 1, 0); - validate_file(manifest->files, "f1", 20, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0); - validate_file(manifest->files, "f2", 30, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); - validate_file(manifest->files, "f3", 30, 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0); - validate_file(manifest->files, "f4", 30, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - validate_file(manifest->files, "f5", 30, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0); - validate_file(manifest->files, "f6", 30, 6, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0); - validate_file(manifest->files, "f7", 30, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); - validate_file(manifest->files, "f8", 30, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0); - validate_file(manifest->files, "f9", 30, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0); - validate_file(manifest->files, "f10", 30, 10, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0); - validate_file(manifest->files, "f11", 30, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - validate_file(manifest->files, "f12", 30, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - validate_file(manifest->files, "f13", 30, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + validate_file(manifest->files, "f1", 20, 1, 0, 1, 0, 0, 0, 0, 0); + validate_file(manifest->files, "f2", 30, 2, 1, 0, 0, 0, 0, 0, 0); + validate_file(manifest->files, "f3", 30, 3, 0, 0, 1, 0, 0, 0, 0); + validate_file(manifest->files, "f4", 30, 4, 0, 0, 0, 0, 0, 0, 0); + validate_file(manifest->files, "f5", 30, 5, 0, 0, 0, 1, 0, 0, 0); + validate_file(manifest->files, "f6", 30, 6, 0, 0, 0, 1, 1, 0, 0); + validate_file(manifest->files, "f7", 30, 7, 0, 0, 0, 0, 0, 0, 1); + validate_file(manifest->files, "f8", 30, 8, 0, 0, 0, 0, 0, 0, 0); + validate_file(manifest->files, "f9", 30, 9, 0, 0, 0, 0, 0, 0, 0); + validate_file(manifest->files, "f10", 30, 10, 0, 0, 0, 0, 0, 0, 0); manifest_free(manifest);