| 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). | 
| Jens Geyer | 6d15c30 | 2014-10-02 10:03:09 +0200 | [diff] [blame] | 21 |  | 
|  | 22 | -include_lib("eunit/include/eunit.hrl"). | 
|  | 23 |  | 
| Nobuaki Sukegawa | 826ea99 | 2015-10-28 22:19:45 +0900 | [diff] [blame] | 24 | -include("gen-erl/legacyNames_constants.hrl"). | 
| Jens Geyer | 6d15c30 | 2014-10-02 10:03:09 +0200 | [diff] [blame] | 25 |  | 
|  | 26 | record_generation_test_() -> | 
| Sergei Elin | 4576409 | 2022-09-23 23:21:31 +0300 | [diff] [blame] | 27 | [ | 
|  | 28 | {"capitalizedStruct record", | 
|  | 29 | ?_assertMatch( | 
|  | 30 | {capitalizedStruct, _, _}, | 
|  | 31 | #capitalizedStruct{id = null, message = null} | 
|  | 32 | )} | 
|  | 33 | ]. | 
| Jens Geyer | 6d15c30 | 2014-10-02 10:03:09 +0200 | [diff] [blame] | 34 |  | 
|  | 35 | struct_info_test_() -> | 
| Sergei Elin | 4576409 | 2022-09-23 23:21:31 +0300 | [diff] [blame] | 36 | [ | 
|  | 37 | {"capitalizedStruct extended definition", | 
|  | 38 | ?_assertEqual( | 
|  | 39 | {struct, [ | 
|  | 40 | {1, undefined, i32, 'id', undefined}, | 
|  | 41 | {2, undefined, string, 'message', undefined} | 
|  | 42 | ]}, | 
|  | 43 | legacyNames_types:struct_info_ext(capitalizedStruct) | 
|  | 44 | )}, | 
|  | 45 | {"listCapitalizedStructs extended definition", | 
|  | 46 | ?_assertEqual( | 
|  | 47 | {struct, [ | 
|  | 48 | {1, undefined, {list, {struct, {'legacyNames_types', 'capitalizedStruct'}}}, | 
|  | 49 | 'structs', []} | 
|  | 50 | ]}, | 
|  | 51 | legacyNames_types:struct_info_ext(listCapitalizedStructs) | 
|  | 52 | )} | 
|  | 53 | ]. | 
| Jens Geyer | 6d15c30 | 2014-10-02 10:03:09 +0200 | [diff] [blame] | 54 |  | 
|  | 55 | service_info_test_() -> | 
| Sergei Elin | 4576409 | 2022-09-23 23:21:31 +0300 | [diff] [blame] | 56 | [ | 
|  | 57 | {"names params", | 
|  | 58 | ?_assertEqual( | 
|  | 59 | {struct, [ | 
|  | 60 | {1, {struct, {'legacyNames_types', 'capitalizedStruct'}}}, | 
|  | 61 | {2, {struct, {'legacyNames_types', 'capitalizedStruct'}}} | 
|  | 62 | ]}, | 
|  | 63 | legacyNames_thrift:function_info(names, params_type) | 
|  | 64 | )}, | 
|  | 65 | {"names reply", | 
|  | 66 | ?_assertEqual( | 
|  | 67 | {struct, {'legacyNames_types', 'listCapitalizedStructs'}}, | 
|  | 68 | legacyNames_thrift:function_info(names, reply_type) | 
|  | 69 | )}, | 
|  | 70 | {"names exceptions", | 
|  | 71 | ?_assertEqual( | 
|  | 72 | {struct, [{1, {struct, {'legacyNames_types', 'xception'}}}]}, | 
|  | 73 | legacyNames_thrift:function_info(names, exceptions) | 
|  | 74 | )} | 
|  | 75 | ]. |