Skip to content

Commit d588f4f

Browse files
Fix host tests to avoid deprecation warnings
1 parent c3da530 commit d588f4f

File tree

6 files changed

+27
-13
lines changed

6 files changed

+27
-13
lines changed

boards.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4960,15 +4960,15 @@ espinotee.menu.baud.3000000.upload.speed=3000000
49604960
wifinfo.name=WifInfo
49614961
wifinfo.build.board=WIFINFO
49624962
wifinfo.build.variant=wifinfo
4963-
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K SPIFFS)
4963+
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K FS)
49644964
wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07
49654965
wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld
49664966
wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M
49674967
wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096
49684968
wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000
49694969
wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000
49704970
wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376
4971-
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M SPIFFS)
4971+
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M FS)
49724972
wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12
49734973
wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld
49744974
wifinfo.menu.ESPModule.ESP12.build.flash_size=4M

tests/host/common/MockUART.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ uart_do_write_char(const int uart_nr, char c)
8888
}
8989
else
9090
{
91+
#pragma GCC diagnostic push
92+
#pragma GCC diagnostic ignored "-Wunused-result"
9193
write(uart_nr + 1, &c, 1);
94+
#pragma GCC diagnostic pop
9295
w = true;
9396
}
9497
}

tests/host/common/spiffs_mock.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131

3232
#define SPIFFS_FILE_NAME "spiffs.bin"
3333

34+
#pragma GCC diagnostic push
35+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
36+
3437
FS SPIFFS(nullptr);
3538

3639
SpiffsMock::SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage)
@@ -126,3 +129,6 @@ void SpiffsMock::save ()
126129
if (::close(fs) == -1)
127130
fprintf(stderr, "SPIFFS: closing %s: %s\n", m_storage.c_str(), strerror(errno));
128131
}
132+
133+
#pragma GCC diagnostic pop
134+

tests/host/core/test_Print.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@
1616
#include <catch.hpp>
1717
#include <string.h>
1818
#include <FS.h>
19-
#include "../common/spiffs_mock.h"
19+
#include <LittleFS.h>
20+
#include "../common/littlefs_mock.h"
2021
#include <spiffs/spiffs.h>
2122

22-
// Use a SPIFFS file because we can't instantiate a virtual class like Print
23+
// Use a LittleFS file because we can't instantiate a virtual class like Print
2324
TEST_CASE("Print::write overrides all compile properly", "[core][Print]")
2425
{
25-
SPIFFS_MOCK_DECLARE(64, 8, 512, "");
26-
REQUIRE(SPIFFS.begin());
27-
auto p = SPIFFS.open("test.bin", "w");
26+
LITTLEFS_MOCK_DECLARE(64, 8, 512, "");
27+
REQUIRE(LittleFS.begin());
28+
auto p = LittleFS.open("test.bin", "w");
2829
REQUIRE(p);
2930
uint8_t uint8 = 1;
3031
uint16_t uint16 = 2;
@@ -56,7 +57,7 @@ TEST_CASE("Print::write overrides all compile properly", "[core][Print]")
5657
p.write(1);
5758
p.close();
5859

59-
p = SPIFFS.open("test.bin", "r");
60+
p = LittleFS.open("test.bin", "r");
6061
REQUIRE(p);
6162
uint8_t buff[16];
6263
int len = p.read(buff, 16);

tests/host/fs/test_fs.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626

2727

2828
namespace spiffs_test {
29+
#pragma GCC diagnostic push
30+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
31+
2932
#define FSTYPE SPIFFS
3033
#define TESTPRE "SPIFFS - "
3134
#define TESTPAT "[fs]"
@@ -54,6 +57,7 @@ TEST_CASE("SPIFFS checks the config object passed in", "[fs]")
5457
REQUIRE_FALSE(SPIFFS.setConfig(d));
5558
REQUIRE_FALSE(LittleFS.setConfig(l));
5659
}
60+
#pragma GCC diagnostic push
5761

5862
};
5963

tools/boards.txt.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# resetmethod_menu_extra menus for additional reset methods
3030
# crystalfreq/flashfreq_menu: menus for crystal/flash frequency selection
3131
# flashmode_menu: menus for flashmode selection (dio/dout/qio/qout)
32-
# 512K/1M/2M/4M/8M/16M: menus for flash & SPIFFS size
32+
# 512K/1M/2M/4M/8M/16M: menus for flash & FS size
3333
# lwip/lwip2 menus for available lwip versions
3434

3535
from __future__ import print_function
@@ -613,7 +613,7 @@
613613
'~~~~~~~~~~~~~~~~~~~~~~~~~~',
614614
'',
615615
'- Card: "WEMOS D1 Mini Lite"',
616-
'- Flash Size: "1M (512K SPIFFS)"',
616+
'- Flash Size: "1M (512K FS)"',
617617
'- CPU Frequency: "80 Mhz"',
618618
# '- Upload Speed: "230400"',
619619
'',
@@ -696,15 +696,15 @@
696696
'opts': collections.OrderedDict([
697697
( '.build.board', 'WIFINFO' ),
698698
( '.build.variant', 'wifinfo' ),
699-
( '.menu.ESPModule.ESP07192', 'ESP07 (1M/192K SPIFFS)' ),
699+
( '.menu.ESPModule.ESP07192', 'ESP07 (1M/192K FS)' ),
700700
( '.menu.ESPModule.ESP07192.build.board', 'ESP8266_ESP07' ),
701701
( '.menu.ESPModule.ESP07192.build.flash_size', '1M' ),
702702
( '.menu.ESPModule.ESP07192.build.flash_ld', 'eagle.flash.1m192.ld' ),
703703
( '.menu.ESPModule.ESP07192.build.spiffs_start', '0xCB000' ),
704704
( '.menu.ESPModule.ESP07192.build.spiffs_end', '0xFB000' ),
705705
( '.menu.ESPModule.ESP07192.build.spiffs_blocksize', '4096' ),
706706
( '.menu.ESPModule.ESP07192.upload.maximum_size', '827376' ),
707-
( '.menu.ESPModule.ESP12', 'ESP12 (4M/1M SPIFFS)' ),
707+
( '.menu.ESPModule.ESP12', 'ESP12 (4M/1M FS)' ),
708708
( '.menu.ESPModule.ESP12.build.board', 'ESP8266_ESP12' ),
709709
( '.menu.ESPModule.ESP12.build.flash_size', '4M' ),
710710
( '.menu.ESPModule.ESP12.build.flash_ld', 'eagle.flash.4m1m.ld' ),
@@ -1316,7 +1316,7 @@ def flash_map (flashsize_kb, fs_kb = 0):
13161316
else:
13171317
fs_blocksize = 8192
13181318

1319-
# Adjust SPIFFS_end to be a multiple of the block size
1319+
# Adjust FS_end to be a multiple of the block size
13201320
fs_end = fs_blocksize * (int)((fs_end - fs_start)/fs_blocksize) + fs_start;
13211321

13221322
max_ota_size = min(max_upload_size, fs_start / 2) # =(max_upload_size+empty_size)/2

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy