takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dump.cpp Source File

dump.cpp

Go to the documentation of this file.
00001 /*
00002  * mbed Microcontroller Library
00003  * Copyright (c) 2006-2016 ARM Limited
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  *
00017  * Simple tool (implemented as a test case) to dump cfstore contents.
00018  */
00019 
00020 /** @file dump.cpp test binary for dumping CFSTORE configuration.
00021  */
00022 
00023 #include "mbed.h"
00024 #include "cfstore_config.h"
00025 #include "cfstore_test.h"
00026 #include "cfstore_debug.h"
00027 #include "Driver_Common.h"
00028 #include "configuration_store.h"
00029 #include "utest/utest.h"
00030 #include "unity/unity.h"
00031 #include "greentea-client/test_env.h"
00032 #include "cfstore_utest.h"
00033 
00034 #include <stdio.h>
00035 #include <stdlib.h>
00036 #include <string.h>
00037 #include <assert.h>
00038 #include <inttypes.h>
00039 
00040 using namespace utest::v1;
00041 
00042 
00043 control_t cfstore_dump_test_01_end(const size_t call_count)
00044 {
00045     int32_t ret = ARM_DRIVER_ERROR;
00046     ARM_CFSTORE_DRIVER* drv = &cfstore_driver;
00047 
00048     ret = cfstore_test_dump();
00049     if(ret < ARM_DRIVER_OK){
00050         CFSTORE_LOG("Error: failed to dump CFSTORE contents%s", "\n");
00051     }
00052     ret = drv->Uninitialize();
00053     if(ret < ARM_DRIVER_OK){
00054         CFSTORE_LOG("Error: failed to Uninitialize() CFSTORE%s", "\n");
00055     }
00056     return CaseNext;
00057 }
00058 
00059 
00060 /// @cond CFSTORE_DOXYGEN_DISABLE
00061 utest::v1::status_t greentea_setup(const size_t number_of_cases)
00062 {
00063     GREENTEA_SETUP(400, "default_auto");
00064     return greentea_test_setup_handler(number_of_cases);
00065 }
00066 
00067 Case cases[] = {
00068            /*          1         2         3         4         5         6        7  */
00069            /* 1234567890123456789012345678901234567890123456789012345678901234567890 */
00070         Case("DUMP_test_01_start", cfstore_utest_default_start),
00071         Case("DUMP_test_01_end", cfstore_dump_test_01_end),
00072 };
00073 
00074 
00075 /* Declare your test specification with a custom setup handler */
00076 Specification specification(greentea_setup, cases);
00077 
00078 int main()
00079 {
00080     return !Harness::run(specification);
00081 }
00082 /// @endcond
00083