Skip to content

Commit f4790ce

Browse files
authored
Merge pull request ARMmbed#437 from simonqhughes/master
Configuration-Store Test Case Additions/Improvements with Associated Fixes
2 parents 3bae74c + dde89c4 commit f4790ce

File tree

28 files changed

+1672
-1487
lines changed

28 files changed

+1672
-1487
lines changed

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

Lines changed: 9 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -17,65 +17,7 @@
1717
*
1818
* Test cases to add and delete KVs in the CFSTORE.
1919
*/
20-
#if defined __MBED__ && ! defined TOOLCHAIN_GCC_ARM
21-
22-
23-
#include "mbed-drivers/mbed.h"
24-
#include "cfstore_config.h"
25-
#include "Driver_Common.h"
26-
#include "cfstore_debug.h"
27-
#include "cfstore_test.h"
28-
#include "configuration_store.h"
29-
#include "utest/utest.h"
30-
#include "unity/unity.h"
31-
#include "greentea-client/test_env.h"
32-
33-
#ifdef YOTTA_CFG_CFSTORE_UVISOR
34-
#include "uvisor-lib/uvisor-lib.h"
35-
#include "cfstore_uvisor.h"
36-
#endif /* YOTTA_CFG_CFSTORE_UVISOR */
37-
38-
#include <stdio.h>
39-
#include <stdlib.h>
40-
#include <string.h>
41-
#include <inttypes.h>
42-
43-
using namespace utest::v1;
44-
45-
static control_t cfstore_add_del_test_00(const size_t call_count)
46-
{
47-
(void) call_count;
48-
printf("Not implemented for ARM toolchain\n");
49-
return CaseNext;
50-
}
51-
52-
53-
utest::v1::status_t greentea_setup(const size_t number_of_cases)
54-
{
55-
GREENTEA_SETUP(100, "default_auto");
56-
return greentea_test_setup_handler(number_of_cases);
57-
}
58-
59-
Case cases[] = {
60-
/* 1 2 3 4 5 6 7 */
61-
/* 1234567890123456789012345678901234567890123456789012345678901234567890 */
62-
Case("ADD_DEL_test_00", cfstore_add_del_test_00),
63-
};
64-
65-
66-
/* Declare your test specification with a custom setup handler */
67-
Specification specification(greentea_setup, cases);
68-
69-
int main()
70-
{
71-
return !Harness::run(specification);
72-
}
73-
74-
75-
#else
76-
77-
78-
#include "mbed-drivers/mbed.h"
20+
#include "mbed.h"
7921
#include "cfstore_config.h"
8022
#include "Driver_Common.h"
8123
#include "cfstore_debug.h"
@@ -85,6 +27,7 @@ int main()
8527
#include "unity/unity.h"
8628
#include "greentea-client/test_env.h"
8729
#include "cfstore_utest.h"
30+
8831
#ifdef YOTTA_CFG_CFSTORE_UVISOR
8932
#include "uvisor-lib/uvisor-lib.h"
9033
#include "cfstore_uvisor.h"
@@ -154,12 +97,12 @@ static control_t cfstore_add_del_test_01_end(const size_t call_count)
15497
len = strlen(cfstore_add_del_test_07_data[0].value);
15598

15699
ret = cfstore_test_create(cfstore_add_del_test_07_data[0].key_name, (char*) cfstore_add_del_test_07_data[0].value, &len, &kdesc);
157-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to create KV in store (ret=%" PRId32 ").\n", __func__, ret);
100+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to create KV in store (ret=%d).\n", __func__, (int) ret);
158101
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_add_del_utest_msg_g);
159102

160103
/* now delete KV*/
161104
ret = drv->Open(cfstore_add_del_test_07_data[0].key_name, flags, hkey);
162-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to Open() (ret=%" PRId32 ").\n", __func__, ret);
105+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to Open() (ret=%d).\n", __func__, (int) ret);
163106
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_add_del_utest_msg_g);
164107

