Skip to content

Commit

Permalink
Split test files
Browse files Browse the repository at this point in the history
  • Loading branch information
andy128k committed Sep 11, 2024
1 parent 1b5bdf5 commit c921325
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
10 changes: 10 additions & 0 deletions test/ox_thrift_binary_tests.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%% Copyright 2016-2024, OpenX. All rights reserved.
%% Licensed under the conditions specified in the accompanying LICENSE file.

-module(ox_thrift_binary_tests).

-define(STATS_TABLE, ox_thrift_stats_binary).
-define(GLOBALS_TABLE, ox_thrift_globals_binary).

-define(PROTOCOL, ox_thrift_protocol_binary).
-include("ox_thrift_tests.hrl").
10 changes: 10 additions & 0 deletions test/ox_thrift_compact_tests.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%% Copyright 2016-2024, OpenX. All rights reserved.
%% Licensed under the conditions specified in the accompanying LICENSE file.

-module(ox_thrift_compact_tests).

-define(STATS_TABLE, ox_thrift_stats_compact).
-define(GLOBALS_TABLE, ox_thrift_globals_compact).

-define(PROTOCOL, ox_thrift_protocol_compact).
-include("ox_thrift_tests.hrl").
12 changes: 2 additions & 10 deletions test/ox_thrift_tests.erl → test/ox_thrift_tests.hrl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
%% Copyright 2016-2018, OpenX. All rights reserved.
%% Licensed under the conditions specified in the accompanying LICENSE file.

-module(ox_thrift_tests).

-include("ox_thrift.hrl").
-include("test_types.hrl").

Expand All @@ -16,8 +14,6 @@
-define(SERVICE, test_service_thrift).
-define(HANDLER, ?MODULE).
-define(STATS_MODULE, ?MODULE).
-define(STATS_TABLE, ox_thrift_stats).
-define(GLOBALS_TABLE, ox_thrift_globals).
-define(RECV_TIMEOUT_CLIENT, 200).

new_client_direct (Protocol) ->
Expand All @@ -34,7 +30,6 @@ destroy_client_direct (Client) ->

-define(LOCALHOST, "127.0.0.1").
-define(PORT, 8024).
-define(PROTOCOL, ox_thrift_protocol_binary).

new_client_socket () -> new_client_socket(dict, []).

Expand Down Expand Up @@ -86,11 +81,8 @@ destroy_stats_table () ->

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

direct_binary_test_ () ->
make_tests(direct, dict, fun () -> new_client_direct(ox_thrift_protocol_binary) end, fun destroy_client_direct/1).

direct_compact_test_ () ->
make_tests(direct, dict, fun () -> new_client_direct(ox_thrift_protocol_compact) end, fun destroy_client_direct/1).
direct_dict_test_ () ->
make_tests(direct, dict, fun () -> new_client_direct(?PROTOCOL) end, fun destroy_client_direct/1).

socket_dict_test_ () ->
make_tests(socket, dict, fun () -> new_client_socket(dict, []) end, fun destroy_client_socket/1).
Expand Down
2 changes: 1 addition & 1 deletion test/thrift_shackle_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
-define(PORT, 8024).
-define(SERVICE, test_service_thrift).
-define(PROTOCOL, ox_thrift_protocol_binary).
-define(HANDLER, ox_thrift_tests).
-define(HANDLER, ox_thrift_binary_tests).

setup () ->
%% Start the thrift server.
Expand Down

0 comments on commit c921325

Please sign in to comment.