compiler/
kernel/
lib/
scripts/
seed/
sublime/
test/
acceptance/
boot/
bootstrap/
cycles/
dispatch/
loader/
mmio/
native/
packages/
pages/
runtime/
scheduling/
shared/
slots/
abandon.rad
355 B
duplicate.rad
445 B
run
837 B
smp/
support/
sync/
termination/
tests/
trap/
package-golden
1.6 KiB
run
3.1 KiB
runner.rad
10.5 KiB
vim/
.gitignore
336 B
.gitsigners
112 B
CONTRIBUTING
2.1 KiB
LICENSE
1.1 KiB
Makefile
9.2 KiB
README
2.5 KiB
STYLE
2.5 KiB
std.lib
1.5 KiB
std.lib.test
662 B
test/slots/duplicate.rad
raw
| 1 | //! Compile-failure fixture for repeated reservation consumption. |
| 2 | |
| 3 | use std::testing; |
| 4 | use kernel::slots; |
| 5 | |
| 6 | /// A reservation cannot be cancelled twice. |
| 7 | @test unsafe fn duplicate() throws (testing::TestError) { |
| 8 | let mut table: [slots::Slot; 1] = undefined; |
| 9 | slots::initialize(&mut table[..]); |
| 10 | let token = try! slots::reserve(&mut table[..]); |
| 11 | try! slots::cancel(&mut table[..], token); |
| 12 | try! slots::cancel(&mut table[..], token); |
| 13 | } |