diff options
author | Thomas Helland <[email protected]> | 2017-05-19 22:07:17 +0200 |
---|---|---|
committer | Thomas Helland <[email protected]> | 2017-09-26 18:24:46 +0200 |
commit | 584a2a22ea40cdc030db5b1d70b23dddcc06a556 (patch) | |
tree | ac11f75f34d2d7d754a919faac81e4e84c45cc72 /src/util/tests/string_buffer/Makefile.am | |
parent | 7885bb684d8a1ee9fbdcf85603e1f923a3526b22 (diff) |
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 <[email protected]>
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
Diffstat (limited to 'src/util/tests/string_buffer/Makefile.am')
-rw-r--r-- | src/util/tests/string_buffer/Makefile.am | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/util/tests/string_buffer/Makefile.am b/src/util/tests/string_buffer/Makefile.am new file mode 100644 index 00000000000..bd04d86349e --- /dev/null +++ b/src/util/tests/string_buffer/Makefile.am @@ -0,0 +1,40 @@ +# Copyright © 2017 Thomas Helland +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +AM_CPPFLAGS = \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src/gtest/include \ + $(PTHREAD_CFLAGS) \ + $(DEFINES) + +TESTS = string_buffer_test + +check_PROGRAMS = $(TESTS) + +string_buffer_test_SOURCES = \ + string_buffer_test.cpp + +string_buffer_test_LDADD = \ + $(top_builddir)/src/gtest/libgtest.la \ + $(top_builddir)/src/util/libmesautil.la \ + $(PTHREAD_LIBS) \ + $(DLOPEN_LIBS) |