base: add test to destruct entrypoint

Issue #1921
This commit is contained in:
Alexander Boettcher 2019-11-19 16:28:33 +01:00 committed by Christian Helmuth
parent a41dd48986
commit 1c361bf545
1 changed files with 37 additions and 3 deletions

View File

@ -13,11 +13,13 @@
*/
/* Genode includes */
#include <base/log.h>
#include <base/thread.h>
#include <base/attached_rom_dataspace.h>
#include <base/component.h>
#include <base/heap.h>
#include <base/attached_rom_dataspace.h>
#include <base/log.h>
#include <base/rpc_server.h>
#include <base/rpc_client.h>
#include <base/thread.h>
#include <util/reconstructible.h>
#include <cpu_session/connection.h>
#include <cpu_thread/client.h>
@ -681,6 +683,37 @@ static void test_successive_create_destroy_threads(Env &env)
}
}
/**
* Test destruction of entrypoint with yet not dissolved components
*/
namespace Test {
struct Session;
struct Server;
struct Component;
}
struct Test::Session : Genode::Session
{
static const char *service_name() { return "EP_TEST"; }
GENODE_RPC(Rpc_test_untyped, void, test_untyped, unsigned);
GENODE_RPC_INTERFACE(Rpc_test_untyped);
};
struct Test::Component : Genode::Rpc_object<Test::Session, Test::Component>
{
void test_untyped(unsigned) { }
};
static void test_entrypoint_destruction(Genode::Env &env)
{
Test::Component c;
{
Entrypoint ep(env, 8192 /* STACK*/, "test_ep", Affinity::Location());
ep.manage(c);
}
}
/******************************************************
** Test destruction of inter-dependent CPU sessions **
@ -722,6 +755,7 @@ void Component::construct(Env &env)
test_create_as_many_threads(env);
test_successive_create_destroy_threads(env);
test_entrypoint_destruction(env);
} catch (int error) {
Genode::error("error ", error);
throw;