1
- /* * @file add_del.cpp
2
- *
1
+ /*
3
2
* mbed Microcontroller Library
4
3
* Copyright (c) 2006-2016 ARM Limited
5
4
*
15
14
* See the License for the specific language governing permissions and
16
15
* limitations under the License.
17
16
*
18
- * Test cases to add and delete KVs in the CFSTORE.
19
17
*/
18
+
19
+ /* * @file add_del.cpp Test cases to add and delete key-value pairs in the CFSTORE.
20
+ *
21
+ * Please consult the documentation under the test-case functions for
22
+ * a description of the individual test case.
23
+ */
24
+
20
25
#include " mbed.h"
21
26
#include " cfstore_config.h"
22
27
#include " Driver_Common.h"
@@ -70,15 +75,16 @@ static control_t cfstore_add_del_test_00(const size_t call_count)
70
75
return CaseNext;
71
76
}
72
77
73
- /* *
74
- * @brief test to open() a pre-existing key and try to write it, which should fail
78
+ /* * @brief
75
79
*
76
- * @return status code
77
- * ARM_DRIVER_OK, the test passed successfully
78
- * ret < ARM_DRIVER_OK, the test failed with the return code
79
- * supplying more details
80
+ * This test case does the following:
81
+ * - creates a KV.
82
+ * - deletes the KV.
83
+ * - checks that the deleted KV can no longer be found in the store.
84
+ *
85
+ * @return on success returns CaseNext to continue to next test case, otherwise will assert on errors.
80
86
*/
81
- static control_t cfstore_add_del_test_01_end (const size_t call_count)
87
+ control_t cfstore_add_del_test_01_end (const size_t call_count)
82
88
{
83
89
bool bfound = false ;
84
90
int32_t ret = ARM_DRIVER_ERROR;
@@ -135,19 +141,17 @@ static cfstore_kv_data_t cfstore_add_del_test_08_data[] = {
135
141
};
136
142
137
143
138
- /* *
139
- * @brief test to add small number of KVs e.g. 3, and then delete them.
140
- * basic delete test:
141
- * - add key(s)
142
- * - delete key(s)
143
- * - make sure can't find key in cfstore
144
+ /* * @brief
145
+ *
146
+ * This test case adds a small number of KVs (~3), and then delete them.
147
+ * - add key(s)
148
+ * - delete key(s)
149
+ * - make sure can't find key in cfstore
150
+ * - loop over the above a number of times.
144
151
*
145
- * @return status code
146
- * ARM_DRIVER_OK, the test passed successfully
147
- * ret < ARM_DRIVER_OK, the test failed with the return code
148
- * supplying more details
152
+ * @return on success returns CaseNext to continue to next test case, otherwise will assert on errors.
149
153
*/
150
- static control_t cfstore_add_del_test_02_end (const size_t call_count)
154
+ control_t cfstore_add_del_test_02_end (const size_t call_count)
151
155
{
152
156
bool bResult = true ; // We'll do "&=" cumulative checking.
153
157
int32_t ret = ARM_DRIVER_ERROR;
@@ -196,15 +200,14 @@ static control_t cfstore_add_del_test_02_end(const size_t call_count)
196
200
return CaseNext;
197
201
}
198
202
199
- /* *
200
- * @brief add ~50 KVs, and then delete entries at the start, middle and end of sram area
203
+ /* * @brief
201
204
*
202
- * @return status code
203
- * ARM_DRIVER_OK, the test passed successfully
204
- * ret < ARM_DRIVER_OK, the test failed with the return code
205
- * supplying more details
205
+ * This test case adds ~50 KVs, and then delete entries at the start,
206
+ * middle and end of list.
207
+ *
208
+ * @return on success returns CaseNext to continue to next test case, otherwise will assert on errors.
206
209
*/
207
- static control_t cfstore_add_del_test_03_end (const size_t call_count)
210
+ control_t cfstore_add_del_test_03_end (const size_t call_count)
208
211
{
209
212
bool bfound = false ;
210
213
int32_t ret = ARM_DRIVER_ERROR;
@@ -257,15 +260,14 @@ static control_t cfstore_add_del_test_03_end(const size_t call_count)
257
260
}
258
261
259
262
260
- /* *
261
- * @brief test as per test_09 but using delete_all() on all init_1 data.
263
+ /* * @brief
264
+ *
265
+ * This test case is as per test_03 but using delete_all() on all init_1 data.
266
+ * This test case is yet to be implemented.
262
267
*
263
- * @return status code
264
- * ARM_DRIVER_OK, the test passed successfully
265
- * ret < ARM_DRIVER_OK, the test failed with the return code
266
- * supplying more details
268
+ * @return on success returns CaseNext to continue to next test case, otherwise will assert on errors.
267
269
*/
268
- static control_t cfstore_add_del_test_04 (const size_t call_count)
270
+ control_t cfstore_add_del_test_04 (const size_t call_count)
269
271
{
270
272
(void ) call_count;
271
273
/* todo: implement test */
@@ -276,6 +278,7 @@ static control_t cfstore_add_del_test_04(const size_t call_count)
276
278
}
277
279
278
280
281
+ // / @cond CFSTORE_DOXYGEN_DISABLE
279
282
utest::v1::status_t greentea_setup (const size_t number_of_cases)
280
283
{
281
284
GREENTEA_SETUP (100 , " default_auto" );
@@ -303,3 +306,4 @@ int main()
303
306
{
304
307
return !Harness::run (specification);
305
308
}
309
+ // / @endcond
0 commit comments