util: Add tests for the string buffer
authorThomas Helland <thomashelland90@gmail.com>
Fri, 19 May 2017 20:07:17 +0000 (22:07 +0200)
committerThomas Helland <thomashelland90@gmail.com>
Tue, 26 Sep 2017 16:24:46 +0000 (18:24 +0200)
commit584a2a22ea40cdc030db5b1d70b23dddcc06a556
treeac11f75f34d2d7d754a919faac81e4e84c45cc72
parent7885bb684d8a1ee9fbdcf85603e1f923a3526b22
util: Add tests for the string buffer

More tests could probably be added, but this should cover
concatenation, resizing, clearing, formatted printing,
and checking the length, so it should be quite complete.

Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>
V2: Address review feedback from Timothy, plus fixes
   - Use a large enough char array
   - Actually test the formatted appending
   - Test that clear function resets string length

V3: Port to gtest

V4: Fix test makefile
    Fix copyright header
    Fix missing extern C
    Use more appropriate name for C-file
    Add tests for append_char
configure.ac
src/util/Makefile.am
src/util/tests/string_buffer/Makefile.am [new file with mode: 0644]
src/util/tests/string_buffer/string_buffer_test.cpp [new file with mode: 0644]