mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 23:53:55 +00:00
os/test: transition to new base API
For all tests * use Component::construct instead of main * use new connection constructors with env argument * use log instead of printf For some tests * replace signal receivers with signal handlers * replace global static variables with Main class members * remove unnecessary multithreading * model test steps as classes that are independent from each other and managed by Main as constructibles * use references instead of pointers and exceptions instead of error codes * use Attached_* helpers intead of doing attach/detach manually * use helpers like String, Id_space, Registry instead of arrays and lists * make the run script suitable for automated execution and conclusion Ref #1987
This commit is contained in:
committed by
Norman Feske
parent
e0fef69cb3
commit
ad2d1fe586
@ -13,11 +13,11 @@
|
||||
|
||||
#include <base/component.h>
|
||||
#include <base/env.h>
|
||||
#include <base/log.h>
|
||||
#include <base/printf.h>
|
||||
#include <rtc_session/connection.h>
|
||||
#include <timer_session/connection.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
struct Main
|
||||
{
|
||||
Main(Genode::Env &env)
|
||||
@ -31,9 +31,8 @@ struct Main
|
||||
for (unsigned i = 0; i < 4; ++i) {
|
||||
Rtc::Timestamp now = rtc.current_time();
|
||||
|
||||
Genode::printf("RTC: %u-%02u-%02u %02u:%02u:%02u\n",
|
||||
now.year, now.month, now.day,
|
||||
now.hour, now.minute, now.second);
|
||||
log("RTC: ", now.year, "-", now.month, "-", now.day, " ",
|
||||
now.hour, ":", now.minute, ":", now.second);
|
||||
|
||||
timer.msleep(1000);
|
||||
}
|
||||
|
Reference in New Issue
Block a user