@@ -28,52 +28,52 @@ void printFolderContents(Folder dir, int indentation = 0) {
2828 // Print directories
2929 for (Folder subdir : directories) {
3030 for (int i = 0 ; i < indentation; i++) {
31- printToSerialOrRS485 (" " );
31+ Serial. print (" " );
3232 }
33- printToSerialOrRS485 (" [D] " );
34- printToSerialOrRS485 (subdir.getPath ());
33+ Serial. print (" [D] " );
34+ Serial. print (subdir.getPath ());
3535 printFolderContents (subdir, indentation + 1 );
3636 }
3737
3838 // Print files
3939 for (UFile file : files) {
4040 for (int i = 0 ; i < indentation; i++) {
41- printToSerialOrRS485 (" " );
41+ Serial. print (" " );
4242 }
43- printToSerialOrRS485 (" [F] " );
44- printToSerialOrRS485 (file.getPath ());
43+ Serial. print (" [F] " );
44+ Serial. print (file.getPath ());
4545 }
4646}
4747
4848
4949bool testFolderCreation (Folder root) {
5050 Folder subfolder = root.createSubfolder (" test_folder" );
5151 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" );
5454 subfolder.remove ();
5555 return true ;
5656 } 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 ()));
5858 return false ;
5959 }
6060}
6161
6262bool testFolderRenaming (Folder root) {
6363 Folder sourceFolder = root.createSubfolder (" source_folder" );
6464 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 ()));
6767 if (sourceFolder.rename (" renamed_folder" )) {
68- printToSerialOrRS485 (" Folder renamed to: " + String (sourceFolder.getPathAsString ()));
68+ Serial. print (" Folder renamed to: " + String (sourceFolder.getPathAsString ()));
6969 sourceFolder.remove ();
7070 return true ;
7171 } else {
72- printToSerialOrRS485 (" Folder renaming failed. Error: " + String (getErrno ()));
72+ Serial. print (" Folder renaming failed. Error: " + String (getErrno ()));
7373 return false ;
7474 }
7575 } else {
76- printToSerialOrRS485 (" Test folder renaming - Failed. Error: " + String (getErrno ()));
76+ Serial. print (" Test folder renaming - Failed. Error: " + String (getErrno ()));
7777 return false ;
7878 }
7979}
@@ -83,24 +83,24 @@ bool testCopyingFolder(Folder root) {
8383 Folder copyDestination = root.createSubfolder (" copy_destination" );
8484
8585 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 ()));
8989
9090
9191
9292 if (sourceFolder.copyTo (copyDestination, true )) {
93- printToSerialOrRS485 (" Folder copied successfully!" );
93+ Serial. print (" Folder copied successfully!" );
9494 sourceFolder.remove ();
9595 copyDestination.remove ();
9696 return true ;
9797 } else {
98- printToSerialOrRS485 (" Folder copying failed. Error: " + String (getErrno ()));
98+ Serial. print (" Folder copying failed. Error: " + String (getErrno ()));
9999 sourceFolder.remove ();
100100 return false ;
101101 }
102102 } 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 ()));
104104 return false ;
105105 }
106106}
@@ -112,20 +112,20 @@ bool testMovingFolder(Folder root) {
112112 Folder moveDestination = root.createSubfolder (" move_destination" );
113113
114114 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 ()));
118118 if (sourceFolderMove.moveTo (moveDestination)) {
119- printToSerialOrRS485 (" Folder moved successfully!" );
119+ Serial. print (" Folder moved successfully!" );
120120 sourceFolderMove.remove ();
121121 moveDestination.remove ();
122122 return true ;
123123 } else {
124- printToSerialOrRS485 (" Folder moving failed. Error: " + String (getErrno ()));
124+ Serial. print (" Folder moving failed. Error: " + String (getErrno ()));
125125 return false ;
126126 }
127127 } 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 ()));
129129 return false ;
130130 }
131131
@@ -139,17 +139,17 @@ void runTests(Arduino_UnifiedStorage * storage, String storageType) {
139139 Folder root = storage->getRootFolder ();
140140
141141
142- printToSerialOrRS485 (" ========= Folder Tests =========" );
142+ Serial. print (" ========= Folder Tests =========" );
143143
144144 testFolderCreation (root);
145145 testFolderRenaming (root);
146146 testCopyingFolder (root);
147147 testMovingFolder (root);
148148
149- printToSerialOrRS485 (" ========= FS Contents after Folder Tests =========" );
149+ Serial. print (" ========= FS Contents after Folder Tests =========" );
150150 printFolderContents (root);
151151 storage->unmount ();
152- printToSerialOrRS485 (" " );
152+ Serial. print (" " );
153153 }
154154}
155155
0 commit comments