34
34
#include < stdlib.h> /* rand()*/
35
35
#include < inttypes.h>
36
36
#include < errno.h>
37
- #include < sys/stat.h>
38
37
39
38
using namespace utest ::v1;
40
39
@@ -56,8 +55,6 @@ SDFileSystem sd(PTD6, PTD7, PTD5, PTD4, "sd");
56
55
#elif defined(TARGET_K64F) || defined(TARGET_K66F)
57
56
SDFileSystem sd (PTE3, PTE1, PTE2, PTE4, " sd" );
58
57
/* #define FSFAT_SDCARD_INSTALLED */
59
- /* todo: remove */
60
- #define FSFAT_SDCARD_INSTALLED
61
58
62
59
#elif defined(TARGET_K22F)
63
60
SDFileSystem sd (PTD6, PTD7, PTD5, PTD4, " sd" );
@@ -128,6 +125,16 @@ SDFileSystem sd(p11, p12, p13, p14, "sd");
128
125
#endif
129
126
// / @endcond
130
127
128
+ #ifdef FSFAT_SDCARD_INSTALLED
129
+
130
+ #define FSFAT_FOPEN_TEST_01 fsfat_fopen_test_01
131
+ #define FSFAT_FOPEN_TEST_02 fsfat_fopen_test_02
132
+ #define FSFAT_FOPEN_TEST_03 fsfat_fopen_test_03
133
+ #define FSFAT_FOPEN_TEST_04 fsfat_fopen_test_04
134
+ #define FSFAT_FOPEN_TEST_05 fsfat_fopen_test_05
135
+ #define FSFAT_FOPEN_TEST_06 fsfat_fopen_test_06
136
+ #define FSFAT_FOPEN_TEST_07 fsfat_fopen_test_07
137
+
131
138
132
139
/* support functions */
133
140
@@ -165,7 +172,7 @@ static fsfat_kv_data_t fsfat_fopen_test_01_kv_data[] = {
165
172
*
166
173
* @return On success, this returns the number of components in the filepath Returns number of compoee
167
174
*/
168
- int32_t fsfat_filepath_split (char * filepath, char * parts[], uint32_t num)
175
+ static int32_t fsfat_filepath_split (char * filepath, char * parts[], uint32_t num)
169
176
{
170
177
uint32_t i = 0 ;
171
178
int32_t ret = -1 ;
@@ -231,7 +238,7 @@ int32_t fsfat_filepath_remove_all(char* filepath)
231
238
*
232
239
* @return On success, this returns 0, otherwise < 0 is returned;
233
240
*/
234
- int32_t fsfat_filepath_make_dirs (char * filepath)
241
+ static int32_t fsfat_filepath_make_dirs (char * filepath)
235
242
{
236
243
int32_t i = 0 ;
237
244
int32_t num_parts = 0 ;
@@ -284,7 +291,7 @@ int32_t fsfat_filepath_make_dirs(char* filepath)
284
291
*
285
292
* @return on success returns CaseNext to continue to next test case, otherwise will assert on errors.
286
293
*/
287
- control_t fsfat_fopen_test_01 (const size_t call_count)
294
+ static control_t fsfat_fopen_test_01 (const size_t call_count)
288
295
{
289
296
char * read_buf;
290
297
int32_t ret = 0 ;
@@ -799,6 +806,29 @@ control_t fsfat_fopen_test_07(const size_t call_count)
799
806
800
807
#endif // NOT_DEFINED
801
808
809
+ #else
810
+
811
+ #define FSFAT_FOPEN_TEST_01 fsfat_fopen_test_dummy
812
+ #define FSFAT_FOPEN_TEST_02 fsfat_fopen_test_dummy
813
+ #define FSFAT_FOPEN_TEST_03 fsfat_fopen_test_dummy
814
+ #define FSFAT_FOPEN_TEST_04 fsfat_fopen_test_dummy
815
+ #define FSFAT_FOPEN_TEST_05 fsfat_fopen_test_dummy
816
+ #define FSFAT_FOPEN_TEST_06 fsfat_fopen_test_dummy
817
+ #define FSFAT_FOPEN_TEST_07 fsfat_fopen_test_dummy
818
+
819
+ /* * @brief fsfat_fopen_test_dummy Dummy test case for testing when platform doesnt have an SDCard installed.
820
+ *
821
+ * @return success always
822
+ */
823
+ static control_t fsfat_fopen_test_dummy ()
824
+ {
825
+ printf (" Null test\n " );
826
+ return CaseNext;
827
+ }
828
+
829
+ #endif /* FSFAT_SDCARD_INSTALLED */
830
+
831
+
802
832
// / @cond FSFAT_DOXYGEN_DISABLE
803
833
utest::v1::status_t greentea_setup (const size_t number_of_cases)
804
834
{
@@ -809,15 +839,15 @@ utest::v1::status_t greentea_setup(const size_t number_of_cases)
809
839
Case cases[] = {
810
840
/* 1 2 3 4 5 6 7 */
811
841
/* 1234567890123456789012345678901234567890123456789012345678901234567890 */
812
- Case (" FOPEN_test_01" , fsfat_fopen_test_01 )
842
+ Case (" FOPEN_test_01" , FSFAT_FOPEN_TEST_01 )
813
843
814
844
#ifdef NOT_DEFINED
815
- Case (" FOPEN_test_02" , fsfat_fopen_test_02 ),
816
- Case (" FOPEN_test_03" , fsfat_fopen_test_03 ),
817
- Case (" FOPEN_test_04" , fsfat_fopen_test_04 ),
818
- Case (" FOPEN_test_05" , fsfat_fopen_test_05 ),
819
- Case (" FOPEN_test_06" , fsfat_fopen_test_06 ),
820
- Case (" FOPEN_test_07" , fsfat_fopen_test_07 ),
845
+ Case (" FOPEN_test_02" , FSFAT_FOPEN_TEST_02 ),
846
+ Case (" FOPEN_test_03" , FSFAT_FOPEN_TEST_03 ),
847
+ Case (" FOPEN_test_04" , FSFAT_FOPEN_TEST_04 ),
848
+ Case (" FOPEN_test_05" , FSFAT_FOPEN_TEST_05 ),
849
+ Case (" FOPEN_test_06" , FSFAT_FOPEN_TEST_06 ),
850
+ Case (" FOPEN_test_07" , FSFAT_FOPEN_TEST_07 ),
821
851
#endif // NOT_DEFINED
822
852
823
853
};
0 commit comments