diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2010-08-07 23:44:54 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2010-08-07 23:44:54 +0100 |
| commit | f0fda32d9bf270d872d346e458f671ae77a64803 (patch) | |
| tree | e8ce06c35bc39cb3622a48c8074f395f4c68dde0 /src | |
| parent | 81774a2718da5364015dbd6b8f6bb9d3451f7876 (diff) | |
| download | rabbitmq-server-git-f0fda32d9bf270d872d346e458f671ae77a64803.tar.gz | |
improve test coverage
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_tests.erl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl index 6812b8d4fe..e6a43120ee 100644 --- a/src/rabbit_tests.erl +++ b/src/rabbit_tests.erl @@ -63,6 +63,7 @@ all_tests() -> passed = test_supervisor_delayed_restart(), passed = test_parsing(), passed = test_content_framing(), + passed = test_content_transcoding(), passed = test_topic_matching(), passed = test_log_management(), passed = test_app_management(), @@ -536,6 +537,33 @@ test_content_framing() -> passed = test_content_framing(11, <<"More than one frame">>), passed. +test_content_transcoding() -> + EnsureDecoded = + fun (C0) -> + C1 = rabbit_binary_parser:ensure_content_decoded(C0), + true = C1#content.properties =/= none, + C1 + end, + EnsureEncoded = + fun (Protocol) -> + fun (C0) -> + C1 = rabbit_binary_generator:ensure_content_encoded( + C0, Protocol), + true = C1#content.properties_bin =/= none, + C1 + end + end, + EnsureEncoded1 = EnsureEncoded(rabbit_framing_amqp_0_9_1), + EnsureEncoded2 = EnsureEncoded(rabbit_framing_amqp_0_8), + ClearEncoded = fun rabbit_binary_generator:clear_encoded_content/1, + ClearDecoded = fun rabbit_binary_parser:clear_decoded_content/1, + lists:foldl(fun (F, V) -> F(F(V)) end, + rabbit_basic:build_content(#'P_basic'{}, <<>>), + [EnsureDecoded, ClearEncoded, ClearDecoded, + EnsureEncoded1, ClearDecoded, ClearEncoded, + EnsureEncoded2, EnsureDecoded, ClearEncoded, EnsureEncoded1]), + passed. + test_topic_match(P, R) -> test_topic_match(P, R, true). |
