Ram Gandikota
/
metronome
FRDM K64F Metronome
mbed-client/test/mbedclient/utest/m2mnsdlinterface/m2mnsdlinterfacetest.cpp@0:a2cb7295a1f7, 2017-05-14 (annotated)
- Committer:
- ram54288
- Date:
- Sun May 14 18:35:07 2017 +0000
- Revision:
- 0:a2cb7295a1f7
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ram54288 | 0:a2cb7295a1f7 | 1 | /* |
ram54288 | 0:a2cb7295a1f7 | 2 | * Copyright (c) 2015 ARM Limited. All rights reserved. |
ram54288 | 0:a2cb7295a1f7 | 3 | * SPDX-License-Identifier: Apache-2.0 |
ram54288 | 0:a2cb7295a1f7 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
ram54288 | 0:a2cb7295a1f7 | 5 | * not use this file except in compliance with the License. |
ram54288 | 0:a2cb7295a1f7 | 6 | * You may obtain a copy of the License at |
ram54288 | 0:a2cb7295a1f7 | 7 | * |
ram54288 | 0:a2cb7295a1f7 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
ram54288 | 0:a2cb7295a1f7 | 9 | * |
ram54288 | 0:a2cb7295a1f7 | 10 | * Unless required by applicable law or agreed to in writing, software |
ram54288 | 0:a2cb7295a1f7 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
ram54288 | 0:a2cb7295a1f7 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
ram54288 | 0:a2cb7295a1f7 | 13 | * See the License for the specific language governing permissions and |
ram54288 | 0:a2cb7295a1f7 | 14 | * limitations under the License. |
ram54288 | 0:a2cb7295a1f7 | 15 | */ |
ram54288 | 0:a2cb7295a1f7 | 16 | //CppUTest includes should be after your and system includes |
ram54288 | 0:a2cb7295a1f7 | 17 | #include "CppUTest/TestHarness.h" |
ram54288 | 0:a2cb7295a1f7 | 18 | #include "test_m2mnsdlinterface.h" |
ram54288 | 0:a2cb7295a1f7 | 19 | |
ram54288 | 0:a2cb7295a1f7 | 20 | TEST_GROUP(M2MNsdlInterface) |
ram54288 | 0:a2cb7295a1f7 | 21 | { |
ram54288 | 0:a2cb7295a1f7 | 22 | Test_M2MNsdlInterface* m2m_nsdl_interface; |
ram54288 | 0:a2cb7295a1f7 | 23 | |
ram54288 | 0:a2cb7295a1f7 | 24 | void setup() |
ram54288 | 0:a2cb7295a1f7 | 25 | { |
ram54288 | 0:a2cb7295a1f7 | 26 | m2m_nsdl_interface = new Test_M2MNsdlInterface(); |
ram54288 | 0:a2cb7295a1f7 | 27 | } |
ram54288 | 0:a2cb7295a1f7 | 28 | void teardown() |
ram54288 | 0:a2cb7295a1f7 | 29 | { |
ram54288 | 0:a2cb7295a1f7 | 30 | delete m2m_nsdl_interface; |
ram54288 | 0:a2cb7295a1f7 | 31 | m2m_nsdl_interface = NULL; |
ram54288 | 0:a2cb7295a1f7 | 32 | } |
ram54288 | 0:a2cb7295a1f7 | 33 | }; |
ram54288 | 0:a2cb7295a1f7 | 34 | |
ram54288 | 0:a2cb7295a1f7 | 35 | TEST(M2MNsdlInterface, create) |
ram54288 | 0:a2cb7295a1f7 | 36 | { |
ram54288 | 0:a2cb7295a1f7 | 37 | CHECK(m2m_nsdl_interface->nsdl != NULL); |
ram54288 | 0:a2cb7295a1f7 | 38 | } |
ram54288 | 0:a2cb7295a1f7 | 39 | |
ram54288 | 0:a2cb7295a1f7 | 40 | TEST(M2MNsdlInterface, memory_free) |
ram54288 | 0:a2cb7295a1f7 | 41 | { |
ram54288 | 0:a2cb7295a1f7 | 42 | m2m_nsdl_interface->test_memory_free(); |
ram54288 | 0:a2cb7295a1f7 | 43 | } |
ram54288 | 0:a2cb7295a1f7 | 44 | |
ram54288 | 0:a2cb7295a1f7 | 45 | TEST(M2MNsdlInterface, memory_alloc) |
ram54288 | 0:a2cb7295a1f7 | 46 | { |
ram54288 | 0:a2cb7295a1f7 | 47 | m2m_nsdl_interface->test_memory_alloc(); |
ram54288 | 0:a2cb7295a1f7 | 48 | } |
ram54288 | 0:a2cb7295a1f7 | 49 | |
ram54288 | 0:a2cb7295a1f7 | 50 | TEST(M2MNsdlInterface, send_unregister_message) |
ram54288 | 0:a2cb7295a1f7 | 51 | { |
ram54288 | 0:a2cb7295a1f7 | 52 | m2m_nsdl_interface->test_send_unregister_message(); |
ram54288 | 0:a2cb7295a1f7 | 53 | } |
ram54288 | 0:a2cb7295a1f7 | 54 | |
ram54288 | 0:a2cb7295a1f7 | 55 | TEST(M2MNsdlInterface, send_update_registration) |
ram54288 | 0:a2cb7295a1f7 | 56 | { |
ram54288 | 0:a2cb7295a1f7 | 57 | m2m_nsdl_interface->test_send_update_registration(); |
ram54288 | 0:a2cb7295a1f7 | 58 | } |
ram54288 | 0:a2cb7295a1f7 | 59 | |
ram54288 | 0:a2cb7295a1f7 | 60 | TEST(M2MNsdlInterface, send_register_message) |
ram54288 | 0:a2cb7295a1f7 | 61 | { |
ram54288 | 0:a2cb7295a1f7 | 62 | m2m_nsdl_interface->test_send_register_message(); |
ram54288 | 0:a2cb7295a1f7 | 63 | } |
ram54288 | 0:a2cb7295a1f7 | 64 | |
ram54288 | 0:a2cb7295a1f7 | 65 | TEST(M2MNsdlInterface, create_bootstrap_resource) |
ram54288 | 0:a2cb7295a1f7 | 66 | { |
ram54288 | 0:a2cb7295a1f7 | 67 | m2m_nsdl_interface->test_create_bootstrap_resource(); |
ram54288 | 0:a2cb7295a1f7 | 68 | } |
ram54288 | 0:a2cb7295a1f7 | 69 | |
ram54288 | 0:a2cb7295a1f7 | 70 | TEST(M2MNsdlInterface, delete_nsdl_resource) |
ram54288 | 0:a2cb7295a1f7 | 71 | { |
ram54288 | 0:a2cb7295a1f7 | 72 | m2m_nsdl_interface->test_delete_nsdl_resource(); |
ram54288 | 0:a2cb7295a1f7 | 73 | } |
ram54288 | 0:a2cb7295a1f7 | 74 | |
ram54288 | 0:a2cb7295a1f7 | 75 | TEST(M2MNsdlInterface, delete_endpoint) |
ram54288 | 0:a2cb7295a1f7 | 76 | { |
ram54288 | 0:a2cb7295a1f7 | 77 | m2m_nsdl_interface->test_delete_endpoint(); |
ram54288 | 0:a2cb7295a1f7 | 78 | } |
ram54288 | 0:a2cb7295a1f7 | 79 | |
ram54288 | 0:a2cb7295a1f7 | 80 | TEST(M2MNsdlInterface, create_endpoint) |
ram54288 | 0:a2cb7295a1f7 | 81 | { |
ram54288 | 0:a2cb7295a1f7 | 82 | m2m_nsdl_interface->test_create_endpoint(); |
ram54288 | 0:a2cb7295a1f7 | 83 | } |
ram54288 | 0:a2cb7295a1f7 | 84 | |
ram54288 | 0:a2cb7295a1f7 | 85 | TEST(M2MNsdlInterface, send_to_server_callback) |
ram54288 | 0:a2cb7295a1f7 | 86 | { |
ram54288 | 0:a2cb7295a1f7 | 87 | m2m_nsdl_interface->test_send_to_server_callback(); |
ram54288 | 0:a2cb7295a1f7 | 88 | } |
ram54288 | 0:a2cb7295a1f7 | 89 | |
ram54288 | 0:a2cb7295a1f7 | 90 | TEST(M2MNsdlInterface, received_from_server_callback) |
ram54288 | 0:a2cb7295a1f7 | 91 | { |
ram54288 | 0:a2cb7295a1f7 | 92 | m2m_nsdl_interface->test_received_from_server_callback(); |
ram54288 | 0:a2cb7295a1f7 | 93 | } |
ram54288 | 0:a2cb7295a1f7 | 94 | |
ram54288 | 0:a2cb7295a1f7 | 95 | TEST(M2MNsdlInterface, create_nsdl_list_structure) |
ram54288 | 0:a2cb7295a1f7 | 96 | { |
ram54288 | 0:a2cb7295a1f7 | 97 | m2m_nsdl_interface->test_create_nsdl_list_structure(); |
ram54288 | 0:a2cb7295a1f7 | 98 | } |
ram54288 | 0:a2cb7295a1f7 | 99 | |
ram54288 | 0:a2cb7295a1f7 | 100 | TEST(M2MNsdlInterface, resource_callback) |
ram54288 | 0:a2cb7295a1f7 | 101 | { |
ram54288 | 0:a2cb7295a1f7 | 102 | m2m_nsdl_interface->test_resource_callback(); |
ram54288 | 0:a2cb7295a1f7 | 103 | } |
ram54288 | 0:a2cb7295a1f7 | 104 | |
ram54288 | 0:a2cb7295a1f7 | 105 | TEST(M2MNsdlInterface, resource_callback_get) |
ram54288 | 0:a2cb7295a1f7 | 106 | { |
ram54288 | 0:a2cb7295a1f7 | 107 | m2m_nsdl_interface->test_resource_callback_get(); |
ram54288 | 0:a2cb7295a1f7 | 108 | } |
ram54288 | 0:a2cb7295a1f7 | 109 | |
ram54288 | 0:a2cb7295a1f7 | 110 | TEST(M2MNsdlInterface, resource_callback_post) |
ram54288 | 0:a2cb7295a1f7 | 111 | { |
ram54288 | 0:a2cb7295a1f7 | 112 | m2m_nsdl_interface->test_resource_callback_post(); |
ram54288 | 0:a2cb7295a1f7 | 113 | } |
ram54288 | 0:a2cb7295a1f7 | 114 | |
ram54288 | 0:a2cb7295a1f7 | 115 | TEST(M2MNsdlInterface, resource_callback_delete) |
ram54288 | 0:a2cb7295a1f7 | 116 | { |
ram54288 | 0:a2cb7295a1f7 | 117 | m2m_nsdl_interface->test_resource_callback_delete(); |
ram54288 | 0:a2cb7295a1f7 | 118 | } |
ram54288 | 0:a2cb7295a1f7 | 119 | |
ram54288 | 0:a2cb7295a1f7 | 120 | TEST(M2MNsdlInterface, process_received_data) |
ram54288 | 0:a2cb7295a1f7 | 121 | { |
ram54288 | 0:a2cb7295a1f7 | 122 | m2m_nsdl_interface->test_process_received_data(); |
ram54288 | 0:a2cb7295a1f7 | 123 | } |
ram54288 | 0:a2cb7295a1f7 | 124 | |
ram54288 | 0:a2cb7295a1f7 | 125 | TEST(M2MNsdlInterface, timer_expired) |
ram54288 | 0:a2cb7295a1f7 | 126 | { |
ram54288 | 0:a2cb7295a1f7 | 127 | m2m_nsdl_interface->test_timer_expired(); |
ram54288 | 0:a2cb7295a1f7 | 128 | } |
ram54288 | 0:a2cb7295a1f7 | 129 | |
ram54288 | 0:a2cb7295a1f7 | 130 | TEST(M2MNsdlInterface, stop_timers) |
ram54288 | 0:a2cb7295a1f7 | 131 | { |
ram54288 | 0:a2cb7295a1f7 | 132 | m2m_nsdl_interface->test_stop_timers(); |
ram54288 | 0:a2cb7295a1f7 | 133 | } |
ram54288 | 0:a2cb7295a1f7 | 134 | |
ram54288 | 0:a2cb7295a1f7 | 135 | TEST(M2MNsdlInterface, observation_to_be_sent) |
ram54288 | 0:a2cb7295a1f7 | 136 | { |
ram54288 | 0:a2cb7295a1f7 | 137 | m2m_nsdl_interface->test_observation_to_be_sent(); |
ram54288 | 0:a2cb7295a1f7 | 138 | } |
ram54288 | 0:a2cb7295a1f7 | 139 | |
ram54288 | 0:a2cb7295a1f7 | 140 | TEST(M2MNsdlInterface, resource_to_be_deleted) |
ram54288 | 0:a2cb7295a1f7 | 141 | { |
ram54288 | 0:a2cb7295a1f7 | 142 | m2m_nsdl_interface->test_resource_to_be_deleted(); |
ram54288 | 0:a2cb7295a1f7 | 143 | } |
ram54288 | 0:a2cb7295a1f7 | 144 | |
ram54288 | 0:a2cb7295a1f7 | 145 | TEST(M2MNsdlInterface, value_updated) |
ram54288 | 0:a2cb7295a1f7 | 146 | { |
ram54288 | 0:a2cb7295a1f7 | 147 | m2m_nsdl_interface->test_value_updated(); |
ram54288 | 0:a2cb7295a1f7 | 148 | } |
ram54288 | 0:a2cb7295a1f7 | 149 | |
ram54288 | 0:a2cb7295a1f7 | 150 | TEST(M2MNsdlInterface, find_resource) |
ram54288 | 0:a2cb7295a1f7 | 151 | { |
ram54288 | 0:a2cb7295a1f7 | 152 | m2m_nsdl_interface->test_find_resource(); |
ram54288 | 0:a2cb7295a1f7 | 153 | } |
ram54288 | 0:a2cb7295a1f7 | 154 | |
ram54288 | 0:a2cb7295a1f7 | 155 | TEST(M2MNsdlInterface, remove_object) |
ram54288 | 0:a2cb7295a1f7 | 156 | { |
ram54288 | 0:a2cb7295a1f7 | 157 | m2m_nsdl_interface->test_remove_object(); |
ram54288 | 0:a2cb7295a1f7 | 158 | } |
ram54288 | 0:a2cb7295a1f7 | 159 | |
ram54288 | 0:a2cb7295a1f7 | 160 | TEST(M2MNsdlInterface, add_object_to_list) |
ram54288 | 0:a2cb7295a1f7 | 161 | { |
ram54288 | 0:a2cb7295a1f7 | 162 | m2m_nsdl_interface->test_add_object_to_list(); |
ram54288 | 0:a2cb7295a1f7 | 163 | } |
ram54288 | 0:a2cb7295a1f7 | 164 | |
ram54288 | 0:a2cb7295a1f7 | 165 | TEST(M2MNsdlInterface, test_send_delayed_response) |
ram54288 | 0:a2cb7295a1f7 | 166 | { |
ram54288 | 0:a2cb7295a1f7 | 167 | m2m_nsdl_interface->test_send_delayed_response(); |
ram54288 | 0:a2cb7295a1f7 | 168 | } |
ram54288 | 0:a2cb7295a1f7 | 169 | |
ram54288 | 0:a2cb7295a1f7 | 170 | TEST(M2MNsdlInterface, resource_callback_put) |
ram54288 | 0:a2cb7295a1f7 | 171 | { |
ram54288 | 0:a2cb7295a1f7 | 172 | m2m_nsdl_interface->test_resource_callback_put(); |
ram54288 | 0:a2cb7295a1f7 | 173 | } |
ram54288 | 0:a2cb7295a1f7 | 174 | |
ram54288 | 0:a2cb7295a1f7 | 175 | TEST(M2MNsdlInterface, get_nsdl_handle) |
ram54288 | 0:a2cb7295a1f7 | 176 | { |
ram54288 | 0:a2cb7295a1f7 | 177 | m2m_nsdl_interface->test_get_nsdl_handle(); |
ram54288 | 0:a2cb7295a1f7 | 178 | } |
ram54288 | 0:a2cb7295a1f7 | 179 | |
ram54288 | 0:a2cb7295a1f7 | 180 | TEST(M2MNsdlInterface, endpoint_name) |
ram54288 | 0:a2cb7295a1f7 | 181 | { |
ram54288 | 0:a2cb7295a1f7 | 182 | m2m_nsdl_interface->test_endpoint_name(); |
ram54288 | 0:a2cb7295a1f7 | 183 | } |