Skip to content

Commit 792541d

Browse files
committed
test: use new memdisk singleton in stat test
1 parent 6bdd209 commit 792541d

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

test/posix/integration/stat/ftw_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void ftw_tests()
9898
printf("Total size: %ld\n", total_size);
9999
}
100100

101-
int display_info(const char *fpath, const struct stat *sb, int flag, struct FTW *ftwbuf)
101+
int display_info(const char *fpath, const struct stat *sb, int flag, struct FTW *)
102102
{
103103
printf("%ld\t%s (%d)\n", sb->st_size, fpath, flag);
104104
#ifdef EXTRAVERBOSE

test/posix/integration/stat/test_stat_ftw.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
int ftw_tests();
2525
int stat_tests();
2626

27-
fs::Disk_ptr& memdisk() {
28-
static auto disk = fs::new_shared_memdisk();
27+
fs::Disk& memdisk() {
28+
fs::Disk& disk = fs::memdisk();
2929

30-
if (not disk->fs_ready()) {
31-
printf("%s\n", disk->name().c_str());
32-
disk->init_fs([](fs::error_t err, auto&) {
30+
if (not disk.fs_ready()) {
31+
printf("%s\n", disk.name().c_str());
32+
disk.init_fs([](fs::error_t err, auto&) {
3333
if (err) {
3434
printf("ERROR MOUNTING DISK\n");
3535
exit(127);
@@ -44,7 +44,7 @@ int main()
4444
INFO("POSIX stat", "Running tests for POSIX stat");
4545

4646
// mount a disk with contents for testing
47-
auto root = memdisk()->fs().stat("/");
47+
auto root = memdisk().fs().stat("/");
4848
fs::mount("/mnt/disk", root, "test root");
4949

5050
fs::print_tree();

0 commit comments

Comments
 (0)