165108
if(hkey != NULL){
@@ -171,7 +114,7 @@ static control_t cfstore_add_del_test_01_end(const size_t call_count)
171114
/* revert to CFSTORE_LOG if more trace required */
172115
CFSTORE_DBGLOG("LOG: WARNING: About to look for non-existent key (key_name=%s) (which will generate internal trace reporting errors if debug trace enabled).\n", cfstore_add_del_test_07_data[0].key_name);
173116
ret = cfstore_test_kv_is_found(cfstore_add_del_test_07_data[0].key_name, &bfound);
174-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error failed to delete a key (ret=%" PRId32 ").\n", __func__, ret);
117+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error failed to delete a key (ret=%d).\n", __func__, (int) ret);
175118
TEST_ASSERT_MESSAGE(ret == ARM_CFSTORE_DRIVER_ERROR_KEY_NOT_FOUND, cfstore_add_del_utest_msg_g);
176119

177120
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Test failed: found KV that was previously deleted (key_name=%s)\n", __func__, cfstore_add_del_test_07_data[0].key_name);
@@ -283,7 +226,7 @@ static control_t cfstore_add_del_test_03_end(const size_t call_count)
283226
{
284227
CFSTORE_DBGLOG("%s:about to delete key (key_name=%s).\n", __func__, node->key_name);
285228
cfstore_test_delete(node->key_name);
286-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error failed to delete a key (ret=%" PRId32 ").\n", __func__, ret);
229+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error failed to delete a key (ret=%d).\n", __func__, (int) ret);
287230
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_add_del_utest_msg_g);
288231
/* revert CFSTORE_LOG for more trace */
289232
CFSTORE_DBGLOG("Deleted KV successfully (key_name=\"%s\")\n", node->key_name);
@@ -294,7 +237,7 @@ static control_t cfstore_add_del_test_03_end(const size_t call_count)
294237
while(node->key_name != NULL)
295238
{
296239
ret = cfstore_test_kv_is_found(node->key_name, &bfound);
297-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to delete a key (ret=%" PRId32 ").\n", __func__, ret);
240+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to delete a key (ret=%d).\n", __func__, (int) ret);
298241
TEST_ASSERT_MESSAGE(ret == ARM_CFSTORE_DRIVER_ERROR_KEY_NOT_FOUND, cfstore_add_del_utest_msg_g);
299242

300243
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Test failed: found KV that was previously deleted (key_name=%s)\n", __func__, node->key_name);
@@ -304,11 +247,11 @@ static control_t cfstore_add_del_test_03_end(const size_t call_count)
304247

305248
/* clean up by deleting all remaining KVs. this is not part of the test */
306249
ret = cfstore_test_delete_all();
307-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error failed to delete a all KVs (ret=%" PRId32 ").\n", __func__, ret);
250+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error failed to delete a all KVs (ret=%d).\n", __func__, (int) ret);
308251
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_add_del_utest_msg_g);
309252

310253
ret = drv->Uninitialize();
311-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to initialize CFSTORE (ret=%" PRId32 ")\n", __func__, ret);
254+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_add_del_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to initialize CFSTORE (ret=%d)\n", __func__, (int) ret);
312255
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_add_del_utest_msg_g);
313256
return CaseNext;
314257
}
@@ -356,22 +299,7 @@ Case cases[] = {
356299
/* Declare your test specification with a custom setup handler */
357300
Specification specification(greentea_setup, cases);
358301

359-
#if defined CFSTORE_CONFIG_MBED_OS_VERSION && CFSTORE_CONFIG_MBED_OS_VERSION == 3
360-
/* mbedosV3*/
361-
void app_start(int argc __unused, char** argv __unused)
362-
{
363-
/* Run the test specification */
364-
Harness::run(specification);
365-
}
366-
#endif /* CFSTORE_CONFIG_MBED_OS_VERSION == 3 */
367-
368-
#if defined CFSTORE_CONFIG_MBED_OS_VERSION && CFSTORE_CONFIG_MBED_OS_VERSION == 4
369-
/* mbedosV3++*/
370302
int main()
371303
{
372304
return !Harness::run(specification);
373305
}
374-
#endif /* CFSTORE_CONFIG_MBED_OS_VERSION == 4 */
375-
376-
377-
#endif // __MBED__ && ! defined TOOLCHAIN_GCC_ARM

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

Lines changed: 15 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -18,64 +18,7 @@
1818
*
1919
* Test cases to close KVs in the CFSTORE using the drv->Cpen() interface.
2020
*/
21-
#if defined __MBED__ && ! defined TOOLCHAIN_GCC_ARM
22-
23-
24-
#include "mbed-drivers/mbed.h"
25-
#include "cfstore_config.h"
26-
#include "Driver_Common.h"
27-
#include "cfstore_debug.h"
28-
#include "cfstore_test.h"
29-
#include "configuration_store.h"
30-
#include "utest/utest.h"
31-
#include "unity/unity.h"
32-
#include "greentea-client/test_env.h"
33-
#ifdef YOTTA_CFG_CFSTORE_UVISOR
34-
#include "uvisor-lib/uvisor-lib.h"
35-
#include "cfstore_uvisor.h"
36-
#endif /* YOTTA_CFG_CFSTORE_UVISOR */
37-
38-
#include <stdio.h>
39-
#include <stdlib.h>
40-
#include <string.h>
41-
#include <inttypes.h>
42-
43-
using namespace utest::v1;
44-
45-
static control_t cfstore_close_test_00(const size_t call_count)
46-
{
47-
(void) call_count;
48-
printf("Not implemented for ARM toolchain\n");
49-
return CaseNext;
50-
}
51-
52-
53-
utest::v1::status_t greentea_setup(const size_t number_of_cases)
54-
{
55-
GREENTEA_SETUP(100, "default_auto");
56-
return greentea_test_setup_handler(number_of_cases);
57-
}
58-
59-
Case cases[] = {
60-
/* 1 2 3 4 5 6 7 */
61-
/* 1234567890123456789012345678901234567890123456789012345678901234567890 */
62-
Case("CLOSE_test_00", cfstore_close_test_00),
63-
};
64-
65-
66-
/* Declare your test specification with a custom setup handler */
67-
Specification specification(greentea_setup, cases);
68-
69-
int main()
70-
{
71-
return !Harness::run(specification);
72-
}
73-
74-
75-
#else
76-
77-
78-
#include "mbed-drivers/mbed.h"
21+
#include "mbed.h"
7922
#include "cfstore_config.h"
8023
#include "Driver_Common.h"
8124
#include "configuration_store.h"
@@ -85,6 +28,7 @@ int main()
8528
#include "unity/unity.h"
8629
#include "greentea-client/test_env.h"
8730
#include "cfstore_utest.h"
31+
8832
#ifdef YOTTA_CFG_CFSTORE_UVISOR
8933
#include "uvisor-lib/uvisor-lib.h"
9034
#endif /* YOTTA_CFG_CFSTORE_UVISOR */
@@ -172,14 +116,14 @@ static control_t cfstore_close_test_01_end(const size_t call_count)
172116
kdesc.drl = ARM_RETENTION_WHILE_DEVICE_ACTIVE;
173117
CFSTORE_DBGLOG("%s:About to create new node (key_name=\"%s\", value=\"%s\")\n", __func__, node->key_name, node->value);
174118
ret = drv->Create(node->key_name, strlen(node->value), &kdesc, hkey1);
175-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to create node (key_name=\"%s\", value=\"%s\")(ret=%" PRId32 ")\n", __func__, node->key_name, node->value, ret);
119+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to create node (key_name=\"%s\", value=\"%s\")(ret=%d)\n", __func__, node->key_name, node->value, (int) ret);
176120
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_close_utest_msg_g);
177121
CFSTORE_DBGLOG("%s:length of KV=%d (key_name=\"%s\", value=\"%s\")\n", __func__, (int) len, node->key_name, node->value);
178122

