Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tansiv
TANSIV
Commits
29f7b243
Commit
29f7b243
authored
Apr 16, 2020
by
RILLING Louis
Browse files
fake-vm/tests: Missing test send_too_big
parent
faf156fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/fake-vm/fake_vm/src/lib.rs
View file @
29f7b243
...
...
@@ -472,6 +472,34 @@ mod test {
drop
(
actor
);
}
#[test]
fn
send_too_big
()
{
init
();
let
actor
=
TestActorDesc
::
new
(
"titi"
,
recv_one_msg_actor
);
let
context
=
super
::
init
(
valid_args!
(),
Box
::
new
(
dummy_recv_callback
))
.expect
(
"init failed"
);
context
.start
()
.expect
(
"start failed"
);
let
src
=
local_vsg_address!
();
let
dest
=
remote_vsg_address!
();
let
buffer
=
[
0u8
;
crate
::
MAX_PACKET_SIZE
+
1
];
match
context
.send
(
src
,
dest
,
&
buffer
)
.expect_err
(
"send should have failed"
)
{
crate
::
error
::
Error
::
SizeTooBig
=>
(),
_
=>
assert
!
(
false
),
}
// Terminate gracefully
context
.send
(
src
,
dest
,
b"Foo msg"
)
.expect
(
"send failed"
);
context
.stop
();
drop
(
actor
);
}
#[test]
fn
gettimeofday
()
{
init
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment