mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-04 17:53:07 +00:00
parent
7309bcf4b5
commit
7182c10c90
@ -28,6 +28,24 @@ namespace Local {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct Bad_args_nic : Genode::Connection<Nic::Session>
|
||||||
|
{
|
||||||
|
Bad_args_nic(Genode::Env &env,
|
||||||
|
Genode::size_t ram_quota,
|
||||||
|
Genode::size_t cap_quota,
|
||||||
|
Genode::size_t tx_buf_size,
|
||||||
|
Genode::size_t rx_buf_size,
|
||||||
|
char const *label)
|
||||||
|
:
|
||||||
|
Genode::Connection<Nic::Session>(env,
|
||||||
|
session(env.parent(),
|
||||||
|
"ram_quota=%ld, cap_quota=%ld, "
|
||||||
|
"tx_buf_size=%ld, rx_buf_size=%ld, label=\"%s\"",
|
||||||
|
ram_quota, cap_quota, tx_buf_size, rx_buf_size, label))
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
struct Local::Construct_destruct_test
|
struct Local::Construct_destruct_test
|
||||||
{
|
{
|
||||||
enum { DEFAULT_NR_OF_ROUNDS = 10 };
|
enum { DEFAULT_NR_OF_ROUNDS = 10 };
|
||||||
@ -37,12 +55,13 @@ struct Local::Construct_destruct_test
|
|||||||
|
|
||||||
using Nic_slot = Constructible<Nic::Connection>;
|
using Nic_slot = Constructible<Nic::Connection>;
|
||||||
|
|
||||||
Env &_env;
|
Env &_env;
|
||||||
Allocator &_alloc;
|
Allocator &_alloc;
|
||||||
Signal_context_capability &_completed_sigh;
|
Signal_context_capability &_completed_sigh;
|
||||||
Xml_node const &_config;
|
Xml_node const &_config;
|
||||||
Nic::Packet_allocator _pkt_alloc { &_alloc };
|
Nic::Packet_allocator _pkt_alloc { &_alloc };
|
||||||
bool const _config_exists { _config.has_sub_node("construct_destruct") };
|
bool const _config_exists { _config.has_sub_node("construct_destruct") };
|
||||||
|
Constructible<Bad_args_nic> _bad_args_nic { };
|
||||||
|
|
||||||
unsigned long const _nr_of_rounds {
|
unsigned long const _nr_of_rounds {
|
||||||
_config_exists ?
|
_config_exists ?
|
||||||
@ -61,6 +80,8 @@ struct Local::Construct_destruct_test
|
|||||||
void construct_all(Nic_slot *const nic,
|
void construct_all(Nic_slot *const nic,
|
||||||
unsigned const round)
|
unsigned const round)
|
||||||
{
|
{
|
||||||
|
_bad_args_nic.construct(
|
||||||
|
_env, 0, 0, BUF_SIZE, BUF_SIZE, "bad_args");
|
||||||
for (unsigned idx = 0; idx < _nr_of_sessions; idx++) {
|
for (unsigned idx = 0; idx < _nr_of_sessions; idx++) {
|
||||||
try {
|
try {
|
||||||
nic[idx].construct(_env, &_pkt_alloc, BUF_SIZE, BUF_SIZE);
|
nic[idx].construct(_env, &_pkt_alloc, BUF_SIZE, BUF_SIZE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user