Toyomasa Watarai / simple-mbed-cloud-client

Dependents:  

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers sanity.cpp Source File

sanity.cpp

00001 // ----------------------------------------------------------------------------
00002 // Copyright 2016-2017 ARM Ltd.
00003 //
00004 // SPDX-License-Identifier: Apache-2.0
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 
00019 #include <greentea-client/test_env.h>
00020 #include <utest/utest.h>
00021 #include <unity/unity.h>
00022 
00023 #include "pal4life-device-identity/pal_device_identity.h"
00024 
00025 using namespace utest::v1;
00026 
00027 void print_guid(const arm_uc_guid_t* guid)
00028 {
00029     for (size_t index = 0; index  < sizeof(arm_uc_guid_t); index++)
00030     {
00031         printf("%02X", ((uint8_t*)guid)[index]);
00032     }
00033     printf("\r\n");
00034 }
00035 
00036 void test_unit()
00037 {
00038     arm_uc_guid_t guid = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
00039                            0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F };
00040 
00041     print_guid(&guid);
00042 }
00043 
00044 Case cases[] = {
00045     Case("test_init", test_unit)
00046 };
00047 
00048 Specification specification(cases, verbose_continue_handlers);
00049 
00050 #if defined(TARGET_LIKE_MBED)
00051 int main()
00052 #elif defined(TARGET_LIKE_POSIX)
00053 void app_start(int argc __unused, char** argv __unused)
00054 #endif
00055 {
00056     // Run the test specification
00057     Harness::run(specification);
00058 }