Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-os by
cfstore_utest.h
00001 /** @file cfstore_test.h 00002 * 00003 * mbed Microcontroller Library 00004 * Copyright (c) 2006-2016 ARM Limited 00005 * 00006 * Licensed under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 * 00018 * Header file for test support data structures and function API. 00019 */ 00020 #ifndef __CFSTORE_UTEST_H 00021 #define __CFSTORE_UTEST_H 00022 00023 #include "cfstore_debug.h" 00024 #include "cfstore_test.h" 00025 #include <inttypes.h> 00026 00027 using namespace utest::v1; 00028 00029 void cfstore_utest_default_callback(int32_t status, ARM_CFSTORE_OPCODE cmd_code, void *client_context, ARM_CFSTORE_HANDLE handle) 00030 { 00031 (void) status; 00032 (void) client_context; 00033 (void) handle; 00034 00035 CFSTORE_FENTRYLOG("%s:entered: status=%d, cmd_code=%d (%s) handle=%p\n", __func__, (int) status, (int) cmd_code, cfstore_test_opcode_str[cmd_code], handle); 00036 switch(cmd_code) 00037 { 00038 case CFSTORE_OPCODE_INITIALIZE: 00039 case CFSTORE_OPCODE_FLUSH: 00040 case CFSTORE_OPCODE_UNINITIALIZE: 00041 case CFSTORE_OPCODE_CLOSE: 00042 case CFSTORE_OPCODE_CREATE: 00043 case CFSTORE_OPCODE_DELETE: 00044 case CFSTORE_OPCODE_FIND: 00045 case CFSTORE_OPCODE_GET_KEY_NAME: 00046 case CFSTORE_OPCODE_GET_STATUS: 00047 case CFSTORE_OPCODE_GET_VALUE_LEN: 00048 case CFSTORE_OPCODE_OPEN: 00049 case CFSTORE_OPCODE_POWER_CONTROL: 00050 case CFSTORE_OPCODE_READ: 00051 case CFSTORE_OPCODE_RSEEK: 00052 case CFSTORE_OPCODE_WRITE: 00053 default: 00054 CFSTORE_DBGLOG("%s:debug: received asynchronous notification for opcode=%d (%s)", __func__, cmd_code, cmd_code < CFSTORE_OPCODE_MAX ? cfstore_test_opcode_str[cmd_code] : "unknown"); 00055 } 00056 CFSTORE_DBGLOG("%s:about to validate callback\n", __func__); 00057 Harness::validate_callback(); 00058 return; 00059 } 00060 00061 00062 static control_t cfstore_utest_default_start(const size_t call_count) 00063 { 00064 int32_t ret = ARM_DRIVER_ERROR; 00065 ARM_CFSTORE_DRIVER* drv = &cfstore_driver; 00066 char cfstore_utest_msg[CFSTORE_UTEST_MSG_BUF_SIZE]; 00067 00068 CFSTORE_FENTRYLOG("%s:entered\n", __func__); 00069 (void) call_count; 00070 ret = drv->Initialize(cfstore_utest_default_callback, NULL); 00071 CFSTORE_TEST_UTEST_MESSAGE(cfstore_utest_msg, CFSTORE_UTEST_MSG_BUF_SIZE, "%s:Error: failed to initialize CFSTORE (ret=%d)\n", __func__, (int) ret); 00072 TEST_ASSERT_MESSAGE(ret >= ARM_DRIVER_OK, cfstore_utest_msg); 00073 return CaseTimeout(CFSTORE_UTEST_DEFAULT_TIMEOUT_MS); 00074 } 00075 00076 #endif /* __CFSTORE_UTEST_H */
Generated on Tue Jul 12 2022 13:15:34 by
