Ram Gandikota / Mbed OS ABCD
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers test_m2mbase.h Source File

test_m2mbase.h

00001 /*
00002  * Copyright (c) 2015 ARM Limited. All rights reserved.
00003  * SPDX-License-Identifier: Apache-2.0
00004  * Licensed under the Apache License, Version 2.0 (the License); you may
00005  * not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
00012  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #ifndef TEST_M2M_BASE_H
00017 #define TEST_M2M_BASE_H
00018 #include "m2mbase.h"
00019 #include "m2mobservationhandler.h"
00020 
00021 class Handler : public M2MObservationHandler {
00022 
00023 public:
00024 
00025     Handler() : visited(false) {}
00026     ~Handler(){}
00027     void observation_to_be_sent(M2MBase *, uint16_t, m2m::Vector<uint16_t>, bool){
00028         visited = true;
00029     }
00030     void send_delayed_response(M2MBase *){}
00031     void resource_to_be_deleted(M2MBase *){visited=true;}
00032     void remove_object(M2MBase *){visited = true;}
00033     void value_updated(M2MBase *,const String&){visited = true;}
00034 
00035     void clear() {visited = false;}
00036     bool visited;
00037 };
00038 
00039 class Test_M2MBase : M2MBase
00040 {
00041 public:
00042     Test_M2MBase(char* path, Handler *handler);
00043 
00044     virtual ~Test_M2MBase();
00045 
00046     void test_copy_constructor();
00047 
00048     void test_set_operation();
00049 
00050     void test_set_base_type();
00051 
00052     void test_set_interface_description();
00053 
00054     void test_uri_path();
00055 
00056     void test_set_resource_type();
00057 
00058     void test_set_coap_content_type();
00059 
00060     void test_set_instance_id();
00061 
00062     void test_set_observable();
00063 
00064     void test_add_observation_level();
00065 
00066     void test_remove_observation_level();
00067 
00068     void test_set_under_observation();
00069 
00070     void test_set_observation_token();
00071 
00072     void test_observation_level();
00073 
00074     void test_get_observation_token();
00075 
00076     void test_mode();
00077 
00078     void test_observation_number();
00079 
00080     void test_name();
00081 
00082     void test_name_id();
00083 
00084     void test_coap_content_type();
00085 
00086     void test_base_type();
00087 
00088     void test_handle_observation_attribute();
00089 
00090     void test_observation_to_be_sent();
00091 
00092     void test_handle_get_request();
00093 
00094     void test_handle_put_request();
00095 
00096     void test_handle_post_request();
00097 
00098     void test_memory_alloc();
00099 
00100     void test_memory_free();
00101 
00102     void test_report_handler();
00103 
00104     void test_observation_handler();
00105 
00106     void test_id_number();
00107 
00108     void test_set_register_uri();
00109 
00110     void test_set_observation_number();
00111 
00112     void test_set_max_age();
00113 
00114     void test_is_under_observation();
00115 
00116     void test_value_updated_function();
00117 
00118     void test_build_path();
00119 
00120     void test_set_observation_handler();
00121 
00122     void test_resource_type();
00123 
00124     void test_resource_name_length();
00125 
00126     void test_get_nsdl_resource();
00127 
00128     void test_create_path();
00129 
00130     void test_create_report_handler();
00131 
00132     void test_validate_string_length();
00133 
00134     void test_is_integer();
00135 
00136     void test_alloc_copy();
00137 
00138     void test_alloc_string_copy();
00139 
00140     void test_ctor();
00141 
00142     Handler *obsHandler;
00143 };
00144 
00145 
00146 #endif // TEST_M2M_BASE_H