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