179123
/* step 02 */
180124
len = strlen(node->value);
181125
ret = drv->Write(hkey1, (char*) node->value, &len);
182-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to write key (key_name=\"%s\", value=\"%s\")(ret=%" PRId32 ")\n", __func__, node->key_name, node->value, ret);
126+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to write key (key_name=\"%s\", value=\"%s\")(ret=%d)\n", __func__, node->key_name, node->value, (int) ret);
183127
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_close_utest_msg_g);
184128

185129
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to write full value data (key_name=\"%s\", value=\"%s\"), len=%d, (ret=%d)\n", __func__, node->key_name, node->value, (int) len, (int) ret);
@@ -191,7 +135,7 @@ static control_t cfstore_close_test_01_end(const size_t call_count)
191135
flags.read = true;
192136
flags.write = true;
193137
ret = drv->Open(node->key_name, flags, hkey2);
194-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to open node (key_name=\"%s\", value=\"%s\")(ret=%" PRId32 ")\n", __func__, node->key_name, node->value, ret);
138+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to open node (key_name=\"%s\", value=\"%s\")(ret=%d)\n", __func__, node->key_name, node->value, (int) ret);
195139
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_close_utest_msg_g);
196140
len = strlen(node->value) + 1;
197141
/* revert to CFSTORE_LOG if more trace required */
@@ -210,22 +154,22 @@ static control_t cfstore_close_test_01_end(const size_t call_count)
210154
node = &cfstore_close_test_01_kv_data[1];
211155
len = strlen(node->value);
212156
ret = drv->Write(hkey2, (char*) node->value, &len);
213-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to write key with 2nd handle (key_name=\"%s\", value=\"%s\")(ret=%" PRId32 ")\n", __func__, node->key_name, node->value, ret);
157+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to write key with 2nd handle (key_name=\"%s\", value=\"%s\")(ret=%d)\n", __func__, node->key_name, node->value, (int) ret);
214158
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_close_utest_msg_g);
215159

