summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-12-03 19:14:41 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2012-12-03 19:14:41 +0000
commita0cf7e4ab2261a85299deaaa3ae6229795c2df28 (patch)
treea91d82f5da38753b6e5afd52f092a72f513acf41
parentccd92d8620f0441002c184d65a60275abb066cbf (diff)
downloadrabbitmq-server-a0cf7e4ab2261a85299deaaa3ae6229795c2df28.tar.gz
yet more testsbug25328
-rw-r--r--src/rabbit_tests.erl23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl
index 42c16b34..2226f445 100644
--- a/src/rabbit_tests.erl
+++ b/src/rabbit_tests.erl
@@ -2309,6 +2309,7 @@ test_variable_queue() ->
fun test_variable_queue_fold_msg_on_disk/1,
fun test_dropfetchwhile/1,
fun test_dropwhile_varying_ram_duration/1,
+ fun test_fetchwhile_varying_ram_duration/1,
fun test_variable_queue_ack_limiting/1,
fun test_variable_queue_requeue/1,
fun test_variable_queue_fold/1]],
@@ -2449,12 +2450,30 @@ test_dropfetchwhile(VQ0) ->
VQ5.
test_dropwhile_varying_ram_duration(VQ0) ->
+ test_dropfetchwhile_varying_ram_duration(
+ fun (VQ1) ->
+ {_, VQ2} = rabbit_variable_queue:dropwhile(
+ fun (_) -> false end, VQ1),
+ VQ2
+ end, VQ0).
+
+test_fetchwhile_varying_ram_duration(VQ0) ->
+ test_dropfetchwhile_varying_ram_duration(
+ fun (VQ1) ->
+ {_, ok, VQ2} = rabbit_variable_queue:fetchwhile(
+ fun (_) -> false end,
+ fun (_, _, _, A) -> A end,
+ ok, VQ1),
+ VQ2
+ end, VQ0).
+
+test_dropfetchwhile_varying_ram_duration(Fun, VQ0) ->
VQ1 = variable_queue_publish(false, 1, VQ0),
VQ2 = rabbit_variable_queue:set_ram_duration_target(0, VQ1),
- {_, VQ3} = rabbit_variable_queue:dropwhile(fun(_) -> false end, VQ2),
+ VQ3 = Fun(VQ2),
VQ4 = rabbit_variable_queue:set_ram_duration_target(infinity, VQ3),
VQ5 = variable_queue_publish(false, 1, VQ4),
- {_, VQ6} = rabbit_variable_queue:dropwhile(fun(_) -> false end, VQ5),
+ VQ6 = Fun(VQ5),
VQ6.
test_variable_queue_dynamic_duration_change(VQ0) ->