From 24713a7036a81498334807fa5c7ad3cb7c643711 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 6 Feb 2020 13:47:40 -0800 Subject: Export of internal Abseil changes -- 183ff8d9640e7c08f78a9d36113bc0109c34703b by Jorg Brown : Internal cleanup PiperOrigin-RevId: 293667472 GitOrigin-RevId: 183ff8d9640e7c08f78a9d36113bc0109c34703b Change-Id: Ic21223ab9719b5d49b8f1eb21417e947190b056b --- absl/strings/internal/resize_uninitialized_test.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/absl/strings/internal/resize_uninitialized_test.cc b/absl/strings/internal/resize_uninitialized_test.cc index c5be0b12..0f8b3c2a 100644 --- a/absl/strings/internal/resize_uninitialized_test.cc +++ b/absl/strings/internal/resize_uninitialized_test.cc @@ -20,13 +20,27 @@ namespace { int resize_call_count = 0; +// A mock string class whose only purpose is to track how many times its +// resize() method has been called. struct resizable_string { + size_t size() const { return 0; } + char& operator[](size_t) { + static char c = '\0'; + return c; + } void resize(size_t) { resize_call_count += 1; } }; int resize_default_init_call_count = 0; +// A mock string class whose only purpose is to track how many times its +// resize() and __resize_default_init() methods have been called. struct resize_default_init_string { + size_t size() const { return 0; } + char& operator[](size_t) { + static char c = '\0'; + return c; + } void resize(size_t) { resize_call_count += 1; } void __resize_default_init(size_t) { resize_default_init_call_count += 1; } }; -- cgit v1.2.3