Skip to content

Commit e669b22

Browse files
committed
[codefactor] fix issues
1 parent b8c9250 commit e669b22

7 files changed

Lines changed: 28 additions & 29 deletions

File tree

include/fsmod/Storage.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ namespace simgrid::fsmod {
2323
* @brief A class that implements a storage abstraction
2424
*/
2525
class XBT_PUBLIC Storage {
26-
2726
public:
2827
[[nodiscard]] const std::string& get_name() const;
2928
[[nodiscard]] const char* get_cname() const;

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, name, sourcedir=""):
2727
class CMakeBuild(build_ext):
2828
def run(self):
2929
try:
30-
subprocess.check_output(["cmake", "--version"])
30+
subprocess.check_output(["/usr/bin/cmake", "--version"])
3131
except OSError:
3232
raise RuntimeError("CMake must be installed to build the file-system-module")
3333

@@ -47,7 +47,7 @@ def build_extension(self, ext):
4747

4848
os.makedirs(self.build_temp, exist_ok=True)
4949
subprocess.check_call(["cmake", ext.sourcedir] + cmake_args, cwd=self.build_temp)
50-
subprocess.check_call(["cmake", "--build", "."], cwd=self.build_temp)
50+
subprocess.check_call(["/usr/bin/cmake", "--build", "."], cwd=self.build_temp)
5151

5252
setup(
5353
ext_modules=[CMakeExtension("fsmod")],

test/python/caching_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def run_test_FIFO_basics_with_unevictable_files():
7575
def test_actor():
7676
this_actor.info("Create a 20MB file at /dev/fifo/20mb.txt")
7777
fs.create_file("/dev/fifo/20mb.txt", "20MB")
78-
this_actor.info("Making the 20MB file at /dev/fifo/20mb.txt unevictable");
78+
this_actor.info("Making the 20MB file at /dev/fifo/20mb.txt unevictable")
7979
try:
8080
fs.make_file_evictable("/dev/fifo/bogus.txt", False)
8181
except FileNotFoundException:
@@ -130,7 +130,7 @@ def test_actor():
130130
[["create", "f1", "20MB"], ["f1"], []],
131131
[["create", "f2", "50MB"], ["f1", "f2"], []],
132132
[["create", "f3", "30MB"], ["f1", "f2", "f3"], []],
133-
[["delete", "f1"], ["f2", "f3"], ["f1"]],
133+
[["delete", "f1"], ["f2", "f3"], ["f1"]],
134134
[["create", "f4", "30MB"], ["f3", "f4"], ["f2"]],
135135
[["create", "f5", "50MB"], ["f4", "f5"], ["f3"]],
136136
[["create", "f6", "10MB"], ["f4", "f5", "f6"], []],
@@ -190,12 +190,12 @@ def test_actor():
190190
[["create", "f1", "20MB"], ["f1"], []],
191191
[["create", "f2", "50MB"], ["f1", "f2"], []],
192192
[["create", "f3", "30MB"], ["f1", "f2", "f3"], []],
193-
[["access", "f1"], ["f1", "f2", "f3"], []],
193+
[["access", "f1"], ["f1", "f2", "f3"], []],
194194
[["create", "f4", "30MB"], ["f1", "f3", "f4"], ["f2"]],
195-
[["delete", "f1"], ["f3", "f4"], ["f1"]],
195+
[["delete", "f1"], ["f3", "f4"], ["f1"]],
196196
[["create", "f5", "10MB"], ["f3", "f4", "f5"], []],
197197
[["create", "f6", "80MB"], ["f5", "f6"], ["f3", "f4"]],
198-
[["access", "f5"], ["f5", "f6"], []],
198+
[["access", "f5"], ["f5", "f6"], []],
199199
[["create", "f7", "20MB"], ["f5", "f7"], ["f6"]]
200200
]
201201

test/python/file_system_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_actor():
6161
pass
6262
this_actor.info("Retrieving the file system's partitions")
6363
partitions = fs.partitions
64-
assert len(partitions) == 2
64+
assert len(partitions) == 2
6565

6666
host.add_actor("TestActor", test_actor)
6767
e.run()
@@ -176,7 +176,7 @@ def test_actor():
176176
pass
177177
this_actor.info("Create a 10kB file at /dev/a/foo.txt")
178178
fs.create_file("/dev/a/foo.txt", "10kB")
179-
assert fs.partition_by_name("/dev/a/").free_space == 90*1000
179+
assert fs.partition_by_name("/dev/a/").free_space == 90*1000
180180
assert fs.free_space_at_path("/dev/a/") == 90*1000
181181
assert fs.free_space_at_path("/dev/a/foo.txt") == 90*1000
182182
this_actor.info("Try to move file /dev/a/foo.txt to the same path. This should work (no-op)")
@@ -188,24 +188,24 @@ def test_actor():
188188

189189
this_actor.info("Create a 20kB file at /dev/a/stuff.txt")
190190
fs.create_file("/dev/a/stuff.txt", "20kB")
191-
assert fs.partition_by_name("/dev/a/").free_space == 70*1000
191+
assert fs.partition_by_name("/dev/a/").free_space == 70*1000
192192

193193
# Moving a smaller file to a bigger file
194194
this_actor.info("Move file /dev/a/b/c/foo.txt to /dev/a/stuff.txt")
195195
fs.move_file("/dev/a/b/c/foo.txt", "/dev/a/stuff.txt")
196196
assert False == fs.file_exists("/dev/a/b/c/foo.txt")
197197
assert True ==fs.file_exists("/dev/a/stuff.txt")
198-
assert fs.partition_by_name("/dev/a/").free_space == 90*1000
198+
assert fs.partition_by_name("/dev/a/").free_space == 90*1000
199199

200200
# Moving a bigger file to a smaller file
201201
this_actor.info("Create a 20kB file at /dev/a/big.txt")
202202
fs.create_file("/dev/a/big.txt", "20kB")
203-
assert fs.partition_by_name("/dev/a/").free_space == 70*1000
203+
assert fs.partition_by_name("/dev/a/").free_space == 70*1000
204204
this_actor.info("Move file /dev/a/stuff.txt to /dev/a/big.txt")
205205
fs.move_file("/dev/a/stuff.txt", "/dev/a/big.txt")
206206
assert False == fs.file_exists("/dev/a/stuff.txt")
207207
assert True ==fs.file_exists("/dev/a/big.txt")
208-
assert fs.partition_by_name("/dev/a/").free_space == 90*1000
208+
assert fs.partition_by_name("/dev/a/").free_space == 90*1000
209209

210210
ods = OneDiskStorage.create("my_storage", disk_two)
211211
this_actor.info("Mount a new partition")

test/python/jbod_storage_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def actor():
182182
file = fs.open("/dev/a/foo.txt", "r")
183183
assert file.read("12MB") == 12_000_000
184184
this_actor.info("Read complete. Clock is at 4.7s (1.5s to read, .1s to transfer)")
185-
assert math.isclose(Engine.clock, 4.7)
185+
assert math.isclose(Engine.clock, 4.7)
186186
this_actor.info("Close the file")
187187
file.close()
188188

test/python/path_util_test.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ def run_test_path_simplification():
2626

2727
def run_test_split_path():
2828
input_output = [
29-
("/a/b/c/d", ("/a/b/c", "d")),
30-
("/a/b////c/d", ("/a/b/c", "d")),
31-
("/", ("/", "")),
32-
("a", ("/", "a"))
29+
("/a/b/c/d", ("/a/b/c", "d")),
30+
("/a/b////c/d", ("/a/b/c", "d")),
31+
("/", ("/", "")),
32+
("a", ("/", "a"))
3333
]
3434
for (input, output) in input_output:
3535
simplified_path = PathUtil.simplify_path_string(input)
@@ -43,21 +43,21 @@ def run_test_split_path():
4343

4444
def run_test_path_at_mount_point():
4545
input_output = [
46-
("////../", "/dev/a", "Exception"),
47-
("/dev/a/foo/bar/", "/dev/a", "/foo/bar"),
48-
("/dev/a/foo/../bar/", "/dev/a/", "/bar"),
49-
("/dev/a/foo/../bar////", "/dev/a///", "/bar"),
50-
("/dev/a////foo/../../", "dev/a", "Exception"),
46+
("////../", "/dev/a", "Exception"),
47+
("/dev/a/foo/bar/", "/dev/a", "/foo/bar"),
48+
("/dev/a/foo/../bar/", "/dev/a/", "/bar"),
49+
("/dev/a/foo/../bar////", "/dev/a///", "/bar"),
50+
("/dev/a////foo/../../", "dev/a", "Exception"),
5151
("/dev/b/foo/../bar/bar2/", "/bar/bar2", "Exception"),
52-
("/dev/b/foo/../bar/bar2", "/dev/a", "Exception"),
53-
("/foo/dev/b/foo/bar/../", "/dev/a", "Exception"),
54-
("/dev/a/../a/fioo", "/dev/a", "/fioo")
52+
("/dev/b/foo/../bar/bar2", "/dev/a", "Exception"),
53+
("/foo/dev/b/foo/bar/../", "/dev/a", "Exception"),
54+
("/dev/a/../a/fioo", "/dev/a", "/fioo")
5555
]
5656
for (path, mp, output) in input_output:
5757
simplified_path = PathUtil.simplify_path_string(path)
5858
try :
5959
path_at_mp = PathUtil.path_at_mount_point(simplified_path, "/dev/a")
60-
assert output == path_at_mp, f"({path},{mp})"
60+
assert output == path_at_mp, f"({path},{mp})"
6161
except ValueError:
6262
assert output == "Exception", f"({path},{mp})"
6363

test/python/truncate_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_actor():
5959
this_actor.info("Close the file")
6060
file.close()
6161
this_actor.info("Check file size")
62-
assert fs.file_size("/dev/a/foo.txt") == 51*1000
62+
assert fs.file_size("/dev/a/foo.txt") == 51*1000
6363
this_actor.info("Check free space")
6464
assert fs.partitions[0].free_space == 1000*1000 - 51000
6565

0 commit comments

Comments
 (0)