Ram Gandikota
/
IOTMetronome
FRDM K64F Metronome
mbed-client/test/mbedclient/utest/m2mbase/test_m2mbase.h@0:dbad57390bd1, 2017-05-14 (annotated)
- Committer:
- ram54288
- Date:
- Sun May 14 18:37:05 2017 +0000
- Revision:
- 0:dbad57390bd1
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ram54288 | 0:dbad57390bd1 | 1 | /* |
ram54288 | 0:dbad57390bd1 | 2 | * Copyright (c) 2015 ARM Limited. All rights reserved. |
ram54288 | 0:dbad57390bd1 | 3 | * SPDX-License-Identifier: Apache-2.0 |
ram54288 | 0:dbad57390bd1 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
ram54288 | 0:dbad57390bd1 | 5 | * not use this file except in compliance with the License. |
ram54288 | 0:dbad57390bd1 | 6 | * You may obtain a copy of the License at |
ram54288 | 0:dbad57390bd1 | 7 | * |
ram54288 | 0:dbad57390bd1 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
ram54288 | 0:dbad57390bd1 | 9 | * |
ram54288 | 0:dbad57390bd1 | 10 | * Unless required by applicable law or agreed to in writing, software |
ram54288 | 0:dbad57390bd1 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
ram54288 | 0:dbad57390bd1 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
ram54288 | 0:dbad57390bd1 | 13 | * See the License for the specific language governing permissions and |
ram54288 | 0:dbad57390bd1 | 14 | * limitations under the License. |
ram54288 | 0:dbad57390bd1 | 15 | */ |
ram54288 | 0:dbad57390bd1 | 16 | #ifndef TEST_M2M_BASE_H |
ram54288 | 0:dbad57390bd1 | 17 | #define TEST_M2M_BASE_H |
ram54288 | 0:dbad57390bd1 | 18 | #include "m2mbase.h" |
ram54288 | 0:dbad57390bd1 | 19 | #include "m2mobservationhandler.h" |
ram54288 | 0:dbad57390bd1 | 20 | |
ram54288 | 0:dbad57390bd1 | 21 | class Handler : public M2MObservationHandler { |
ram54288 | 0:dbad57390bd1 | 22 | |
ram54288 | 0:dbad57390bd1 | 23 | public: |
ram54288 | 0:dbad57390bd1 | 24 | |
ram54288 | 0:dbad57390bd1 | 25 | Handler() : visited(false) {} |
ram54288 | 0:dbad57390bd1 | 26 | ~Handler(){} |
ram54288 | 0:dbad57390bd1 | 27 | void observation_to_be_sent(M2MBase *, uint16_t, m2m::Vector<uint16_t>, bool){ |
ram54288 | 0:dbad57390bd1 | 28 | visited = true; |
ram54288 | 0:dbad57390bd1 | 29 | } |
ram54288 | 0:dbad57390bd1 | 30 | void send_delayed_response(M2MBase *){} |
ram54288 | 0:dbad57390bd1 | 31 | void resource_to_be_deleted(M2MBase *){visited=true;} |
ram54288 | 0:dbad57390bd1 | 32 | void remove_object(M2MBase *){visited = true;} |
ram54288 | 0:dbad57390bd1 | 33 | void value_updated(M2MBase *,const String&){visited = true;} |
ram54288 | 0:dbad57390bd1 | 34 | |
ram54288 | 0:dbad57390bd1 | 35 | void clear() {visited = false;} |
ram54288 | 0:dbad57390bd1 | 36 | bool visited; |
ram54288 | 0:dbad57390bd1 | 37 | }; |
ram54288 | 0:dbad57390bd1 | 38 | |
ram54288 | 0:dbad57390bd1 | 39 | class Test_M2MBase : M2MBase |
ram54288 | 0:dbad57390bd1 | 40 | { |
ram54288 | 0:dbad57390bd1 | 41 | public: |
ram54288 | 0:dbad57390bd1 | 42 | Test_M2MBase(char* path, Handler *handler); |
ram54288 | 0:dbad57390bd1 | 43 | |
ram54288 | 0:dbad57390bd1 | 44 | virtual ~Test_M2MBase(); |
ram54288 | 0:dbad57390bd1 | 45 | |
ram54288 | 0:dbad57390bd1 | 46 | void test_copy_constructor(); |
ram54288 | 0:dbad57390bd1 | 47 | |
ram54288 | 0:dbad57390bd1 | 48 | void test_set_operation(); |
ram54288 | 0:dbad57390bd1 | 49 | |
ram54288 | 0:dbad57390bd1 | 50 | void test_set_base_type(); |
ram54288 | 0:dbad57390bd1 | 51 | |
ram54288 | 0:dbad57390bd1 | 52 | void test_set_interface_description(); |
ram54288 | 0:dbad57390bd1 | 53 | |
ram54288 | 0:dbad57390bd1 | 54 | void test_uri_path(); |
ram54288 | 0:dbad57390bd1 | 55 | |
ram54288 | 0:dbad57390bd1 | 56 | void test_set_resource_type(); |
ram54288 | 0:dbad57390bd1 | 57 | |
ram54288 | 0:dbad57390bd1 | 58 | void test_set_coap_content_type(); |
ram54288 | 0:dbad57390bd1 | 59 | |
ram54288 | 0:dbad57390bd1 | 60 | void test_set_instance_id(); |
ram54288 | 0:dbad57390bd1 | 61 | |
ram54288 | 0:dbad57390bd1 | 62 | void test_set_observable(); |
ram54288 | 0:dbad57390bd1 | 63 | |
ram54288 | 0:dbad57390bd1 | 64 | void test_add_observation_level(); |
ram54288 | 0:dbad57390bd1 | 65 | |
ram54288 | 0:dbad57390bd1 | 66 | void test_remove_observation_level(); |
ram54288 | 0:dbad57390bd1 | 67 | |
ram54288 | 0:dbad57390bd1 | 68 | void test_set_under_observation(); |
ram54288 | 0:dbad57390bd1 | 69 | |
ram54288 | 0:dbad57390bd1 | 70 | void test_set_observation_token(); |
ram54288 | 0:dbad57390bd1 | 71 | |
ram54288 | 0:dbad57390bd1 | 72 | void test_observation_level(); |
ram54288 | 0:dbad57390bd1 | 73 | |
ram54288 | 0:dbad57390bd1 | 74 | void test_get_observation_token(); |
ram54288 | 0:dbad57390bd1 | 75 | |
ram54288 | 0:dbad57390bd1 | 76 | void test_mode(); |
ram54288 | 0:dbad57390bd1 | 77 | |
ram54288 | 0:dbad57390bd1 | 78 | void test_observation_number(); |
ram54288 | 0:dbad57390bd1 | 79 | |
ram54288 | 0:dbad57390bd1 | 80 | void test_name(); |
ram54288 | 0:dbad57390bd1 | 81 | |
ram54288 | 0:dbad57390bd1 | 82 | void test_name_id(); |
ram54288 | 0:dbad57390bd1 | 83 | |
ram54288 | 0:dbad57390bd1 | 84 | void test_coap_content_type(); |
ram54288 | 0:dbad57390bd1 | 85 | |
ram54288 | 0:dbad57390bd1 | 86 | void test_base_type(); |
ram54288 | 0:dbad57390bd1 | 87 | |
ram54288 | 0:dbad57390bd1 | 88 | void test_handle_observation_attribute(); |
ram54288 | 0:dbad57390bd1 | 89 | |
ram54288 | 0:dbad57390bd1 | 90 | void test_observation_to_be_sent(); |
ram54288 | 0:dbad57390bd1 | 91 | |
ram54288 | 0:dbad57390bd1 | 92 | void test_handle_get_request(); |
ram54288 | 0:dbad57390bd1 | 93 | |
ram54288 | 0:dbad57390bd1 | 94 | void test_handle_put_request(); |
ram54288 | 0:dbad57390bd1 | 95 | |
ram54288 | 0:dbad57390bd1 | 96 | void test_handle_post_request(); |
ram54288 | 0:dbad57390bd1 | 97 | |
ram54288 | 0:dbad57390bd1 | 98 | void test_memory_alloc(); |
ram54288 | 0:dbad57390bd1 | 99 | |
ram54288 | 0:dbad57390bd1 | 100 | void test_memory_free(); |
ram54288 | 0:dbad57390bd1 | 101 | |
ram54288 | 0:dbad57390bd1 | 102 | void test_report_handler(); |
ram54288 | 0:dbad57390bd1 | 103 | |
ram54288 | 0:dbad57390bd1 | 104 | void test_observation_handler(); |
ram54288 | 0:dbad57390bd1 | 105 | |
ram54288 | 0:dbad57390bd1 | 106 | void test_id_number(); |
ram54288 | 0:dbad57390bd1 | 107 | |
ram54288 | 0:dbad57390bd1 | 108 | void test_set_register_uri(); |
ram54288 | 0:dbad57390bd1 | 109 | |
ram54288 | 0:dbad57390bd1 | 110 | void test_set_observation_number(); |
ram54288 | 0:dbad57390bd1 | 111 | |
ram54288 | 0:dbad57390bd1 | 112 | void test_set_max_age(); |
ram54288 | 0:dbad57390bd1 | 113 | |
ram54288 | 0:dbad57390bd1 | 114 | void test_is_under_observation(); |
ram54288 | 0:dbad57390bd1 | 115 | |
ram54288 | 0:dbad57390bd1 | 116 | void test_value_updated_function(); |
ram54288 | 0:dbad57390bd1 | 117 | |
ram54288 | 0:dbad57390bd1 | 118 | void test_build_path(); |
ram54288 | 0:dbad57390bd1 | 119 | |
ram54288 | 0:dbad57390bd1 | 120 | void test_set_observation_handler(); |
ram54288 | 0:dbad57390bd1 | 121 | |
ram54288 | 0:dbad57390bd1 | 122 | void test_resource_type(); |
ram54288 | 0:dbad57390bd1 | 123 | |
ram54288 | 0:dbad57390bd1 | 124 | void test_resource_name_length(); |
ram54288 | 0:dbad57390bd1 | 125 | |
ram54288 | 0:dbad57390bd1 | 126 | void test_get_nsdl_resource(); |
ram54288 | 0:dbad57390bd1 | 127 | |
ram54288 | 0:dbad57390bd1 | 128 | void test_create_path(); |
ram54288 | 0:dbad57390bd1 | 129 | |
ram54288 | 0:dbad57390bd1 | 130 | void test_create_report_handler(); |
ram54288 | 0:dbad57390bd1 | 131 | |
ram54288 | 0:dbad57390bd1 | 132 | void test_validate_string_length(); |
ram54288 | 0:dbad57390bd1 | 133 | |
ram54288 | 0:dbad57390bd1 | 134 | void test_is_integer(); |
ram54288 | 0:dbad57390bd1 | 135 | |
ram54288 | 0:dbad57390bd1 | 136 | void test_alloc_copy(); |
ram54288 | 0:dbad57390bd1 | 137 | |
ram54288 | 0:dbad57390bd1 | 138 | void test_alloc_string_copy(); |
ram54288 | 0:dbad57390bd1 | 139 | |
ram54288 | 0:dbad57390bd1 | 140 | void test_ctor(); |
ram54288 | 0:dbad57390bd1 | 141 | |
ram54288 | 0:dbad57390bd1 | 142 | Handler *obsHandler; |
ram54288 | 0:dbad57390bd1 | 143 | }; |
ram54288 | 0:dbad57390bd1 | 144 | |
ram54288 | 0:dbad57390bd1 | 145 | |
ram54288 | 0:dbad57390bd1 | 146 | #endif // TEST_M2M_BASE_H |