From e750b2aa3698d5bd7f4a9d23f568031e34c6ba2a Mon Sep 17 00:00:00 2001 From: Lars Thorsen Date: Thu, 16 Jan 2014 12:21:20 +0100 Subject: [xmerl] Fix problem with header of next XML document is in the buffer when using xmerl_sax_parser:stream/2 function. --- lib/xmerl/test/xmerl_sax_SUITE.erl | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'lib/xmerl/test/xmerl_sax_SUITE.erl') diff --git a/lib/xmerl/test/xmerl_sax_SUITE.erl b/lib/xmerl/test/xmerl_sax_SUITE.erl index 563bbaaa06..10a96f470b 100644 --- a/lib/xmerl/test/xmerl_sax_SUITE.erl +++ b/lib/xmerl/test/xmerl_sax_SUITE.erl @@ -67,7 +67,8 @@ end_per_testcase(_Func,_Config) -> %% Description: Checks that end of document is checked properly when continuation fun is missing. ticket_8213(suite) -> []; ticket_8213(_Config) -> - ?line {ok,ok,[]} = xmerl_sax_parser:stream("", [{event_fun, fun (_E,_,_) -> ok end}]). + ?line {ok,ok,[]} = xmerl_sax_parser:stream("", [{event_fun, fun (_E,_,_) -> ok end}]), + ok. %%---------------------------------------------------------------------- @@ -86,7 +87,35 @@ ticket_8214(_Config) -> ({startElement, _, "elem",_,_}, _,_) -> throw({test, "Error in startElement tuple"}); (_E,_,_) -> ok - end}]). + end}]), + ok. + +%%---------------------------------------------------------------------- +%% Test Case +%% ID: ticket_8214 +%% Description: Checks that attributes with default namespace don't get [] in NS field. +ticket_11551(suite) -> []; +ticket_11551(Config) -> + Stream1 = <<" +hej + +hej">>, + ?line {ok, undefined, <<">} = xmerl_sax_parser:stream(Stream1, []), + Stream2= <<" +hej + + + +hej">>, + ?line {ok, undefined, <<">} = xmerl_sax_parser:stream(Stream2, []), + Stream3= <<"hej + + +hej">>, + ?line {ok, undefined, <<">} = xmerl_sax_parser:stream(Stream3, []), + ok. + + %%---------------------------------------------------------------------- %% Bug test cases @@ -99,7 +128,7 @@ all() -> [{group, bugs}]. groups() -> - [{bugs, [], [ticket_8213, ticket_8214]}]. + [{bugs, [], [ticket_8213, ticket_8214, ticket_11551]}]. init_per_group(_GroupName, Config) -> Config. -- cgit v1.2.3 From 738c34d4bb8f1a3811acd00af8c6c12107f8315b Mon Sep 17 00:00:00 2001 From: Bruce Yinhe Date: Thu, 18 Jun 2015 11:31:02 +0200 Subject: Change license text to APLv2 --- lib/xmerl/test/xmerl_sax_SUITE.erl | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'lib/xmerl/test/xmerl_sax_SUITE.erl') diff --git a/lib/xmerl/test/xmerl_sax_SUITE.erl b/lib/xmerl/test/xmerl_sax_SUITE.erl index 10a96f470b..a15d9bd57c 100644 --- a/lib/xmerl/test/xmerl_sax_SUITE.erl +++ b/lib/xmerl/test/xmerl_sax_SUITE.erl @@ -4,16 +4,17 @@ %% %% Copyright Ericsson AB 2010. All Rights Reserved. %% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. %% %% %CopyrightEnd% %%---------------------------------------------------------------------- -- cgit v1.2.3 From 03fcb7dabf8861e60ffab4121a909b347bccfec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 15 Feb 2016 15:33:12 +0100 Subject: Eliminate use of test_server.hrl and test_server_line.hrl As a first step to removing the test_server application as as its own separate application, change the inclusion of test_server.hrl to an inclusion of ct.hrl and remove the inclusion of test_server_line.hrl. --- lib/xmerl/test/xmerl_sax_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/xmerl/test/xmerl_sax_SUITE.erl') diff --git a/lib/xmerl/test/xmerl_sax_SUITE.erl b/lib/xmerl/test/xmerl_sax_SUITE.erl index a15d9bd57c..f0e80f81d3 100644 --- a/lib/xmerl/test/xmerl_sax_SUITE.erl +++ b/lib/xmerl/test/xmerl_sax_SUITE.erl @@ -27,7 +27,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("kernel/include/file.hrl"). %%====================================================================== -- cgit v1.2.3 From 6664eed554974336909d3ffe03f20349cc4c38fd Mon Sep 17 00:00:00 2001 From: Henrik Nord Date: Tue, 15 Mar 2016 15:19:56 +0100 Subject: update copyright-year --- lib/xmerl/test/xmerl_sax_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/xmerl/test/xmerl_sax_SUITE.erl') diff --git a/lib/xmerl/test/xmerl_sax_SUITE.erl b/lib/xmerl/test/xmerl_sax_SUITE.erl index f0e80f81d3..590ae14e23 100644 --- a/lib/xmerl/test/xmerl_sax_SUITE.erl +++ b/lib/xmerl/test/xmerl_sax_SUITE.erl @@ -2,7 +2,7 @@ %%---------------------------------------------------------------------- %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010. All Rights Reserved. +%% Copyright Ericsson AB 2010-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. -- cgit v1.2.3 From 6d1458814b1d9b3030f4823461e22a2be8d3fc68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 20 May 2016 17:04:45 +0200 Subject: Remove ?line macros --- lib/xmerl/test/xmerl_sax_SUITE.erl | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'lib/xmerl/test/xmerl_sax_SUITE.erl') diff --git a/lib/xmerl/test/xmerl_sax_SUITE.erl b/lib/xmerl/test/xmerl_sax_SUITE.erl index 590ae14e23..9f981b3e03 100644 --- a/lib/xmerl/test/xmerl_sax_SUITE.erl +++ b/lib/xmerl/test/xmerl_sax_SUITE.erl @@ -68,7 +68,7 @@ end_per_testcase(_Func,_Config) -> %% Description: Checks that end of document is checked properly when continuation fun is missing. ticket_8213(suite) -> []; ticket_8213(_Config) -> - ?line {ok,ok,[]} = xmerl_sax_parser:stream("", [{event_fun, fun (_E,_,_) -> ok end}]), + {ok,ok,[]} = xmerl_sax_parser:stream("", [{event_fun, fun (_E,_,_) -> ok end}]), ok. @@ -78,17 +78,18 @@ ticket_8213(_Config) -> %% Description: Checks that attributes with default namespace don't get [] in NS field. ticket_8214(suite) -> []; ticket_8214(_Config) -> - ?line {ok,ok,[]} = - xmerl_sax_parser:stream("", - [{event_fun, fun ({startElement,"http://lshift.net/d","elem", - {[],"elem"}, - [{[],[],"attr","123"},{"http://lshift.net/x","x","attr","234"}]}, - _, _) ->ok; - ({startElement, _, "elem",_,_}, _,_) -> - throw({test, "Error in startElement tuple"}); - (_E,_,_) -> ok - end}]), + Event = fun ({startElement,"http://lshift.net/d","elem", + {[],"elem"}, + [{[],[],"attr","123"},{"http://lshift.net/x","x","attr","234"}]}, + _, _) ->ok; + ({startElement, _, "elem",_,_}, _,_) -> + throw({test, "Error in startElement tuple"}); + (_E,_,_) -> ok + end, + + {ok,ok,[]} = xmerl_sax_parser:stream("", + [{event_fun, Event}]), ok. %%---------------------------------------------------------------------- @@ -101,19 +102,19 @@ ticket_11551(Config) -> hej hej">>, - ?line {ok, undefined, <<">} = xmerl_sax_parser:stream(Stream1, []), + {ok, undefined, <<">} = xmerl_sax_parser:stream(Stream1, []), Stream2= <<" hej hej">>, - ?line {ok, undefined, <<">} = xmerl_sax_parser:stream(Stream2, []), + {ok, undefined, <<">} = xmerl_sax_parser:stream(Stream2, []), Stream3= <<"hej hej">>, - ?line {ok, undefined, <<">} = xmerl_sax_parser:stream(Stream3, []), + {ok, undefined, <<">} = xmerl_sax_parser:stream(Stream3, []), ok. -- cgit v1.2.3 From e1cef0d4f0f151476f99eb18e7a7263e8e9cb2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 20 May 2016 19:43:10 +0200 Subject: Eliminate use of ?config() macro --- lib/xmerl/test/xmerl_sax_SUITE.erl | 47 ++++---------------------------------- 1 file changed, 5 insertions(+), 42 deletions(-) (limited to 'lib/xmerl/test/xmerl_sax_SUITE.erl') diff --git a/lib/xmerl/test/xmerl_sax_SUITE.erl b/lib/xmerl/test/xmerl_sax_SUITE.erl index 9f981b3e03..22ad8377cc 100644 --- a/lib/xmerl/test/xmerl_sax_SUITE.erl +++ b/lib/xmerl/test/xmerl_sax_SUITE.erl @@ -38,25 +38,11 @@ %% Initializations %%---------------------------------------------------------------------- -init_per_suite(doc) -> - ["Starts the test suite"]; -init_per_suite(Config) -> - Config. - -end_per_suite(doc) -> - ["Stops the test suite"]; -end_per_suite(Config) -> - Config. - +all() -> + [{group, bugs}]. - -%% initialization before each testcase -init_per_testcase(_TestCase,Config) -> - Config. - -%% clean up after each testcase -end_per_testcase(_Func,_Config) -> - ok. +groups() -> + [{bugs, [], [ticket_8213, ticket_8214, ticket_11551]}]. %%---------------------------------------------------------------------- %% Tests @@ -97,7 +83,7 @@ ticket_8214(_Config) -> %% ID: ticket_8214 %% Description: Checks that attributes with default namespace don't get [] in NS field. ticket_11551(suite) -> []; -ticket_11551(Config) -> +ticket_11551(_Config) -> Stream1 = <<" hej @@ -116,26 +102,3 @@ ticket_11551(Config) -> hej">>, {ok, undefined, <<">} = xmerl_sax_parser:stream(Stream3, []), ok. - - - -%%---------------------------------------------------------------------- -%% Bug test cases -%% - -%%---------------------------------------------------------------------- -%% Test Suite -%% -all() -> - [{group, bugs}]. - -groups() -> - [{bugs, [], [ticket_8213, ticket_8214, ticket_11551]}]. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - - -- cgit v1.2.3 From e3dae8488b577e57d9f6fbb1d8b26512ca0d1abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 20 May 2016 20:15:43 +0200 Subject: Eliminate use of doc and suite clauses Those clause are obsolete and never used by common_test. --- lib/xmerl/test/xmerl_sax_SUITE.erl | 3 --- 1 file changed, 3 deletions(-) (limited to 'lib/xmerl/test/xmerl_sax_SUITE.erl') diff --git a/lib/xmerl/test/xmerl_sax_SUITE.erl b/lib/xmerl/test/xmerl_sax_SUITE.erl index 22ad8377cc..f5c0a783c4 100644 --- a/lib/xmerl/test/xmerl_sax_SUITE.erl +++ b/lib/xmerl/test/xmerl_sax_SUITE.erl @@ -52,7 +52,6 @@ groups() -> %% Test Case %% ID: ticket_8213 %% Description: Checks that end of document is checked properly when continuation fun is missing. -ticket_8213(suite) -> []; ticket_8213(_Config) -> {ok,ok,[]} = xmerl_sax_parser:stream("", [{event_fun, fun (_E,_,_) -> ok end}]), ok. @@ -62,7 +61,6 @@ ticket_8213(_Config) -> %% Test Case %% ID: ticket_8214 %% Description: Checks that attributes with default namespace don't get [] in NS field. -ticket_8214(suite) -> []; ticket_8214(_Config) -> Event = fun ({startElement,"http://lshift.net/d","elem", {[],"elem"}, @@ -82,7 +80,6 @@ ticket_8214(_Config) -> %% Test Case %% ID: ticket_8214 %% Description: Checks that attributes with default namespace don't get [] in NS field. -ticket_11551(suite) -> []; ticket_11551(_Config) -> Stream1 = <<" hej -- cgit v1.2.3