tests/lib: C++ify `test-fields-bin.cpp`
- use the C++ bindings
- rename `test_string_clear` to `testStringClear`
- use an anonymous namespace
- declare testStringClear as `noexcept`
- use constexpr
I checked that the test still managed to catch the bug fixed in
0022a87819b0 ("Fix: clear_string_field(): set first character to 0").
Change-Id: I3631b22f9e70ea5db620ce0597d04e5035bfa91d
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11793
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>