Skip to content

Commit 7669bb6

Browse files
committed
test: Update POSIX tests to new FS change
1 parent dea8b86 commit 7669bb6

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

examples/acorn/service.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ void Service::start(const std::string&) {
7272
disk = fs::new_shared_memdisk();
7373

7474
// mount the main partition in the Master Boot Record
75-
disk->init_fs([](fs::error_t err) {
76-
75+
disk->init_fs(
76+
[](fs::error_t err, auto& fs)
77+
{
7778
if (err) panic("Could not mount filesystem, retreating...\n");
7879

7980
/** IP STACK SETUP **/
@@ -152,11 +153,12 @@ void Service::start(const std::string&) {
152153
router.use("/api/dashboard", dashboard_->router());
153154

154155
// Fallback route for angular application - serve index.html if route is not found
155-
router.on_get("/app/.*", [](auto, auto res) {
156+
router.on_get("/app/.*",
157+
[&fs](auto, auto res) {
156158
#ifdef VERBOSE_WEBSERVER
157159
printf("[@GET:/app/*] Fallback route - try to serve index.html\n");
158160
#endif
159-
disk->fs().cstat("/public/app/index.html", [res](auto err, const auto& entry) {
161+
fs.cstat("/public/app/index.html", [res](auto err, const auto& entry) {
160162
if(err) {
161163
res->send_code(http::Not_Found);
162164
} else {

test/posix/integration/conf/service.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fs::Disk_ptr& memdisk() {
3333
static auto disk = fs::new_shared_memdisk();
3434

3535
if (not disk->fs_ready()) {
36-
disk->init_fs([](fs::error_t err) {
36+
disk->init_fs([](fs::error_t err, auto&) {
3737
if (err) {
3838
printf("ERROR MOUNTING DISK\n");
3939
printf("%s\n", err.reason().c_str());

test/posix/integration/file_fd/test_file_fd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fs::Disk_ptr& memdisk() {
3131
static auto disk = fs::new_shared_memdisk();
3232

3333
if (not disk->fs_ready()) {
34-
disk->init_fs([](fs::error_t err) {
34+
disk->init_fs([](fs::error_t err, auto&) {
3535
if (err) {
3636
printf("ERROR MOUNTING DISK\n");
3737
printf("%s\n", err.reason().c_str());

test/posix/integration/stat/test_stat_ftw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fs::Disk_ptr& memdisk() {
2929

3030
if (not disk->fs_ready()) {
3131
printf("%s\n", disk->name().c_str());
32-
disk->init_fs([](fs::error_t err) {
32+
disk->init_fs([](fs::error_t err, auto&) {
3333
if (err) {
3434
printf("ERROR MOUNTING DISK\n");
3535
exit(127);

0 commit comments

Comments
 (0)