support/testing: rename variables for readability
PATCH 1/2 support/testing: rename variables for readability
The 'lines' variable is overwritten with its own fields. Thus it contains a line first, and then a list of fields -- it never contains 'lines'.
Use two different variables named 'line' and 'fields' to make the code more readable.
--- support/testing/tests/fs/test_ext.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
support/testing/tests/fs/test_ext.py +4 -4
@@ -21,10 +21,10 @@ def dumpe2fs_run(builddir, image): return ret.strip().splitlines() def dumpe2fs_getprop(out, prop): - for lines in out: - lines = lines.split(": ") - if lines[0] == prop: - return lines[1].strip() + for line in out: + fields = line.split(": ") + if fields[0] == prop: + return fields[1].strip() def boot_img_and_check_fs_type(emulator, builddir, fs_type): img = os.path.join(builddir, "images", "rootfs.{}".format(fs_type))
Signature · 1 line
2.7.4
PATCH 2/2 support/testing: fs/ext: add a negative test for the "extent" feature
We only have a positive test for it, in ext4. Let's have a negative one as well.
--- support/testing/tests/fs/test_ext.py | 1 + 1 file changed, 1 insertion(+)
support/testing/tests/fs/test_ext.py +1 -0
@@ -86,6 +86,7 @@ BR2_TARGET_ROOTFS_EXT2_3=y out = dumpe2fs_run(self.builddir, "rootfs.ext3") self.assertEqual(dumpe2fs_getprop(out, REVISION_PROP), "1 (dynamic)") self.assertIn("has_journal", dumpe2fs_getprop(out, FEATURES_PROP)) + self.assertNotIn("extent", dumpe2fs_getprop(out, FEATURES_PROP)) exit_code = boot_img_and_check_fs_type(self.emulator, self.builddir, "ext3")
Signature · 1 line
2.7.4
PATCH 2/2 support/testing: fs/ext: add a negative test for the "extent" feature
Hello,
Quoted 4 lines · Luca Ceresoli
We only have a positive test for it, in ext4. Let's have a negative one as well.
Signed-off-by Luca Ceresoli <[email protected]>
Regards,
Ricardo
PATCH 1/2 support/testing: rename variables for readability
In reply to Luca CeresoliHello,
Quoted 8 lines · Luca Ceresoli
The 'lines' variable is overwritten with its own fields. Thus it contains a line first, and then a list of fields -- it never contains 'lines'.
Use two different variables named 'line' and 'fields' to make the code more readable.
Signed-off-by Luca Ceresoli <[email protected]>
Regards,
Ricardo
PATCH 1/2 support/testing: rename variables for readability
In reply to Luca CeresoliHello,
Quoted 11 lines · Luca Ceresoli
The 'lines' variable is overwritten with its own fields. Thus it contains a line first, and then a list of fields -- it never contains 'lines'.
Use two different variables named 'line' and 'fields' to make the code more readable.
Signed-off-by Luca Ceresoli <[email protected]>--- support/testing/tests/fs/test_ext.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Both applied to master. Thanks!
For some reason, your first patch had a broken prefix: [PATH] instead of [PATCH]. I guess you hand-edited the patch, and made a typo?
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/2 support/testing: rename variables for readability
Hi,
Quoted 10 lines · Thomas Petazzoni
Hello,
Quoted 7 lines · Luca Ceresoli
The 'lines' variable is overwritten with its own fields. Thus it contains a line first, and then a list of fields -- it never contains 'lines'.
Use two different variables named 'line' and 'fields' to make the code more readable.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Luca Ceresoli <[email protected]>--- support/testing/tests/fs/test_ext.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)Both applied to master. Thanks!
Thanks.
Quoted 2 lines
For some reason, your first patch had a broken prefix: [PATH] instead of [PATCH]. I guess you hand-edited the patch, and made a typo?
That's weird, sorry about that. But at times I open my patches with emacs just for a last-time check before I do git send-email. Perhaps I hit a few wrong keystrokes in that moment.
Maybe I should switch to an editor that is not editing files when it is started... :)
Signature · 1 line
Luca