216-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to write full value data (key_name=\"%s\", value=\"%s\"), len=%d, (ret=%" PRId32 ")\n", __func__, node->key_name, node->value, (int) len, ret);
160+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to write full value data (key_name=\"%s\", value=\"%s\"), len=%d, (ret=%d)\n", __func__, node->key_name, node->value, (int) len, (int) ret);
217161
TEST_ASSERT_MESSAGE(len == strlen(node->value), cfstore_close_utest_msg_g);
218162
/* revert to CFSTORE_LOG if more trace required */
219163
CFSTORE_DBGLOG("Wrote KV successfully with new data (key_name=\"%s\", value=\"%s\")\n", node->key_name, node->value);
220164

221165
/* step 06 delete hkey2 */
222166
ret = drv->Delete(hkey2);
223-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to Delete KV with 2nd handle (key_name=\"%s\", value=\"%s\")(ret=%" PRId32 ")\n", __func__, node->key_name, node->value, ret);
167+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to Delete KV with 2nd handle (key_name=\"%s\", value=\"%s\")(ret=%d)\n", __func__, node->key_name, node->value, (int) ret);
224168
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_close_utest_msg_g);
225169

226170
/* step 07 close hkey2 */
227171
ret = drv->Close(hkey2);
228-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to Close KV with 2nd handle (key_name=\"%s\", value=\"%s\")(ret=%" PRId32 ")\n", __func__, node->key_name, node->value, ret);
172+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to Close KV with 2nd handle (key_name=\"%s\", value=\"%s\")(ret=%d)\n", __func__, node->key_name, node->value, (int) ret);
229173
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_close_utest_msg_g);
230174

231175
/* step 08 read hkey1 for updated data */
@@ -241,17 +185,17 @@ static control_t cfstore_close_test_01_end(const size_t call_count)
241185

242186
/* step 09 */
243187
ret = drv->Open(node->key_name, flags, hkey2);
244-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: Should not be able to open pre-existing key in deleting state (key_name=\"%s\", value=\"%s\")(ret=%" PRId32 ")\n", __func__, node->key_name, node->value, ret);
188+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: Should not be able to open pre-existing key in deleting state (key_name=\"%s\", value=\"%s\")(ret=%d)\n", __func__, node->key_name, node->value, (int) ret);
245189
TEST_ASSERT_MESSAGE(ret == ARM_CFSTORE_DRIVER_ERROR_PREEXISTING_KEY_DELETING || ret == ARM_CFSTORE_DRIVER_ERROR_KEY_NOT_FOUND, cfstore_close_utest_msg_g);
246190

247191
/* step 10 close hkey1 */
248192
ret = drv->Close(hkey1);
249-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to Close KV with 1st handle (key_name=\"%s\", value=\"%s\")(ret=%" PRId32 ")\n", __func__, node->key_name, node->value, ret);
193+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to Close KV with 1st handle (key_name=\"%s\", value=\"%s\")(ret=%d)\n", __func__, node->key_name, node->value, (int) ret);
250194
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_close_utest_msg_g);
251195

