mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 23:12:24 +00:00
6f9e15aff8
This utility allows for the manual placement of objects without the need to have a global placement new operation nor the need for type-specific new operators. Issue #989
70 lines
2.8 KiB
Plaintext
70 lines
2.8 KiB
Plaintext
build "core init test/volatile_object"
|
|
|
|
create_boot_directory
|
|
|
|
install_config {
|
|
<config>
|
|
<parent-provides>
|
|
<service name="ROM"/>
|
|
<service name="RAM"/>
|
|
<service name="CPU"/>
|
|
<service name="RM"/>
|
|
<service name="CAP"/>
|
|
<service name="PD"/>
|
|
<service name="SIGNAL"/>
|
|
<service name="LOG"/>
|
|
</parent-provides>
|
|
<default-route>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</default-route>
|
|
<start name="test-volatile_object">
|
|
<resource name="RAM" quantum="1M"/>
|
|
</start>
|
|
</config>
|
|
}
|
|
|
|
build_boot_image "core init test-volatile_object"
|
|
|
|
append qemu_args "-nographic -m 64"
|
|
|
|
run_genode_until {child exited with exit value 0.*\n} 10
|
|
|
|
grep_output {-> test-volatile_object}
|
|
|
|
compare_output_to {
|
|
[init -> test-volatile_object] --- test-volatile_object started ---
|
|
[init -> test-volatile_object] construct Object 1
|
|
[init -> test-volatile_object] construct Object 2
|
|
[init -> test-volatile_object] -- create Compound object --
|
|
[init -> test-volatile_object] construct Member_with_reference
|
|
[init -> test-volatile_object] construct Compound
|
|
[init -> test-volatile_object] compound.member.is_constructed returns 1
|
|
[init -> test-volatile_object] compound.lazy_member.is_constructed returns 0
|
|
[init -> test-volatile_object] -- construct lazy member --
|
|
[init -> test-volatile_object] construct Member_with_reference
|
|
[init -> test-volatile_object] compound.lazy_member.is_constructed returns 1
|
|
[init -> test-volatile_object] -- call method on member (with reference to Object 1) --
|
|
[init -> test-volatile_object] const method called on Object 1
|
|
[init -> test-volatile_object] -- reconstruct member with Object 2 as reference --
|
|
[init -> test-volatile_object] destruct Member_with_reference
|
|
[init -> test-volatile_object] construct Member_with_reference
|
|
[init -> test-volatile_object] -- call method on member --
|
|
[init -> test-volatile_object] const method called on Object 2
|
|
[init -> test-volatile_object] -- destruct member --
|
|
[init -> test-volatile_object] destruct Member_with_reference
|
|
[init -> test-volatile_object] -- try to call method on member, catch exception --
|
|
[init -> test-volatile_object] got exception, as expected
|
|
[init -> test-volatile_object] -- destruct Compound and Objects 1 and 2 --
|
|
[init -> test-volatile_object] destruct Compound
|
|
[init -> test-volatile_object] destruct Member_with_reference
|
|
[init -> test-volatile_object] destruct Object 2
|
|
[init -> test-volatile_object] destruct Object 1
|
|
[init -> test-volatile_object] -- construct Throwing object
|
|
[init -> test-volatile_object] construct Throwing -> don't throw
|
|
[init -> test-volatile_object] destruct Throwing
|
|
[init -> test-volatile_object] construct Throwing -> throw exception
|
|
[init -> test-volatile_object] -- catched exception as expected
|
|
[init -> test-volatile_object] --- test-volatile_object finished ---
|
|
}
|
|
|