string: format tests according to GNU style

Use the GNU style consistently in the string test code.

Added clang-format guard comments where necessary so the
code can be reformated using the clang-format tool and
GNU style settings from gcc contrib/clang-format.
15 files changed