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

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.