252196
/* step 11 try to open KV and make sure unable to do so because its now been deleted */
253197
ret = drv->Open(node->key_name, flags, hkey1);
254-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: Should not be able to open key as it should not be present in the CFSTORE (key_name=\"%s\", value=\"%s\")(ret=%" PRId32 ")\n", __func__, node->key_name, node->value, ret);
198+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: Should not be able to open key as it should not be present in the CFSTORE (key_name=\"%s\", value=\"%s\")(ret=%d)\n", __func__, node->key_name, node->value, (int) ret);
255199
TEST_ASSERT_MESSAGE(ret == ARM_CFSTORE_DRIVER_ERROR_KEY_NOT_FOUND, cfstore_close_utest_msg_g);
256200

257201
/* step 12. create new KV with same key_name to make sure can re-create the key again. */
@@ -260,16 +204,16 @@ static control_t cfstore_close_test_01_end(const size_t call_count)
260204
kdesc.drl = ARM_RETENTION_WHILE_DEVICE_ACTIVE;
261205
CFSTORE_DBGLOG("%s:About to create new node (key_name=\"%s\", value=\"%s\")\n", __func__, node->key_name, node->value);
262206
ret = drv->Create(node->key_name, strlen(node->value), &kdesc, hkey1);
263-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to create node (key_name=\"%s\", value=\"%s\")(ret=%" PRId32 ")\n", __func__, node->key_name, node->value, ret);
207+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to create node (key_name=\"%s\", value=\"%s\")(ret=%d)\n", __func__, node->key_name, node->value, (int) ret);
264208
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_close_utest_msg_g);
265209
CFSTORE_DBGLOG("%s:length of KV=%d (key_name=\"%s\", value=\"%s\")\n", __func__, (int) len, node->key_name, node->value);
266210

267211
len = strlen(node->value);
268212
ret = drv->Write(hkey1, (char*) node->value, &len);
269-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to write key (key_name=\"%s\", value=\"%s\")(ret=%" PRId32 ")\n", __func__, node->key_name, node->value, ret);
213+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to write key (key_name=\"%s\", value=\"%s\")(ret=%d)\n", __func__, node->key_name, node->value, (int) ret);
270214
TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_close_utest_msg_g);
271215

272-
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to write full value data (key_name=\"%s\", value=\"%s\"), len=%d, (ret=%" PRId32 ")\n", __func__, node->key_name, node->value, (int) len, ret);
216+
CFSTORE_TEST_UTEST_MESSAGE(cfstore_close_utest_msg_g, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to write full value data (key_name=\"%s\", value=\"%s\"), len=%d, (ret=%d)\n", __func__, node->key_name, node->value, (int) len, (int) ret);
273217
TEST_ASSERT_MESSAGE(len == strlen(node->value), cfstore_close_utest_msg_g);
274218

275219
/* revert to CFSTORE_LOG if more trace required */
@@ -300,22 +244,9 @@ Case cases[] = {
300244
/* Declare your test specification with a custom setup handler */
301245
Specification specification(greentea_setup, cases);
302246

303-
#if defined CFSTORE_CONFIG_MBED_OS_VERSION && CFSTORE_CONFIG_MBED_OS_VERSION == 3
304-
/* mbedosV3*/
305-
void app_start(int argc __unused, char** argv __unused)
306-
{
307-
/* Run the test specification */
308-
Harness::run(specification);
309-
}
310-
#endif /* CFSTORE_CONFIG_MBED_OS_VERSION == 3 */
311-
312-
#if defined CFSTORE_CONFIG_MBED_OS_VERSION && CFSTORE_CONFIG_MBED_OS_VERSION == 4
313-
/* mbedosV3++*/
314247
int main()
315248
{
316249
return !Harness::run(specification);
317250
}
318-
#endif /* CFSTORE_CONFIG_MBED_OS_VERSION == 4 */
319251

320252

321-
#endif // __MBED__ && ! defined TOOLCHAIN_GCC_ARM

0 commit comments

Comments
 (0)