mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-04 09:43:06 +00:00
Fix String(Hex()) usage
- additional add test casye to log.run Fixes #2265
This commit is contained in:
parent
818795ab90
commit
dd5592cc50
@ -592,7 +592,7 @@ class Genode::String
|
|||||||
|
|
||||||
void out_string(char const *str, size_t n) override
|
void out_string(char const *str, size_t n) override
|
||||||
{
|
{
|
||||||
while (n-- > 0 && _capacity_left())
|
while (n-- > 0 && _capacity_left() && *str)
|
||||||
_append(*str++);
|
_append(*str++);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -36,5 +36,6 @@ compare_output_to {
|
|||||||
[init -> test-log] negative hex char: 0xfe
|
[init -> test-log] negative hex char: 0xfe
|
||||||
[init -> test-log] positive hex char: 0x02
|
[init -> test-log] positive hex char: 0x02
|
||||||
[init -> test-log] multiarg string: "parent -> child.7"
|
[init -> test-log] multiarg string: "parent -> child.7"
|
||||||
|
[init -> test-log] String(Hex(3)): 0x3
|
||||||
[init -> test-log] Test done.
|
[init -> test-log] Test done.
|
||||||
}
|
}
|
||||||
|
@ -30,5 +30,8 @@ void Component::construct(Genode::Env &env)
|
|||||||
typedef String<128> Label;
|
typedef String<128> Label;
|
||||||
log("multiarg string: ", Label(Char('"'), "parent -> child.", 7, Char('"')));
|
log("multiarg string: ", Label(Char('"'), "parent -> child.", 7, Char('"')));
|
||||||
|
|
||||||
|
String<32> hex(Hex(3));
|
||||||
|
log("String(Hex(3)): ", hex);
|
||||||
|
|
||||||
log("Test done.");
|
log("Test done.");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user