aboutsummaryrefslogtreecommitdiffstats
path: root/test/compress_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-19 09:05:34 +0100
committerLoïc Hoguin <[email protected]>2018-11-19 09:05:34 +0100
commitbed328b6c9ce41782c340a89554599a838574d82 (patch)
tree065bd9faad0b6abe234302b599624fe6981fad5d /test/compress_SUITE.erl
parent6cc3b0ccca6c06592c2a1881cae39945de805747 (diff)
downloadcowboy-bed328b6c9ce41782c340a89554599a838574d82.tar.gz
cowboy-bed328b6c9ce41782c340a89554599a838574d82.tar.bz2
cowboy-bed328b6c9ce41782c340a89554599a838574d82.zip
Use ?FUNCTION_NAME instead of ct_helper:name()
Cowboy is 19+ so it's OK to use it.
Diffstat (limited to 'test/compress_SUITE.erl')
-rw-r--r--test/compress_SUITE.erl21
1 files changed, 8 insertions, 13 deletions
diff --git a/test/compress_SUITE.erl b/test/compress_SUITE.erl
index 1b82cc6..e42ff4f 100644
--- a/test/compress_SUITE.erl
+++ b/test/compress_SUITE.erl
@@ -18,7 +18,6 @@
-import(ct_helper, [config/2]).
-import(ct_helper, [doc/1]).
--import(ct_helper, [name/0]).
-import(cowboy_test, [gun_open/1]).
%% ct.
@@ -149,13 +148,12 @@ gzip_stream_reply_content_encoding(Config) ->
opts_compress_buffering_false(Config0) ->
doc("Confirm that the compress_buffering option can be set to false, "
"which is the default."),
- Name = name(),
Fun = case config(ref, Config0) of
https_compress -> init_https;
h2_compress -> init_http2;
_ -> init_http
end,
- Config = cowboy_test:Fun(Name, #{
+ Config = cowboy_test:Fun(?FUNCTION_NAME, #{
env => #{dispatch => init_dispatch(Config0)},
stream_handlers => [cowboy_compress_h, cowboy_stream_h],
compress_buffering => false
@@ -175,19 +173,18 @@ opts_compress_buffering_false(Config0) ->
<<"data: World!\r\n\r\n">> = iolist_to_binary(zlib:inflate(Z, Data2)),
gun:close(ConnPid)
after
- cowboy:stop_listener(Name)
+ cowboy:stop_listener(?FUNCTION_NAME)
end.
opts_compress_buffering_true(Config0) ->
doc("Confirm that the compress_buffering option can be set to true, "
"and that the data received is buffered."),
- Name = name(),
Fun = case config(ref, Config0) of
https_compress -> init_https;
h2_compress -> init_http2;
_ -> init_http
end,
- Config = cowboy_test:Fun(Name, #{
+ Config = cowboy_test:Fun(?FUNCTION_NAME, #{
env => #{dispatch => init_dispatch(Config0)},
stream_handlers => [cowboy_compress_h, cowboy_stream_h],
compress_buffering => true
@@ -205,19 +202,18 @@ opts_compress_buffering_true(Config0) ->
<<>> = iolist_to_binary(zlib:inflate(Z, Data1)),
gun:close(ConnPid)
after
- cowboy:stop_listener(Name)
+ cowboy:stop_listener(?FUNCTION_NAME)
end.
set_options_compress_buffering_false(Config0) ->
doc("Confirm that the compress_buffering option can be dynamically "
"set to false by a handler and that the data received is not buffered."),
- Name = name(),
Fun = case config(ref, Config0) of
https_compress -> init_https;
h2_compress -> init_http2;
_ -> init_http
end,
- Config = cowboy_test:Fun(Name, #{
+ Config = cowboy_test:Fun(?FUNCTION_NAME, #{
env => #{dispatch => init_dispatch(Config0)},
stream_handlers => [cowboy_compress_h, cowboy_stream_h],
compress_buffering => true
@@ -237,19 +233,18 @@ set_options_compress_buffering_false(Config0) ->
<<"data: World!\r\n\r\n">> = iolist_to_binary(zlib:inflate(Z, Data2)),
gun:close(ConnPid)
after
- cowboy:stop_listener(Name)
+ cowboy:stop_listener(?FUNCTION_NAME)
end.
set_options_compress_buffering_true(Config0) ->
doc("Confirm that the compress_buffering option can be dynamically "
"set to true by a handler and that the data received is buffered."),
- Name = name(),
Fun = case config(ref, Config0) of
https_compress -> init_https;
h2_compress -> init_http2;
_ -> init_http
end,
- Config = cowboy_test:Fun(Name, #{
+ Config = cowboy_test:Fun(?FUNCTION_NAME, #{
env => #{dispatch => init_dispatch(Config0)},
stream_handlers => [cowboy_compress_h, cowboy_stream_h],
compress_buffering => false
@@ -267,7 +262,7 @@ set_options_compress_buffering_true(Config0) ->
<<>> = iolist_to_binary(zlib:inflate(Z, Data1)),
gun:close(ConnPid)
after
- cowboy:stop_listener(Name)
+ cowboy:stop_listener(?FUNCTION_NAME)
end.
set_options_compress_threshold_0(Config) ->