Skip to content

Commit 65ec2f8

Browse files
committed
Update tests
1 parent da9f39a commit 65ec2f8

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

tests/device/test_FS/test_FS.ino

+10-3
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,15 @@ TEST_CASE("A bunch of files show up in openDir, and can be removed", "[fs]")
3939
const int n = 10;
4040
int found[n] = {0};
4141

42+
{
43+
Dir root = SPIFFS.openDir("");
44+
while (root.next()) {
45+
CHECK(SPIFFS.remove(root.fileName()));
46+
}
47+
}
48+
4249
for (int i = 0; i < n; ++i) {
43-
String name = "seq_";
50+
String name = "/seq_";
4451
name += i;
4552
name += ".txt";
4653

@@ -54,8 +61,8 @@ TEST_CASE("A bunch of files show up in openDir, and can be removed", "[fs]")
5461
Dir root = SPIFFS.openDir("/");
5562
while (root.next()) {
5663
String fileName = root.fileName();
57-
CHECK(fileName.indexOf("seq_") == 0);
58-
int i = fileName.substring(4).toInt();
64+
CHECK(fileName.indexOf("/seq_") == 0);
65+
int i = fileName.substring(5).toInt();
5966
CHECK(i >= 0 && i < n);
6067
found[i]++;
6168
}

tests/device/test_http_client/test_http_client.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ TEST_CASE("HTTPS GET request", "[HTTPClient]")
7878
{
7979
// request which returns 8000 bytes
8080
HTTPClient http;
81-
http.begin(SERVER_IP, 8088, "/data?size=8000", fp);
81+
http.begin(SERVER_IP, 8088, "/data?size=4000", fp);
8282
auto httpCode = http.GET();
8383
REQUIRE(httpCode == HTTP_CODE_OK);
8484
String payload = http.getString();
8585
auto len = payload.length();
86-
REQUIRE(len == 8000);
86+
REQUIRE(len == 4000);
8787
for (int i = 0; i < len; ++i) {
8888
if (payload[i] != 'a') {
8989
REQUIRE(false);

0 commit comments

Comments
 (0)