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