You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2026/10/07 18:30:26 UTC
(nuttx-apps) 01/02: testing/fs/xipfs: Fix the indentation of a block in the defrag test.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit cfb0af0cca078ced84741010b6e71d3611608b56
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Tue Oct 6 19:50:59 2026 +0200
testing/fs/xipfs: Fix the indentation of a block in the defrag test.
nxstyle reports "Bad left brace alignment" for the block that holds the
open-file obstruction check: its braces were at column 4, not 2. Move
the block two columns left. This changes whitespace only, and the error
is older than the change that follows.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <ma...@gmail.com>
---
testing/fs/xipfs/xipfs_main.c | 106 +++++++++++++++++++++---------------------
1 file changed, 53 insertions(+), 53 deletions(-)
diff --git a/testing/fs/xipfs/xipfs_main.c b/testing/fs/xipfs/xipfs_main.c
index bfcd6347f..95eb28a8b 100644
--- a/testing/fs/xipfs/xipfs_main.c
+++ b/testing/fs/xipfs/xipfs_main.c
@@ -1018,59 +1018,59 @@ static void test_defrag(void)
* extent above the hole.
*/
- {
- uint32_t beststart = 0;
- uint32_t nextstart = 0;
- char lastpath[64];
- char holepath[64];
-
- lastpath[0] = '\0';
- holepath[0] = '\0';
-
- for (i = 1; i < 10; i += 2)
- {
- snprintf(path, sizeof(path), PATH("frag%d.bin"), i);
- if (extent_info(path, &info) < 0)
- {
- continue;
- }
-
- if (lastpath[0] == '\0' || info.start_block > beststart)
- {
- nextstart = beststart;
- strlcpy(holepath, lastpath, sizeof(holepath));
- beststart = info.start_block;
- strlcpy(lastpath, path, sizeof(lastpath));
- }
- else if (holepath[0] == '\0' || info.start_block > nextstart)
- {
- nextstart = info.start_block;
- strlcpy(holepath, path, sizeof(holepath));
- }
- }
-
- if (lastpath[0] != '\0' && holepath[0] != '\0')
- {
- unlink(holepath);
-
- fd = open(lastpath, O_RDONLY | O_CLOEXEC);
- if (fd >= 0)
- {
- ret = run_defrag(0, &result);
- CHECK("an open file is reported as blocking, not as done",
- ret == 0 &&
- result.reason == XIPFS_DEFRAG_BLOCKED_OPEN,
- "unexpected reason");
- close(fd);
- }
-
- /* Put it back so the pinned test below has the same layout to
- * work with as before.
- */
-
- create_file(holepath, small, 1);
- }
- }
+ {
+ uint32_t beststart = 0;
+ uint32_t nextstart = 0;
+ char lastpath[64];
+ char holepath[64];
+
+ lastpath[0] = '\0';
+ holepath[0] = '\0';
+
+ for (i = 1; i < 10; i += 2)
+ {
+ snprintf(path, sizeof(path), PATH("frag%d.bin"), i);
+ if (extent_info(path, &info) < 0)
+ {
+ continue;
+ }
+
+ if (lastpath[0] == '\0' || info.start_block > beststart)
+ {
+ nextstart = beststart;
+ strlcpy(holepath, lastpath, sizeof(holepath));
+ beststart = info.start_block;
+ strlcpy(lastpath, path, sizeof(lastpath));
+ }
+ else if (holepath[0] == '\0' || info.start_block > nextstart)
+ {
+ nextstart = info.start_block;
+ strlcpy(holepath, path, sizeof(holepath));
+ }
+ }
+
+ if (lastpath[0] != '\0' && holepath[0] != '\0')
+ {
+ unlink(holepath);
+
+ fd = open(lastpath, O_RDONLY | O_CLOEXEC);
+ if (fd >= 0)
+ {
+ ret = run_defrag(0, &result);
+ CHECK("an open file is reported as blocking, not as done",
+ ret == 0 &&
+ result.reason == XIPFS_DEFRAG_BLOCKED_OPEN,
+ "unexpected reason");
+ close(fd);
+ }
+
+ /* Put it back so the pinned test below has the same layout to
+ * work with as before.
+ */
+
+ create_file(holepath, small, 1);
+ }
+ }
/* A pinned extent must be skipped, and defrag must say so rather than
* silently reporting success.