aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-01-07 22:22:35 -0500
committerGraydon Hoare <[email protected]>2011-01-10 11:31:33 -0800
commitf1df1d1a51f310553fd8bcb831215307ec2609ae (patch)
tree2fc8794122293e1bfd4c59a8f19f1c0eabdfd448 /src/test
parentDon't allow circular_buffer to shrink below it's initial size (diff)
downloadrust-f1df1d1a51f310553fd8bcb831215307ec2609ae.tar.xz
rust-f1df1d1a51f310553fd8bcb831215307ec2609ae.zip
Don't allow circular_buffer to shrink below its original size when unit_sz is not a power of two
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/chan-poweroftwo.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/test/run-pass/chan-poweroftwo.rs b/src/test/run-pass/chan-poweroftwo.rs
index da9a62cc..be7c18ad 100644
--- a/src/test/run-pass/chan-poweroftwo.rs
+++ b/src/test/run-pass/chan-poweroftwo.rs
@@ -39,7 +39,7 @@ impure fn test_grow() {
}
// Don't allow the buffer to shrink below it's original size
-impure fn test_shrink() {
+impure fn test_shrink1() {
let port[i8] myport = port();
auto mychan = chan(myport);
@@ -47,10 +47,26 @@ impure fn test_shrink() {
auto x <- myport;
}
+impure fn test_shrink2() {
+ let port[record] myport = port();
+ auto mychan = chan(myport);
+
+ let record val = rec(val1=0i32, val2=0i32, val3=0i32);
+
+ for each (uint i in _uint.range(0u, 100u)) {
+ mychan <| val;
+ }
+
+ for each (uint i in _uint.range(0u, 100u)) {
+ auto x <- myport;
+ }
+}
+
impure fn main() {
test_init();
test_grow();
- test_shrink();
+ test_shrink1();
+ test_shrink2();
}
// Local Variables: