1%% 2%% %CopyrightBegin% 3%% 4%% Copyright Ericsson AB 2004-2016. All Rights Reserved. 5%% 6%% Licensed under the Apache Li2cense, Version 2.0 (the "License"); 7%% you may not use this file except in compliance with the License. 8%% 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, software 13%% distributed under the License is distributed on an "AS IS" BASIS, 14%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15%% See the License for the specific language governing permissions and 16%% limitations under the License. 17%% 18%% %CopyrightEnd% 19%% 20%% 21%%----------------------------------------------------------------- 22%% 23%% Description: 24%% Test suite for the basic typecode functions 25%% 26%%----------------------------------------------------------------- 27-module(tc_SUITE). 28 29-include_lib("common_test/include/ct.hrl"). 30-include_lib("orber/src/orber_iiop.hrl"). 31 32-define(default_timeout, test_server:minutes(3)). 33 34-define(match(Expr), 35 fun() -> 36 case (catch (Expr)) of 37 AcTuAlReS when is_binary(AcTuAlReS)-> 38 io:format("###### ERROR ERROR ######~nRESULT: ~p~n", 39 [AcTuAlReS]), 40 exit(AcTuAlReS); 41 _ -> 42 ok 43 end 44 end()). 45-define(SUB_ELIST, [{"null", orber_tc:null()}, 46 {"void", orber_tc:void()}, 47 {"short", orber_tc:short()}, 48 {"unsigned_short", orber_tc:unsigned_short()}, 49 {"long", orber_tc:long()}, 50 {"unsigned_long", orber_tc:unsigned_long()}, 51 {"long_long", orber_tc:long_long()}, 52 {"unsigned_long_long", orber_tc:unsigned_long_long()}, 53 {"float", orber_tc:'float'()}, 54 {"double", orber_tc:double()}, 55 {"longdouble", orber_tc:longdouble()}, 56 {"boolean", orber_tc:boolean()}, 57 {"char", orber_tc:char()}, 58 {"wchar", orber_tc:wchar()}, 59 {"octet", orber_tc:octet()}, 60 {"any", orber_tc:any()}, 61 {"typecode", orber_tc:typecode()}, 62 {"principal", orber_tc:principal()}, 63 {"object_reference", orber_tc:object_reference("Id", "Name")}]). 64 65-define(ELIST, [{"null", orber_tc:null()}, 66 {"void", orber_tc:void()}, 67 {"short", orber_tc:short()}, 68 {"unsigned_short", orber_tc:unsigned_short()}, 69 {"long", orber_tc:long()}, 70 {"unsigned_long", orber_tc:unsigned_long()}, 71 {"long_long", orber_tc:long_long()}, 72 {"unsigned_long_long", orber_tc:unsigned_long_long()}, 73 {"float", orber_tc:'float'()}, 74 {"double", orber_tc:double()}, 75 {"longdouble", orber_tc:longdouble()}, 76 {"boolean", orber_tc:boolean()}, 77 {"char", orber_tc:char()}, 78 {"wchar", orber_tc:wchar()}, 79 {"octet", orber_tc:octet()}, 80 {"any", orber_tc:any()}, 81 {"typecode", orber_tc:typecode()}, 82 {"principal", orber_tc:principal()}, 83 {"object_reference", orber_tc:object_reference("Id", "Name")}, 84 {"struct", orber_tc:struct("Id", "Name", ?SUB_ELIST)}, 85 {"enum", orber_tc:enum("Id", "Name", ["E1", "E2"])}, 86 {"string", orber_tc:string(1)}, 87 {"wstring", orber_tc:wstring(0)}, 88 {"sequence", orber_tc:sequence(orber_tc:enum("Id", "Name", 89 ["E1", "E2"]), 0)}, 90 {"array", orber_tc:array(orber_tc:enum("Id", "Name", 91 ["E1", "E2"]), 2)}, 92 {"alias", orber_tc:alias("id", "name", 93 orber_tc:enum("Id", "Name", 94 ["E1", "E2"]))}, 95 {"exception", orber_tc:exception("Id", "Name", ?SUB_ELIST)}]). 96 97-define(VELIST, [{"null", orber_tc:null(), 42}, 98 {"void", orber_tc:void(), 42}, 99 {"short", orber_tc:short(), 42}, 100 {"unsigned_short", orber_tc:unsigned_short(), 42}, 101 {"long", orber_tc:long(), 42}, 102 {"unsigned_long", orber_tc:unsigned_long(), 42}, 103 {"long_long", orber_tc:long_long(), 42}, 104 {"unsigned_long_long", orber_tc:unsigned_long_long(), 42}, 105 {"float", orber_tc:'float'(), 42}, 106 {"double", orber_tc:double(), 42}, 107 {"longdouble", orber_tc:longdouble(), 42}, 108 {"boolean", orber_tc:boolean(), 42}, 109 {"char", orber_tc:char(), 42}, 110 {"wchar", orber_tc:wchar(), 42}, 111 {"octet", orber_tc:octet(), 42}, 112 {"any", orber_tc:any(), 42}, 113 {"typecode", orber_tc:typecode(), 42}, 114 {"principal", orber_tc:principal(), 42}, 115 {"object_reference", orber_tc:object_reference("Id", "Name"), 42}, 116 {"struct", orber_tc:struct("Id", "Name", ?SUB_ELIST), 42}, 117 {"enum", orber_tc:enum("Id", "Name", ["E1", "E2"]), 42}, 118 {"string", orber_tc:string(1), 42}, 119 {"wstring", orber_tc:wstring(0), 42}, 120 {"sequence", orber_tc:sequence(orber_tc:enum("Id", "Name", 121 ["E1", "E2"]), 0), 42}, 122 {"array", orber_tc:array(orber_tc:enum("Id", "Name", 123 ["E1", "E2"]), 2), 42}, 124 {"alias", orber_tc:alias("id", "name", 125 orber_tc:enum("Id", "Name", 126 ["E1", "E2"])), 42}, 127 {"exception", orber_tc:exception("Id", "Name", ?SUB_ELIST), 42}]). 128 129%%----------------------------------------------------------------- 130%% External exports 131%%----------------------------------------------------------------- 132-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 133 init_per_group/2,end_per_group/2]). 134 135%%----------------------------------------------------------------- 136%% Internal exports 137%%----------------------------------------------------------------- 138-compile(export_all). 139 140%%----------------------------------------------------------------- 141%% Func: all/1 142%% Args: 143%% Returns: 144%%----------------------------------------------------------------- 145suite() -> [{ct_hooks,[ts_install_cth]}]. 146 147all() -> 148 [null, void, short, ushort, long, ulong, longlong, 149 ulonglong, boolean, char, wchar, octet, float, double, 150 longdouble, any, typecode, principal, object_reference, 151 struct, union, enum, string, wstring, sequence, array, 152 alias, exception, fixed, value, value_box, native, 153 abstract_interface, indirection, get_tc]. 154 155groups() -> 156 []. 157 158init_per_suite(Config) -> 159 Config. 160 161end_per_suite(_Config) -> 162 ok. 163 164init_per_group(_GroupName, Config) -> 165 Config. 166 167end_per_group(_GroupName, Config) -> 168 Config. 169 170 171%%----------------------------------------------------------------- 172%% Init and cleanup functions. 173%%----------------------------------------------------------------- 174 175init_per_testcase(_Case, Config) -> 176 Dog=test_server:timetrap(?default_timeout), 177 [{watchdog, Dog}|Config]. 178 179 180end_per_testcase(_Case, Config) -> 181 Dog = proplists:get_value(watchdog, Config), 182 test_server:timetrap_cancel(Dog), 183 ok. 184 185%%----------------------------------------------------------------- 186%% Test Case: null test 187%% Description: 188%%----------------------------------------------------------------- 189null(_) -> 190 true = orber_tc:check_tc(orber_tc:null()), 191 code(orber_tc:null()), 192 ok. 193 194%%----------------------------------------------------------------- 195%% Test Case: void test 196%% Description: 197%%----------------------------------------------------------------- 198void(_) -> 199 true = orber_tc:check_tc(orber_tc:void()), 200 code(orber_tc:void()), 201 ok. 202 203%%----------------------------------------------------------------- 204%% Test Case: short integer test 205%% Description: 206%%----------------------------------------------------------------- 207short(_) -> 208 true = orber_tc:check_tc(orber_tc:short()), 209 code(orber_tc:short()), 210 ok. 211 212%%----------------------------------------------------------------- 213%% Test Case: unsigned short integer test 214%% Description: 215%%----------------------------------------------------------------- 216ushort(_) -> 217 true = orber_tc:check_tc(orber_tc:unsigned_short()), 218 code(orber_tc:unsigned_short()), 219 ok. 220 221%%----------------------------------------------------------------- 222%% Test Case: long integer test 223%% Description: 224%%----------------------------------------------------------------- 225long(_) -> 226 true = orber_tc:check_tc(orber_tc:long()), 227 code(orber_tc:long()), 228 ok. 229 230%%----------------------------------------------------------------- 231%% Test Case: unsigned long integer test 232%% Description: 233%%----------------------------------------------------------------- 234ulong(_) -> 235 true = orber_tc:check_tc(orber_tc:unsigned_long()), 236 code(orber_tc:unsigned_long()), 237 ok. 238 239 240%%----------------------------------------------------------------- 241%% Test Case: long integer test 242%% Description: 243%%----------------------------------------------------------------- 244longlong(_) -> 245 true = orber_tc:check_tc(orber_tc:long_long()), 246 code(orber_tc:long_long()), 247 ok. 248 249%%----------------------------------------------------------------- 250%% Test Case: unsigned long integer test 251%% Description: 252%%----------------------------------------------------------------- 253ulonglong(_) -> 254 true = orber_tc:check_tc(orber_tc:unsigned_long_long()), 255 code(orber_tc:unsigned_long_long()), 256 ok. 257 258 259%%----------------------------------------------------------------- 260%% Test Case: float test 261%% Description: 262%%----------------------------------------------------------------- 263float(_) -> 264 true = orber_tc:check_tc(orber_tc:'float'()), 265 code(orber_tc:'float'()), 266 ok. 267 268%%----------------------------------------------------------------- 269%% Test Case: double test 270%% Description: 271%%----------------------------------------------------------------- 272double(_) -> 273 true = orber_tc:check_tc(orber_tc:double()), 274 code(orber_tc:double()), 275 ok. 276 277%%----------------------------------------------------------------- 278%% Test Case: longdouble test 279%% Description: 280%%----------------------------------------------------------------- 281longdouble(_) -> 282 true = orber_tc:check_tc(orber_tc:longdouble()), 283 code(orber_tc:longdouble()), 284 ok. 285 286%%----------------------------------------------------------------- 287%% Test Case: boolean test 288%% Description: 289%%----------------------------------------------------------------- 290boolean(_) -> 291 true = orber_tc:check_tc(orber_tc:boolean()), 292 code(orber_tc:boolean()), 293 ok. 294 295%%----------------------------------------------------------------- 296%% Test Case: character test 297%% Description: 298%%----------------------------------------------------------------- 299char(_) -> 300 true = orber_tc:check_tc(orber_tc:char()), 301 code(orber_tc:char()), 302 ok. 303 304%%----------------------------------------------------------------- 305%% Test Case: character test 306%% Description: 307%%----------------------------------------------------------------- 308wchar(_) -> 309 true = orber_tc:check_tc(orber_tc:wchar()), 310 code(orber_tc:wchar()), 311 ok. 312 313%%----------------------------------------------------------------- 314%% Test Case: octet test 315%% Description: 316%%----------------------------------------------------------------- 317octet(_) -> 318 true = orber_tc:check_tc(orber_tc:octet()), 319 code(orber_tc:octet()), 320 ok. 321 322%%----------------------------------------------------------------- 323%% Test Case: any test 324%% Description: 325%%----------------------------------------------------------------- 326any(_) -> 327 true = orber_tc:check_tc(orber_tc:any()), 328 code(orber_tc:any()), 329 ok. 330 331%%----------------------------------------------------------------- 332%% Test Case: typecode test 333%% Description: 334%%----------------------------------------------------------------- 335typecode(_) -> 336 true = orber_tc:check_tc(orber_tc:typecode()), 337 code(orber_tc:typecode()), 338 ok. 339 340%%----------------------------------------------------------------- 341%% Test Case: principal test 342%% Description: 343%%----------------------------------------------------------------- 344principal(_) -> 345 true = orber_tc:check_tc(orber_tc:principal()), 346 code(orber_tc:principal()), 347 ok. 348 349 350%%----------------------------------------------------------------- 351%% Test Case: object_reference test 352%% Description: 353%%----------------------------------------------------------------- 354object_reference(_) -> 355 true = orber_tc:check_tc(orber_tc:object_reference("Id", "Name")), 356 false = orber_tc:check_tc(orber_tc:object_reference(42, "Name")), 357 false = orber_tc:check_tc(orber_tc:object_reference("Id", 42)), 358 code(orber_tc:object_reference("Id", "Name")), 359 ?match(code(orber_tc:object_reference(42, "Name"))), 360 ?match(code(orber_tc:object_reference("Id", 42))), 361 ok. 362 363%%----------------------------------------------------------------- 364%% Test Case: struct 365%% Description: 366%%----------------------------------------------------------------- 367struct(_) -> 368 true = orber_tc:check_tc(orber_tc:struct("Id", "Name", ?ELIST)), 369 false = orber_tc:check_tc(orber_tc:struct(42, "Name", ?ELIST)), 370 false = orber_tc:check_tc(orber_tc:struct("Id", false, ?ELIST)), 371 false = orber_tc:check_tc(orber_tc:struct("Id", "Name", ?VELIST)), 372 false = orber_tc:check_tc(orber_tc:struct("Id", "Name", "wrong")), 373 code(orber_tc:struct("Id", "Name", ?ELIST)), 374 ?match(code(orber_tc:struct(42, "Name", ?ELIST))), 375 ?match(code(orber_tc:struct("Id", false, ?ELIST))), 376 ?match(code(orber_tc:struct("Id", "Name", ?VELIST))), 377 ?match(code(orber_tc:struct("Id", "Name", "wrong"))), 378 ok. 379 380%%----------------------------------------------------------------- 381%% Test Case: union 382%% Description: 383%%----------------------------------------------------------------- 384union(_) -> 385 true = orber_tc:check_tc(orber_tc:union("Id", "Name", orber_tc:long(), 386 -1, [{1, "long", orber_tc:long()}, 387 {2, "longlong", orber_tc:long()}])), 388 false = orber_tc:check_tc(orber_tc:union("Id", "Name", orber_tc:long(), 389 -1, ?ELIST)), 390 false = orber_tc:check_tc(orber_tc:union(42, "Name", orber_tc:long(), 391 -1, [{1, "long", orber_tc:long()}, 392 {2, "longlong", orber_tc:long()}])), 393 false = orber_tc:check_tc(orber_tc:union("Id", false, orber_tc:long(), 394 -1, [{1, "long", orber_tc:long()}, 395 {2, "longlong", orber_tc:long()}])), 396 false = orber_tc:check_tc(orber_tc:union("Id", "Name", bad_tc, 397 -1, [{1, "long", orber_tc:long()}, 398 {2, "longlong", orber_tc:long()}])), 399 false = orber_tc:check_tc(orber_tc:union("Id", "Name", orber_tc:long(), 400 "wrong", [{1, "long", orber_tc:long()}, 401 {2, "longlong", orber_tc:long()}])), 402 403 code(orber_tc:union("Id", "Name", orber_tc:long(), 404 -1, [{1, "long", orber_tc:long()}, 405 {2, "longlong", orber_tc:long()}])), 406 ok. 407 408 409%%----------------------------------------------------------------- 410%% Test Case: enum test 411%% Description: 412%%----------------------------------------------------------------- 413enum(_) -> 414 true = orber_tc:check_tc(orber_tc:enum("Id", "Name", 415 ["E1", "E2", "E3"])), 416 false = orber_tc:check_tc(orber_tc:enum(42, "Name", 417 ["E1", "E2", "E3"])), 418 false = orber_tc:check_tc(orber_tc:enum("Id", false, 419 ["E1", "E2", "E3"])), 420 false = orber_tc:check_tc(orber_tc:enum("Id", "Name", 421 ["E1", false, "E3"])), 422 code(orber_tc:enum("Id", "Name", ["E1", "E2", "E3"])), 423 ?match(code(orber_tc:enum(false, "Name", ["E1", "E2", "E3"]))), 424 ?match(code(orber_tc:enum("Id", 42, ["E1", "E2", "E3"]))), 425 ?match(code(orber_tc:enum("Id", "Name", ["E1", false, "E3"]))), 426 ok. 427 428%%----------------------------------------------------------------- 429%% Test Case: string 430%% Description: 431%%----------------------------------------------------------------- 432string(_) -> 433 true = orber_tc:check_tc(orber_tc:string(0)), 434 true = orber_tc:check_tc(orber_tc:string(1)), 435 false = orber_tc:check_tc(orber_tc:string("wrong")), 436 code(orber_tc:string(0)), 437 code(orber_tc:string(1)), 438 ?match(code(orber_tc:string(-1))), 439 ?match(code(orber_tc:string(?ULONGMAX+1))), 440 ?match(code(orber_tc:string("wrong"))), 441 ok. 442 443%%----------------------------------------------------------------- 444%% Test Case: wstring 445%% Description: 446%%----------------------------------------------------------------- 447wstring(_) -> 448 true = orber_tc:check_tc(orber_tc:wstring(0)), 449 true = orber_tc:check_tc(orber_tc:wstring(1)), 450 false = orber_tc:check_tc(orber_tc:wstring("wrong")), 451 code(orber_tc:wstring(0)), 452 code(orber_tc:wstring(1)), 453 ?match(code(orber_tc:wstring(-1))), 454 ?match(code(orber_tc:wstring(?ULONGMAX+1))), 455 ?match(code(orber_tc:wstring(false))), 456 ok. 457 458%%----------------------------------------------------------------- 459%% Test Case: sequence 460%% Description: 461%%----------------------------------------------------------------- 462sequence(_) -> 463 true = orber_tc:check_tc(orber_tc:sequence(orber_tc:struct("Id", "Name", ?ELIST), 0)), 464 code(orber_tc:sequence(orber_tc:struct("Id", "Name", ?ELIST), 0)), 465 ok. 466 467%%----------------------------------------------------------------- 468%% Test Case: array 469%% Description: 470%%----------------------------------------------------------------- 471array(_) -> 472 true = orber_tc:check_tc(orber_tc:array(orber_tc:struct("Id", "Name", ?ELIST), 1)), 473 code(orber_tc:array(orber_tc:struct("Id", "Name", ?ELIST), 1)), 474 ok. 475 476%%----------------------------------------------------------------- 477%% Test Case: alias 478%% Description: 479%%----------------------------------------------------------------- 480alias(_) -> 481 true = orber_tc:check_tc(orber_tc:alias("Id", "Name", orber_tc:struct("Id", "Name", ?ELIST))), 482 false = orber_tc:check_tc(orber_tc:alias(false, "Name", orber_tc:struct("Id", "Name", ?ELIST))), 483 false = orber_tc:check_tc(orber_tc:alias("Id", 42, orber_tc:struct("Id", "Name", ?ELIST))), 484 false = orber_tc:check_tc(orber_tc:alias("Id", "Name", "wrong")), 485 code(orber_tc:alias("Id", "Name", orber_tc:struct("Id", "Name", ?ELIST))), 486 ?match(code(orber_tc:alias("Id", "Name", orber_tc:struct("Id", "Name", ?VELIST)))), 487 ok. 488 489%%----------------------------------------------------------------- 490%% Test Case: exception 491%% Description: 492%%----------------------------------------------------------------- 493exception(_) -> 494 true = orber_tc:check_tc(orber_tc:exception("Id", "Name", ?ELIST)), 495 false = orber_tc:check_tc(orber_tc:exception(42, "Name", ?ELIST)), 496 false = orber_tc:check_tc(orber_tc:exception("Id", false, ?ELIST)), 497 false = orber_tc:check_tc(orber_tc:exception("Id", "Name", "wrong")), 498 code(orber_tc:exception("Id", "Name", ?ELIST)), 499 ?match(code(orber_tc:exception(42, "Name", ?ELIST))), 500 ?match(code(orber_tc:exception("Id", false, ?ELIST))), 501 ?match(code(orber_tc:exception("Id", "Name", "wrong"))), 502 503 ok. 504 505%%----------------------------------------------------------------- 506%% Test Case: fixed 507%% Description: 508%%----------------------------------------------------------------- 509fixed(_) -> 510 true = orber_tc:check_tc(orber_tc:fixed(25, 2)), 511 code(orber_tc:fixed(25, 2)), 512 ok. 513 514%%----------------------------------------------------------------- 515%% Test Case: value 516%% Description: 517%%----------------------------------------------------------------- 518value(_) -> 519 true = orber_tc:check_tc(orber_tc:value("Id", "Name", 42, 520 orber_tc:fixed(25, 2), ?VELIST)), 521 false = orber_tc:check_tc(orber_tc:value(42, "Name", 42, 522 orber_tc:fixed(25, 2), ?VELIST)), 523 false = orber_tc:check_tc(orber_tc:value("Id", 42, 42, 524 orber_tc:fixed(25, 2), ?VELIST)), 525 false = orber_tc:check_tc(orber_tc:value("Id", "Name", "wrong", 526 orber_tc:fixed(25, 2), ?VELIST)), 527 false = orber_tc:check_tc(orber_tc:value("Id", "Name", "42", 528 orber_tc:fixed(25, 2), ?VELIST)), 529 false = orber_tc:check_tc(orber_tc:value("Id", "Name", "42", 530 ?VELIST, ?VELIST)), 531 false = orber_tc:check_tc(orber_tc:value("Id", "Name", "42", 532 orber_tc:fixed(25, 2), false)), 533 534 code(orber_tc:value("Id", "Name", 42, orber_tc:long(), ?VELIST)), 535 ok. 536 537%%----------------------------------------------------------------- 538%% Test Case: value_box 539%% Description: 540%%----------------------------------------------------------------- 541value_box(_) -> 542 true = orber_tc:check_tc(orber_tc:value_box("Id", "Name", 543 orber_tc:fixed(25, 2))), 544 false = orber_tc:check_tc(orber_tc:value_box(42, "Name", 545 orber_tc:fixed(25, 2))), 546 false = orber_tc:check_tc(orber_tc:value_box("Id", 42, 547 orber_tc:fixed(25, 2))), 548 false = orber_tc:check_tc(orber_tc:value_box("Id", "Name", "wrong")), 549 code(orber_tc:value_box("Id", "Name", orber_tc:long())), 550 ?match(code(orber_tc:value_box(42, "Name", orber_tc:short()))), 551 ?match(code(orber_tc:value_box("Id", 42, orber_tc:char()))), 552 ?match(code(orber_tc:value_box("Id", "Name", false))), 553 ok. 554 555%%----------------------------------------------------------------- 556%% Test Case: native 557%% Description: 558%%----------------------------------------------------------------- 559native(_) -> 560 true = orber_tc:check_tc(orber_tc:native("Id", "Name")), 561 false = orber_tc:check_tc(orber_tc:native(42, "Name")), 562 false = orber_tc:check_tc(orber_tc:native("Id", 42)), 563 code(orber_tc:native("Id", "Name")), 564 ?match(code(orber_tc:native(42, "Name"))), 565 ?match(code(orber_tc:native("Id", 42))), 566 ok. 567 568%%----------------------------------------------------------------- 569%% Test Case: abstract_interface 570%% Description: 571%%----------------------------------------------------------------- 572abstract_interface(_) -> 573 true = orber_tc:check_tc(orber_tc:abstract_interface("RepId", "Name")), 574 false = orber_tc:check_tc(orber_tc:abstract_interface(false, "Name")), 575 false = orber_tc:check_tc(orber_tc:abstract_interface("RepId", 42)), 576 code(orber_tc:abstract_interface("RepId", "Name")), 577 ?match(code(orber_tc:abstract_interface(42, "Name"))), 578 ?match(code(orber_tc:abstract_interface("Id", 42))), 579 ok. 580 581 582 583%%----------------------------------------------------------------- 584%% Test Case: indirection 585%% Description: 586%%----------------------------------------------------------------- 587indirection(_) -> 588 true = orber_tc:check_tc({'none', 42}), 589 ok. 590 591%%----------------------------------------------------------------- 592%% Test Case: get_tc 593%% Description: 594%%----------------------------------------------------------------- 595get_tc(_) -> 596 TC = 'CosNaming_Binding':tc(), 597 TC = orber_tc:get_tc({'CosNaming_Binding', 42}), 598 ?match(orber_tc:get_tc({'none', 42})), 599 ok. 600 601%%----------------------------------------------------------------- 602%% MISC Operations 603%%----------------------------------------------------------------- 604code(Value) -> 605 cdr_encode:enc_type({1,2}, tk_TypeCode, Value). 606