diff options
author | Lars Thorsen <[email protected]> | 2016-06-17 07:59:00 +0200 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2016-06-17 07:59:00 +0200 |
commit | 29864ba25d395aa57b88cd9d4357aa5a935b7535 (patch) | |
tree | eda5057896e315c46301b2e1d745d498ee2de4fe /lib/orber/test/lname_SUITE.erl | |
parent | 7c349de647fa1e56960201a72cc6c0d863137cd8 (diff) | |
parent | 395f31e3d22c1f4e273830122862769c78a7fcc1 (diff) | |
download | otp-29864ba25d395aa57b88cd9d4357aa5a935b7535.tar.gz otp-29864ba25d395aa57b88cd9d4357aa5a935b7535.tar.bz2 otp-29864ba25d395aa57b88cd9d4357aa5a935b7535.zip |
Merge branch 'lars/test-case-conformance/OTP-13695'
* lars/test-case-conformance/OTP-13695:
[cosTransactions] Update the test suites to follow the new style
[cosTime] Update the test suites to follow the new style
[cosProperty] Update the test suites to follow the new style
[cosNotification] Update the test suites to follow the new style
[cosFileTransfer] Fix mispelled module name
[cosEvent] Fix mispelled module name
[cosEventDomain] Fix mispelled module name
[cosFileTransfer] Update the test suites to follow the new style
[cosEventDomain] Update the test suites to follow the new style
[cosEvent] Update the test suites to follow the new style
[orber] Update the test suites to follow the new style
[erl_docgen] Update the test suites to follow the new style
[ic] Correct memory deallocation error
[ic] Update the test suites to follow the new style
Diffstat (limited to 'lib/orber/test/lname_SUITE.erl')
-rw-r--r-- | lib/orber/test/lname_SUITE.erl | 76 |
1 files changed, 36 insertions, 40 deletions
diff --git a/lib/orber/test/lname_SUITE.erl b/lib/orber/test/lname_SUITE.erl index a12f2b88a7..cb67cd6136 100644 --- a/lib/orber/test/lname_SUITE.erl +++ b/lib/orber/test/lname_SUITE.erl @@ -30,7 +30,7 @@ -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/COSS/CosNaming/lname.hrl"). --define(default_timeout, ?t:minutes(3)). +-define(default_timeout, test_server:minutes(3)). %%----------------------------------------------------------------- %% External exports @@ -75,12 +75,12 @@ end_per_group(_GroupName, Config) -> %%----------------------------------------------------------------- init_per_testcase(_Case, Config) -> - ?line Dog=test_server:timetrap(?default_timeout), + Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. end_per_testcase(_Case, Config) -> - Dog = ?config(watchdog, Config), + Dog = proplists:get_value(watchdog, Config), test_server:timetrap_cancel(Dog), ok. @@ -89,34 +89,32 @@ end_per_testcase(_Case, Config) -> %% Test Case: name component handling tests %% Description: %%----------------------------------------------------------------- -lname_component(doc) -> ["Description", "more description"]; -lname_component(suite) -> []; lname_component(_) -> create_test(), get_tests(), set_tests(). create_test() -> - ?line #'CosNaming_NameComponent'{} = lname_component:create(), + #'CosNaming_NameComponent'{} = lname_component:create(), ok. get_tests() -> NC = #'CosNaming_NameComponent'{id="first", kind="apple"}, NC1 = #'CosNaming_NameComponent'{id="", kind="apple"}, NC2 = #'CosNaming_NameComponent'{id="first", kind=""}, - ?line "first" = lname_component:get_id(NC), - ?line "apple" = lname_component:get_kind(NC), - ?line {'EXCEPTION', #'LNameComponent_NotSet'{}} = + "first" = lname_component:get_id(NC), + "apple" = lname_component:get_kind(NC), + {'EXCEPTION', #'LNameComponent_NotSet'{}} = (catch lname_component:get_id(NC1)), - ?line {'EXCEPTION', #'LNameComponent_NotSet'{}} = + {'EXCEPTION', #'LNameComponent_NotSet'{}} = (catch lname_component:get_kind(NC2)), ok. set_tests() -> NC = #'CosNaming_NameComponent'{id="first", kind="apple"}, - ?line #'CosNaming_NameComponent'{id="second", kind="apple"} = + #'CosNaming_NameComponent'{id="second", kind="apple"} = lname_component:set_id(NC, "second"), - ?line #'CosNaming_NameComponent'{id="first", kind="pear"} = + #'CosNaming_NameComponent'{id="first", kind="pear"} = lname_component:set_kind(NC, "pear"), ok. @@ -124,8 +122,6 @@ set_tests() -> %% Test Case: name handling tests %% Description: %%----------------------------------------------------------------- -lname(doc) -> ["Description", "more description"]; -lname(suite) -> []; lname(_) -> Name = [#'CosNaming_NameComponent'{id="first", kind="apple"}, #'CosNaming_NameComponent'{id="last", kind="peach"}, @@ -139,79 +135,79 @@ lname(_) -> insert_tests(Name) -> NC = #'CosNaming_NameComponent'{id="new", kind="pear"}, - ?line [NC, #'CosNaming_NameComponent'{id="first", kind="apple"}, + [NC, #'CosNaming_NameComponent'{id="first", kind="apple"}, #'CosNaming_NameComponent'{id="last", kind="peach"}, #'CosNaming_NameComponent'{id="and", kind="plum"}, #'CosNaming_NameComponent'{id="always", kind="orange"}] = lname:insert_component(Name, 1, NC), - ?line [#'CosNaming_NameComponent'{id="first", kind="apple"}, + [#'CosNaming_NameComponent'{id="first", kind="apple"}, #'CosNaming_NameComponent'{id="last", kind="peach"}, #'CosNaming_NameComponent'{id="and", kind="plum"}, #'CosNaming_NameComponent'{id="always", kind="orange"}, NC] = lname:insert_component(Name, 5, NC), - ?line [#'CosNaming_NameComponent'{id="first", kind="apple"}, + [#'CosNaming_NameComponent'{id="first", kind="apple"}, #'CosNaming_NameComponent'{id="last", kind="peach"}, #'CosNaming_NameComponent'{id="and", kind="plum"}, NC, #'CosNaming_NameComponent'{id="always", kind="orange"}] = lname:insert_component(Name, 4, NC), - ?line [#'CosNaming_NameComponent'{id="first", kind="apple"}, + [#'CosNaming_NameComponent'{id="first", kind="apple"}, #'CosNaming_NameComponent'{id="last", kind="peach"}, NC, #'CosNaming_NameComponent'{id="and", kind="plum"}, #'CosNaming_NameComponent'{id="always", kind="orange"}] = lname:insert_component(Name, 3, NC), - ?line {'EXCEPTION', #'LName_NoComponent'{}} = + {'EXCEPTION', #'LName_NoComponent'{}} = (catch lname:insert_component(Name, 6, NC)), - ?line {'EXCEPTION', #'LName_NoComponent'{}} = + {'EXCEPTION', #'LName_NoComponent'{}} = (catch lname:insert_component(Name, 0, NC)), - ?line {'EXCEPTION', #'LName_NoComponent'{}} = + {'EXCEPTION', #'LName_NoComponent'{}} = (catch lname:insert_component(Name, -2, NC)), ok. get_tests(Name) -> - ?line #'CosNaming_NameComponent'{id="first", kind="apple"} = + #'CosNaming_NameComponent'{id="first", kind="apple"} = lname:get_component(Name, 1), - ?line #'CosNaming_NameComponent'{id="always", kind="orange"} = + #'CosNaming_NameComponent'{id="always", kind="orange"} = lname:get_component(Name, 4), - ?line #'CosNaming_NameComponent'{id="and", kind="plum"} = + #'CosNaming_NameComponent'{id="and", kind="plum"} = lname:get_component(Name, 3), - ?line {'EXCEPTION', #'LName_NoComponent'{}} = + {'EXCEPTION', #'LName_NoComponent'{}} = (catch lname:get_component(Name, 5)), - ?line {'EXCEPTION', #'LName_NoComponent'{}} = + {'EXCEPTION', #'LName_NoComponent'{}} = (catch lname:get_component(Name, 0)), - ?line {'EXCEPTION', #'LName_NoComponent'{}} = + {'EXCEPTION', #'LName_NoComponent'{}} = (catch lname:get_component(Name, -2)), ok. delete_tests(Name) -> - ?line [#'CosNaming_NameComponent'{id="last", kind="peach"}, + [#'CosNaming_NameComponent'{id="last", kind="peach"}, #'CosNaming_NameComponent'{id="and", kind="plum"}, #'CosNaming_NameComponent'{id="always", kind="orange"}] = lname:delete_component(Name, 1), - ?line [#'CosNaming_NameComponent'{id="first", kind="apple"}, + [#'CosNaming_NameComponent'{id="first", kind="apple"}, #'CosNaming_NameComponent'{id="last", kind="peach"}, #'CosNaming_NameComponent'{id="and", kind="plum"}] = lname:delete_component(Name, 4), - ?line [#'CosNaming_NameComponent'{id="first", kind="apple"}, + [#'CosNaming_NameComponent'{id="first", kind="apple"}, #'CosNaming_NameComponent'{id="last", kind="peach"}, #'CosNaming_NameComponent'{id="always", kind="orange"}] = lname:delete_component(Name, 3), - ?line {'EXCEPTION', #'LName_NoComponent'{}} = + {'EXCEPTION', #'LName_NoComponent'{}} = (catch lname:delete_component(Name, 6)), - ?line {'EXCEPTION', #'LName_NoComponent'{}} = + {'EXCEPTION', #'LName_NoComponent'{}} = (catch lname:delete_component(Name, 0)), - ?line {'EXCEPTION', #'LName_NoComponent'{}} = + {'EXCEPTION', #'LName_NoComponent'{}} = (catch lname:delete_component(Name, -2)), ok. comparision_tests(Name) -> - ?line true = lname:equal(Name, Name), - ?line false = lname:equal(Name, lname:delete_component(Name, 2)), - ?line true = lname:less_than(lname:delete_component(Name, 2), Name), - ?line false = lname:less_than(Name, Name), - ?line false = lname:less_than(Name, lname:delete_component(Name, 2)), + true = lname:equal(Name, Name), + false = lname:equal(Name, lname:delete_component(Name, 2)), + true = lname:less_than(lname:delete_component(Name, 2), Name), + false = lname:less_than(Name, Name), + false = lname:less_than(Name, lname:delete_component(Name, 2)), ok. convertion_tests(Name) -> - ?line Name = lname:from_idl_form(Name), - ?line Name = lname:to_idl_form(Name), + Name = lname:from_idl_form(Name), + Name = lname:to_idl_form(Name), ok. |