@@ -28,52 +28,52 @@ void printFolderContents(Folder dir, int indentation = 0) {
28
28
// Print directories
29
29
for (Folder subdir : directories) {
30
30
for (int i = 0 ; i < indentation; i++) {
31
- printToSerialOrRS485 (" " );
31
+ Serial. print (" " );
32
32
}
33
- printToSerialOrRS485 (" [D] " );
34
- printToSerialOrRS485 (subdir.getPath ());
33
+ Serial. print (" [D] " );
34
+ Serial. print (subdir.getPath ());
35
35
printFolderContents (subdir, indentation + 1 );
36
36
}
37
37
38
38
// Print files
39
39
for (UFile file : files) {
40
40
for (int i = 0 ; i < indentation; i++) {
41
- printToSerialOrRS485 (" " );
41
+ Serial. print (" " );
42
42
}
43
- printToSerialOrRS485 (" [F] " );
44
- printToSerialOrRS485 (file.getPath ());
43
+ Serial. print (" [F] " );
44
+ Serial. print (file.getPath ());
45
45
}
46
46
}
47
47
48
48
49
49
bool testFolderCreation (Folder root) {
50
50
Folder subfolder = root.createSubfolder (" test_folder" );
51
51
if (subfolder.exists ()) {
52
- printToSerialOrRS485 (" \n --- Test creating folder using root.createSubfolder ---" );
53
- printToSerialOrRS485 (" Test creating folder using root.createSubfolder - Success" );
52
+ Serial. print (" \n --- Test creating folder using root.createSubfolder ---" );
53
+ Serial. print (" Test creating folder using root.createSubfolder - Success" );
54
54
subfolder.remove ();
55
55
return true ;
56
56
} else {
57
- printToSerialOrRS485 (" Test creating folder using root.createSubfolder - Failed. Error: " + String (getErrno ()));
57
+ Serial. print (" Test creating folder using root.createSubfolder - Failed. Error: " + String (getErrno ()));
58
58
return false ;
59
59
}
60
60
}
61
61
62
62
bool testFolderRenaming (Folder root) {
63
63
Folder sourceFolder = root.createSubfolder (" source_folder" );
64
64
if (sourceFolder.exists ()) {
65
- printToSerialOrRS485 (" \n --- Test renaming folder ---" );
66
- printToSerialOrRS485 (" Source folder name: " + String (sourceFolder.getPathAsString ()));
65
+ Serial. print (" \n --- Test renaming folder ---" );
66
+ Serial. print (" Source folder name: " + String (sourceFolder.getPathAsString ()));
67
67
if (sourceFolder.rename (" renamed_folder" )) {
68
- printToSerialOrRS485 (" Folder renamed to: " + String (sourceFolder.getPathAsString ()));
68
+ Serial. print (" Folder renamed to: " + String (sourceFolder.getPathAsString ()));
69
69
sourceFolder.remove ();
70
70
return true ;
71
71
} else {
72
- printToSerialOrRS485 (" Folder renaming failed. Error: " + String (getErrno ()));
72
+ Serial. print (" Folder renaming failed. Error: " + String (getErrno ()));
73
73
return false ;
74
74
}
75
75
} else {
76
- printToSerialOrRS485 (" Test folder renaming - Failed. Error: " + String (getErrno ()));
76
+ Serial. print (" Test folder renaming - Failed. Error: " + String (getErrno ()));
77
77
return false ;
78
78
}
79
79
}
@@ -83,24 +83,24 @@ bool testCopyingFolder(Folder root) {
83
83
Folder copyDestination = root.createSubfolder (" copy_destination" );
84
84
85
85
if (sourceFolder.exists ()) {
86
- printToSerialOrRS485 (" \n --- Test copying a folder ---" );
87
- printToSerialOrRS485 (" Source folder name: " + String (sourceFolder.getPathAsString ()));
88
- printToSerialOrRS485 (" Destination folder name: " + String (copyDestination.getPathAsString ()));
86
+ Serial. print (" \n --- Test copying a folder ---" );
87
+ Serial. print (" Source folder name: " + String (sourceFolder.getPathAsString ()));
88
+ Serial. print (" Destination folder name: " + String (copyDestination.getPathAsString ()));
89
89
90
90
91
91
92
92
if (sourceFolder.copyTo (copyDestination, true )) {
93
- printToSerialOrRS485 (" Folder copied successfully!" );
93
+ Serial. print (" Folder copied successfully!" );
94
94
sourceFolder.remove ();
95
95
copyDestination.remove ();
96
96
return true ;
97
97
} else {
98
- printToSerialOrRS485 (" Folder copying failed. Error: " + String (getErrno ()));
98
+ Serial. print (" Folder copying failed. Error: " + String (getErrno ()));
99
99
sourceFolder.remove ();
100
100
return false ;
101
101
}
102
102
} else {
103
- printToSerialOrRS485 (" Test copying a folder - Failed to create source folder. Error: " + String (getErrno ()));
103
+ Serial. print (" Test copying a folder - Failed to create source folder. Error: " + String (getErrno ()));
104
104
return false ;
105
105
}
106
106
}
@@ -112,20 +112,20 @@ bool testMovingFolder(Folder root) {
112
112
Folder moveDestination = root.createSubfolder (" move_destination" );
113
113
114
114
if (sourceFolderMove.exists ()) {
115
- printToSerialOrRS485 (" \n --- Test moving a folder ---" );
116
- printToSerialOrRS485 (" Source folder name: " + String (sourceFolderMove.getPathAsString ()));
117
- printToSerialOrRS485 (" Destination folder name: " + String (moveDestination.getPathAsString ()));
115
+ Serial. print (" \n --- Test moving a folder ---" );
116
+ Serial. print (" Source folder name: " + String (sourceFolderMove.getPathAsString ()));
117
+ Serial. print (" Destination folder name: " + String (moveDestination.getPathAsString ()));
118
118
if (sourceFolderMove.moveTo (moveDestination)) {
119
- printToSerialOrRS485 (" Folder moved successfully!" );
119
+ Serial. print (" Folder moved successfully!" );
120
120
sourceFolderMove.remove ();
121
121
moveDestination.remove ();
122
122
return true ;
123
123
} else {
124
- printToSerialOrRS485 (" Folder moving failed. Error: " + String (getErrno ()));
124
+ Serial. print (" Folder moving failed. Error: " + String (getErrno ()));
125
125
return false ;
126
126
}
127
127
} else {
128
- printToSerialOrRS485 (" Test moving a folder - Failed to create source folder. Error: " + String (getErrno ()));
128
+ Serial. print (" Test moving a folder - Failed to create source folder. Error: " + String (getErrno ()));
129
129
return false ;
130
130
}
131
131
@@ -139,17 +139,17 @@ void runTests(Arduino_UnifiedStorage * storage, String storageType) {
139
139
Folder root = storage->getRootFolder ();
140
140
141
141
142
- printToSerialOrRS485 (" ========= Folder Tests =========" );
142
+ Serial. print (" ========= Folder Tests =========" );
143
143
144
144
testFolderCreation (root);
145
145
testFolderRenaming (root);
146
146
testCopyingFolder (root);
147
147
testMovingFolder (root);
148
148
149
- printToSerialOrRS485 (" ========= FS Contents after Folder Tests =========" );
149
+ Serial. print (" ========= FS Contents after Folder Tests =========" );
150
150
printFolderContents (root);
151
151
storage->unmount ();
152
- printToSerialOrRS485 (" " );
152
+ Serial. print (" " );
153
153
}
154
154
}
155
155
0 commit comments