Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit a011f94

Browse files
William Douglasbryteise
authored andcommitted
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 <[email protected]>
1 parent 6896d8f commit a011f94

File tree

3 files changed

+17
-34
lines changed

3 files changed

+17
-34
lines changed

src/swupd_lib/manifest_parser.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,6 @@ struct manifest *manifest_parse(const char *component, const char *filename, boo
193193
file->is_experimental = 1;
194194
}
195195

196-
if (line[2] == 'C') {
197-
file->is_config = 1;
198-
} else if (line[2] == 's') {
199-
file->is_state = 1;
200-
} else if (line[2] == 'b') {
201-
file->is_boot = 1;
202-
}
203-
204196
if (line[3] == 'r') {
205197
/* rename flag is ignored */
206198
} else if (line[3] == 'x') {

test/unit/data/mom2

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ X... 0000000000000000000000000000000000000000000000000000000000000004 30 f4
1616
.d.. 0000000000000000000000000000000000000000000000000000000000000005 30 f5
1717
.g.. 0000000000000000000000000000000000000000000000000000000000000006 30 f6
1818
.e.. 0000000000000000000000000000000000000000000000000000000000000007 30 f7
19-
..C. 0000000000000000000000000000000000000000000000000000000000000008 30 f8
20-
..s. 0000000000000000000000000000000000000000000000000000000000000009 30 f9
21-
..b. 0000000000000000000000000000000000000000000000000000000000000010 30 f10
22-
..X. 0000000000000000000000000000000000000000000000000000000000000011 30 f11
23-
...r 0000000000000000000000000000000000000000000000000000000000000012 30 f12
24-
...X 0000000000000000000000000000000000000000000000000000000000000013 30 f13
19+
..X. 0000000000000000000000000000000000000000000000000000000000000008 30 f8
20+
...r 0000000000000000000000000000000000000000000000000000000000000009 30 f9
21+
...X 0000000000000000000000000000000000000000000000000000000000000010 30 f10

test/unit/test_manifest.c

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "swupd.h"
2424
#include "test_helper.h"
2525

26-
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)
26+
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)
2727
{
2828
struct list *list;
2929
char hash_str[SWUPD_HASH_LEN];
@@ -39,9 +39,6 @@ static void validate_file(struct list *files, const char *filename, int version,
3939
check(file->is_deleted == is_deleted);
4040
check(file->is_ghosted == is_ghosted);
4141
check(file->is_manifest == is_manifest);
42-
check(file->is_config == is_config);
43-
check(file->is_state == is_state);
44-
check(file->is_boot == is_boot);
4542
check(file->is_experimental == is_experimental);
4643

4744
check(file->last_change == version);
@@ -92,24 +89,21 @@ static void test_manifest_parse()
9289
// Check if parser can parse all different flags supported for the file list
9390
manifest = manifest_parse_test("test", dir, "data/mom2", false);
9491
check(manifest != NULL);
95-
check(list_len(manifest->files) == 13);
92+
check(list_len(manifest->files) == 10);
9693
check(list_len(manifest->manifests) == 1);
9794

98-
validate_file(manifest->manifests, "m1", 10, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0);
99-
100-
validate_file(manifest->files, "f1", 20, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0);
101-
validate_file(manifest->files, "f2", 30, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);
102-
validate_file(manifest->files, "f3", 30, 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
103-
validate_file(manifest->files, "f4", 30, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
104-
validate_file(manifest->files, "f5", 30, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0);
105-
validate_file(manifest->files, "f6", 30, 6, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0);
106-
validate_file(manifest->files, "f7", 30, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
107-
validate_file(manifest->files, "f8", 30, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0);
108-
validate_file(manifest->files, "f9", 30, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0);
109-
validate_file(manifest->files, "f10", 30, 10, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);
110-
validate_file(manifest->files, "f11", 30, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
111-
validate_file(manifest->files, "f12", 30, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
112-
validate_file(manifest->files, "f13", 30, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
95+
validate_file(manifest->manifests, "m1", 10, 1, 0, 0, 0, 0, 0, 1, 0);
96+
97+
validate_file(manifest->files, "f1", 20, 1, 0, 1, 0, 0, 0, 0, 0);
98+
validate_file(manifest->files, "f2", 30, 2, 1, 0, 0, 0, 0, 0, 0);
99+
validate_file(manifest->files, "f3", 30, 3, 0, 0, 1, 0, 0, 0, 0);
100+
validate_file(manifest->files, "f4", 30, 4, 0, 0, 0, 0, 0, 0, 0);
101+
validate_file(manifest->files, "f5", 30, 5, 0, 0, 0, 1, 0, 0, 0);
102+
validate_file(manifest->files, "f6", 30, 6, 0, 0, 0, 1, 1, 0, 0);
103+
validate_file(manifest->files, "f7", 30, 7, 0, 0, 0, 0, 0, 0, 1);
104+
validate_file(manifest->files, "f8", 30, 8, 0, 0, 0, 0, 0, 0, 0);
105+
validate_file(manifest->files, "f9", 30, 9, 0, 0, 0, 0, 0, 0, 0);
106+
validate_file(manifest->files, "f10", 30, 10, 0, 0, 0, 0, 0, 0, 0);
113107

114108
manifest_free(manifest);
115109

0 commit comments

Comments
 (0)