From 6bdd2097e977f612ec1e2f3989169f1c9c721890 Mon Sep 17 00:00:00 2001 From: Ingve Vormestrand Date: Wed, 29 Mar 2017 16:35:55 +0200 Subject: [PATCH 1/3] test: update travis config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ebeaa3b711..541b552669 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,5 +17,5 @@ before_script: - mkdir darwin && cd darwin script: - - cmake .. -DTRAVIS=ON + - cmake .. -DTRAVIS=ON -DEXTRA_TESTS=ON - make VERBOSE=1 && ./unittests --pass From 792541dbaf2838ca754be23669aacbc8dcd9604b Mon Sep 17 00:00:00 2001 From: Ingve Vormestrand Date: Wed, 29 Mar 2017 16:37:44 +0200 Subject: [PATCH 2/3] test: use new memdisk singleton in stat test --- test/posix/integration/stat/ftw_tests.cpp | 2 +- test/posix/integration/stat/test_stat_ftw.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/posix/integration/stat/ftw_tests.cpp b/test/posix/integration/stat/ftw_tests.cpp index cf002bfb70..51d6aec421 100644 --- a/test/posix/integration/stat/ftw_tests.cpp +++ b/test/posix/integration/stat/ftw_tests.cpp @@ -98,7 +98,7 @@ void ftw_tests() printf("Total size: %ld\n", total_size); } -int display_info(const char *fpath, const struct stat *sb, int flag, struct FTW *ftwbuf) +int display_info(const char *fpath, const struct stat *sb, int flag, struct FTW *) { printf("%ld\t%s (%d)\n", sb->st_size, fpath, flag); #ifdef EXTRAVERBOSE diff --git a/test/posix/integration/stat/test_stat_ftw.cpp b/test/posix/integration/stat/test_stat_ftw.cpp index 849e937d6e..024240cc8d 100644 --- a/test/posix/integration/stat/test_stat_ftw.cpp +++ b/test/posix/integration/stat/test_stat_ftw.cpp @@ -24,12 +24,12 @@ int ftw_tests(); int stat_tests(); -fs::Disk_ptr& memdisk() { - static auto disk = fs::new_shared_memdisk(); +fs::Disk& memdisk() { + fs::Disk& disk = fs::memdisk(); - if (not disk->fs_ready()) { - printf("%s\n", disk->name().c_str()); - disk->init_fs([](fs::error_t err, auto&) { + if (not disk.fs_ready()) { + printf("%s\n", disk.name().c_str()); + disk.init_fs([](fs::error_t err, auto&) { if (err) { printf("ERROR MOUNTING DISK\n"); exit(127); @@ -44,7 +44,7 @@ int main() INFO("POSIX stat", "Running tests for POSIX stat"); // mount a disk with contents for testing - auto root = memdisk()->fs().stat("/"); + auto root = memdisk().fs().stat("/"); fs::mount("/mnt/disk", root, "test root"); fs::print_tree(); From 5855dd5dfaf1835f3444d4f8f38cb8635436fdc7 Mon Sep 17 00:00:00 2001 From: Ingve Vormestrand Date: Thu, 30 Mar 2017 10:22:29 +0200 Subject: [PATCH 3/3] examples: print info about dhcp delay for non-dhcp users --- examples/demo_service/service.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/demo_service/service.cpp b/examples/demo_service/service.cpp index 29567cd4a1..10a845f3d3 100644 --- a/examples/demo_service/service.cpp +++ b/examples/demo_service/service.cpp @@ -82,8 +82,10 @@ http::Response handle_request(const http::Request& req) void Service::start(const std::string&) { // DHCP on interface 0 + printf("*** Waiting up to 10 sec. for DHCP... ***\n"); auto& inet = net::Inet4::ifconfig(5.0, [](bool timeout) { if (timeout) { + printf("*** Falling back to static network config ***\n"); // static IP in case DHCP fails net::Inet4::stack().network_config( { 10,0,0,42 }, // IP