[Mesa-dev] [PATCH 2/5] util: Add tests for the string buffer
Emil Velikov
emil.l.velikov at gmail.com
Wed Sep 27 13:49:06 UTC 2017
On 11 September 2017 at 21:21, Thomas Helland <thomashelland90 at gmail.com> wrote:
> 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.
>
> 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 | 1 +
> src/util/Makefile.am | 5 +-
> src/util/tests/string_buffer/Makefile.am | 40 +++++++
> .../tests/string_buffer/string_buffer_test.cpp | 119 +++++++++++++++++++++
> 4 files changed, 164 insertions(+), 1 deletion(-)
> create mode 100644 src/util/tests/string_buffer/Makefile.am
> create mode 100644 src/util/tests/string_buffer/string_buffer_test.cpp
>
> diff --git a/configure.ac b/configure.ac
> index d0d4c0dfd1..20727c7bb4 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2924,6 +2924,7 @@ AC_CONFIG_FILES([Makefile
> src/mesa/state_tracker/tests/Makefile
> src/util/Makefile
> src/util/tests/hash_table/Makefile
> + src/util/tests/string_buffer/Makefile
> src/util/xmlpool/Makefile
> src/vulkan/Makefile])
>
> diff --git a/src/util/Makefile.am b/src/util/Makefile.am
> index 4512dc99d5..2b47143ad7 100644
> --- a/src/util/Makefile.am
> +++ b/src/util/Makefile.am
> @@ -19,7 +19,10 @@
> # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> # IN THE SOFTWARE.
>
> -SUBDIRS = xmlpool . tests/hash_table
> +SUBDIRS = . \
> + xmlpool \
> + tests/hash_table \
> + tests/string_buffer
>
The order is changed here - xmlpool . -> . xmlpool
Haven't checked if/how much that matters though.
Considering a clean "../configure && make check" still works (notice
the missing plain`make'), the patch is
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
-Emil
More information about the mesa-dev
mailing list