Skip to content

Commit 3c6fd5d

Browse files
authored
Merge pull request #458 from simonqhughes/master
CFSTORE Doxygen documentation improvements
2 parents ad10fc9 + 91a0c0d commit 3c6fd5d

34 files changed

+4504
-1398
lines changed

features/storage/TESTS/cfstore/add_del/add_del.cpp

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/** @file add_del.cpp
2-
*
1+
/*
32
* mbed Microcontroller Library
43
* Copyright (c) 2006-2016 ARM Limited
54
*
@@ -15,8 +14,14 @@
1514
* See the License for the specific language governing permissions and
1615
* limitations under the License.
1716
*
18-
* Test cases to add and delete KVs in the CFSTORE.
1917
*/
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+
2025
#include "mbed.h"
2126
#include "cfstore_config.h"
2227
#include "Driver_Common.h"
@@ -70,15 +75,16 @@ static control_t cfstore_add_del_test_00(const size_t call_count)
7075
return CaseNext;
7176
}
7277

73-
/**
74-
* @brief test to open() a pre-existing key and try to write it, which should fail
78+
/** @brief
7579
*
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.
8086
*/
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)
8288
{
8389
bool bfound = false;
8490
int32_t ret = ARM_DRIVER_ERROR;
@@ -135,19 +141,17 @@ static cfstore_kv_data_t cfstore_add_del_test_08_data[] = {
135141
};
136142

137143

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.
144151
*
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.
149153
*/
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)
151155
{
152156
bool bResult = true; // We'll do "&=" cumulative checking.
153157
int32_t ret = ARM_DRIVER_ERROR;
@@ -196,15 +200,14 @@ static control_t cfstore_add_del_test_02_end(const size_t call_count)
196200
return CaseNext;
197201
}
198202

199-
/**
200-
* @brief add ~50 KVs, and then delete entries at the start, middle and end of sram area
203+
/** @brief
201204
*
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.
206209
*/
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)
208211
{
209212
bool bfound = false;
210213
int32_t ret = ARM_DRIVER_ERROR;
@@ -257,15 +260,14 @@ static control_t cfstore_add_del_test_03_end(const size_t call_count)
257260
}
258261

259262

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.
262267
*
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.
267269
*/
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)
269271
{
270272
(void) call_count;
271273
/*todo: implement test */
@@ -276,6 +278,7 @@ static control_t cfstore_add_del_test_04(const size_t call_count)
276278
}
277279

278280

281+
/// @cond CFSTORE_DOXYGEN_DISABLE
279282
utest::v1::status_t greentea_setup(const size_t number_of_cases)
280283
{
281284
GREENTEA_SETUP(100, "default_auto");
@@ -303,3 +306,4 @@ int main()
303306
{
304307
return !Harness::run(specification);
305308
}
309+
/// @endcond

features/storage/TESTS/cfstore/close/close.cpp

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/*
2-
* @file close.cpp
3-
*
42
* mbed Microcontroller Library
53
* Copyright (c) 2006-2016 ARM Limited
64
*
@@ -15,9 +13,14 @@
1513
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1614
* See the License for the specific language governing permissions and
1715
* limitations under the License.
16+
*/
17+
18+
/** @file close.cpp Test cases to close KVs in the CFSTORE using the drv->Close() API function.
1819
*
19-
* Test cases to close KVs in the CFSTORE using the drv->Cpen() interface.
20+
* Please consult the documentation under the test-case functions for
21+
* a description of the individual test case.
2022
*/
23+
2124
#include "mbed.h"
2225
#include "cfstore_config.h"
2326
#include "Driver_Common.h"
@@ -68,32 +71,26 @@ static control_t cfstore_close_test_00(const size_t call_count)
6871
}
6972

7073

71-
/** @brief basic test
72-
*
73-
* @note
74+
/** @brief
7475
*
75-
* The test does the following:
76-
* 01. create a key with handle hkey1
77-
* 02. write data of hkey
78-
* 03. opens KV with 2nd handle, hkey2
79-
* 04. read data with hkey2 and make sure its the same as that written with hkey1
80-
* 05. write new data with hkey2
81-
* 06. delete hkey2
82-
* 07. close hkey2
83-
* 08. read hkey1 and make sure the data is the newly written data i.e. the key hasnt
76+
* The is a basic test case which does the following:
77+
* - 01. create a key with handle hkey1
78+
* - 02. write data of hkey
79+
* - 03. opens KV with 2nd handle, hkey2
80+
* - 04. read data with hkey2 and make sure its the same as that written with hkey1
81+
* - 05. write new data with hkey2
82+
* - 06. delete hkey2
83+
* - 07. close hkey2
84+
* - 08. read hkey1 and make sure the data is the newly written data i.e. the key hasnt
8485
* been deleted yet
85-
* 09. try to open KV and make sure unable to do so, as KV is deleting
86-
* 10. close hkey1
87-
* 11. try to open KV and make sure unable to do so because its now been deleted
88-
* 12. create new KV with same key_name to make sure can re-create the key again.
89-
*
86+
* - 09. try to open KV and make sure unable to do so, as KV is deleting
87+
* - 10. close hkey1
88+
* - 11. try to open KV and make sure unable to do so because its now been deleted
89+
* - 12. create new KV with same key_name to make sure can re-create the key again.
9090
*
91-
* @return status code
92-
* ARM_DRIVER_OK, the test passed successfully
93-
* ret < ARM_DRIVER_OK, the test failed with the return code
94-
* supplying more details
91+
* @return on success returns CaseNext to continue to next test case, otherwise will assert on errors.
9592
*/
96-
static control_t cfstore_close_test_01_end(const size_t call_count)
93+
control_t cfstore_close_test_01_end(const size_t call_count)
9794
{
9895
char read_buf[CFSTORE_KEY_NAME_MAX_LENGTH];
9996
int32_t ret = ARM_DRIVER_ERROR;
@@ -226,6 +223,7 @@ static control_t cfstore_close_test_01_end(const size_t call_count)
226223
}
227224

228225

226+
/// @cond CFSTORE_DOXYGEN_DISABLE
229227
utest::v1::status_t greentea_setup(const size_t number_of_cases)
230228
{
231229
GREENTEA_SETUP(100, "default_auto");
@@ -248,5 +246,6 @@ int main()
248246
{
249247
return !Harness::run(specification);
250248
}
249+
/// @endcond
251250

252251

0 commit comments

Comments
 (0)