Jens Geyer | 6d15c30 | 2014-10-02 10:03:09 +0200 | [diff] [blame] | 1 | %% |
| 2 | %% Licensed to the Apache Software Foundation (ASF) under one |
| 3 | %% or more contributor license agreements. See the NOTICE file |
| 4 | %% distributed with this work for additional information |
| 5 | %% regarding copyright ownership. The ASF licenses this file |
| 6 | %% to you under the Apache License, Version 2.0 (the |
| 7 | %% "License"); you may not use this file except in compliance |
| 8 | %% with the License. You may obtain a copy of the License at |
| 9 | %% |
| 10 | %% http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | %% |
| 12 | %% Unless required by applicable law or agreed to in writing, |
| 13 | %% software distributed under the License is distributed on an |
| 14 | %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | %% KIND, either express or implied. See the License for the |
| 16 | %% specific language governing permissions and limitations |
| 17 | %% under the License. |
| 18 | %% |
| 19 | |
| 20 | -module(legacy_names_test). |
| 21 | -compile(export_all). |
| 22 | |
| 23 | -include_lib("eunit/include/eunit.hrl"). |
| 24 | |
Nobuaki Sukegawa | 826ea99 | 2015-10-28 22:19:45 +0900 | [diff] [blame] | 25 | -include("gen-erl/legacyNames_constants.hrl"). |
Jens Geyer | 6d15c30 | 2014-10-02 10:03:09 +0200 | [diff] [blame] | 26 | |
| 27 | record_generation_test_() -> |
| 28 | [ |
| 29 | {"capitalizedStruct record", ?_assertMatch( |
| 30 | {capitalizedStruct, _, _}, |
| 31 | #capitalizedStruct{id=null,message=null} |
| 32 | )} |
| 33 | ]. |
| 34 | |
| 35 | struct_info_test_() -> |
| 36 | [ |
| 37 | {"capitalizedStruct extended definition", ?_assertEqual( |
| 38 | {struct, [ |
| 39 | {1, undefined, i32, 'id', undefined}, |
| 40 | {2, undefined, string, 'message', undefined} |
| 41 | ]}, |
| 42 | legacyNames_types:struct_info_ext(capitalizedStruct) |
| 43 | )}, |
| 44 | {"listCapitalizedStructs extended definition", ?_assertEqual( |
| 45 | {struct, [ |
| 46 | {1, undefined, {list, {struct, {'legacyNames_types', 'capitalizedStruct'}}}, 'structs', []} |
| 47 | ]}, |
| 48 | legacyNames_types:struct_info_ext(listCapitalizedStructs) |
| 49 | )} |
| 50 | ]. |
| 51 | |
| 52 | service_info_test_() -> |
| 53 | [ |
| 54 | {"names params", ?_assertEqual( |
| 55 | {struct, [ |
| 56 | {1, {struct, {'legacyNames_types', 'capitalizedStruct'}}}, |
| 57 | {2, {struct, {'legacyNames_types', 'capitalizedStruct'}}} |
| 58 | ]}, |
| 59 | legacyNames_thrift:function_info(names, params_type) |
| 60 | )}, |
| 61 | {"names reply", ?_assertEqual( |
| 62 | {struct, {'legacyNames_types', 'listCapitalizedStructs'}}, |
| 63 | legacyNames_thrift:function_info(names, reply_type) |
| 64 | )}, |
| 65 | {"names exceptions", ?_assertEqual( |
| 66 | {struct, [{1, {struct, {'legacyNames_types', 'xception'}}}]}, |
| 67 | legacyNames_thrift:function_info(names, exceptions) |
| 68 | )} |
Nobuaki Sukegawa | 826ea99 | 2015-10-28 22:19:45 +0900 | [diff] [blame] | 69 | ]. |