Flavio Lombella / sd-driver
Committer:
coverxit
Date:
Fri May 05 20:07:20 2017 +0000
Revision:
0:f32a15965d96
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
coverxit 0:f32a15965d96 1 /** @file fsfat_test.h
coverxit 0:f32a15965d96 2 *
coverxit 0:f32a15965d96 3 * mbed Microcontroller Library
coverxit 0:f32a15965d96 4 * Copyright (c) 2006-2016 ARM Limited
coverxit 0:f32a15965d96 5 *
coverxit 0:f32a15965d96 6 * Licensed under the Apache License, Version 2.0 (the "License");
coverxit 0:f32a15965d96 7 * you may not use this file except in compliance with the License.
coverxit 0:f32a15965d96 8 * You may obtain a copy of the License at
coverxit 0:f32a15965d96 9 *
coverxit 0:f32a15965d96 10 * http://www.apache.org/licenses/LICENSE-2.0
coverxit 0:f32a15965d96 11 *
coverxit 0:f32a15965d96 12 * Unless required by applicable law or agreed to in writing, software
coverxit 0:f32a15965d96 13 * distributed under the License is distributed on an "AS IS" BASIS,
coverxit 0:f32a15965d96 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
coverxit 0:f32a15965d96 15 * See the License for the specific language governing permissions and
coverxit 0:f32a15965d96 16 * limitations under the License.
coverxit 0:f32a15965d96 17 *
coverxit 0:f32a15965d96 18 * Header file for test support data structures and function API.
coverxit 0:f32a15965d96 19 */
coverxit 0:f32a15965d96 20 #ifndef __FSFAT_TEST_H
coverxit 0:f32a15965d96 21 #define __FSFAT_TEST_H
coverxit 0:f32a15965d96 22
coverxit 0:f32a15965d96 23 #include <stdint.h>
coverxit 0:f32a15965d96 24 #include <stdlib.h>
coverxit 0:f32a15965d96 25 #include <stdbool.h>
coverxit 0:f32a15965d96 26
coverxit 0:f32a15965d96 27 #ifdef __cplusplus
coverxit 0:f32a15965d96 28 extern "C" {
coverxit 0:f32a15965d96 29 #endif
coverxit 0:f32a15965d96 30
coverxit 0:f32a15965d96 31 /* Defines */
coverxit 0:f32a15965d96 32 //#define FSFAT_INIT_1_TABLE_HEAD { "a", ""}
coverxit 0:f32a15965d96 33 #define FSFAT_INIT_1_TABLE_MID_NODE { "/sd/01234567.txt", "abcdefghijklmnopqrstuvwxyz"}
coverxit 0:f32a15965d96 34 //#define FSFAT_INIT_1_TABLE_TAIL { "/sd/fopentst/hello/world/animal/wobbly/dog/foot/backrght.txt", "present"}
coverxit 0:f32a15965d96 35 #define FSFAT_TEST_RW_TABLE_SENTINEL 0xffffffff
coverxit 0:f32a15965d96 36 #define FSFAT_TEST_BYTE_DATA_TABLE_SIZE 256
coverxit 0:f32a15965d96 37 #define FSFAT_UTEST_MSG_BUF_SIZE 256
coverxit 0:f32a15965d96 38 #define FSFAT_UTEST_DEFAULT_TIMEOUT_MS 10000
coverxit 0:f32a15965d96 39 #define FSFAT_MBED_HOSTTEST_TIMEOUT 60
coverxit 0:f32a15965d96 40 #define FSFAT_MAX_FILE_BASENAME 8
coverxit 0:f32a15965d96 41 #define FSFAT_MAX_FILE_EXTNAME 3
coverxit 0:f32a15965d96 42 #define FSFAT_BUF_MAX_LENGTH 64
coverxit 0:f32a15965d96 43 #define FSFAT_FILENAME_MAX_LENGTH 255
coverxit 0:f32a15965d96 44
coverxit 0:f32a15965d96 45
coverxit 0:f32a15965d96 46 /* support macro for make string for utest _MESSAGE macros, which dont support formatted output */
coverxit 0:f32a15965d96 47 #define FSFAT_TEST_UTEST_MESSAGE(_buf, _max_len, _fmt, ...) \
coverxit 0:f32a15965d96 48 do \
coverxit 0:f32a15965d96 49 { \
coverxit 0:f32a15965d96 50 snprintf((_buf), (_max_len), (_fmt), __VA_ARGS__); \
coverxit 0:f32a15965d96 51 }while(0);
coverxit 0:f32a15965d96 52
coverxit 0:f32a15965d96 53
coverxit 0:f32a15965d96 54 /*
coverxit 0:f32a15965d96 55 * Structures
coverxit 0:f32a15965d96 56 */
coverxit 0:f32a15965d96 57
coverxit 0:f32a15965d96 58 /* kv data for test */
coverxit 0:f32a15965d96 59 typedef struct fsfat_kv_data_t {
coverxit 0:f32a15965d96 60 const char* filename;
coverxit 0:f32a15965d96 61 const char* value;
coverxit 0:f32a15965d96 62 } fsfat_kv_data_t;
coverxit 0:f32a15965d96 63
coverxit 0:f32a15965d96 64
coverxit 0:f32a15965d96 65 extern const uint8_t fsfat_test_byte_data_table[FSFAT_TEST_BYTE_DATA_TABLE_SIZE];
coverxit 0:f32a15965d96 66
coverxit 0:f32a15965d96 67 int32_t fsfat_test_create(const char* filename, const char* data, size_t len);
coverxit 0:f32a15965d96 68 int32_t fsfat_test_delete(const char* key_name);
coverxit 0:f32a15965d96 69 int32_t fsfat_test_filename_gen(char* name, const size_t len);
coverxit 0:f32a15965d96 70 #ifdef __cplusplus
coverxit 0:f32a15965d96 71 }
coverxit 0:f32a15965d96 72 #endif
coverxit 0:f32a15965d96 73
coverxit 0:f32a15965d96 74 #endif /* __FSFAT_TEST_H */