From 6b8b158202a9be0c8c6e8ef14f13a306842102d6 Mon Sep 17 00:00:00 2001
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Date: Wed, 14 Aug 2024 19:20:58 +0200
Subject: [PATCH] tests/core/persistent_string_cache/speed_test.cpp: Add
 missing include of <iomanip>.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This resolves the following issue, recently having occurred in Debian unstable (possibly due to GCC-14 bump):

```
[ 84%] Building CXX object tests/core/persistent_string_cache/CMakeFiles/speed_test.dir/speed_test.cpp.o
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/tests/core/persistent_string_cache && /usr/bin/c++ -DGTEST_VERSION_MAJOR=1 -DGTEST_VERSION_MINOR=15 -DGTEST_VERSION_PATCH=0 -DTEST_DIR=\"/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/tests/core/persistent_string_cache\" -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/tests/core/persistent_string_cache -I/<<PKGBUILDDIR>>/tests/core/persistent_string_cache -I/<<PKGBUILDDIR>>/include -isystem /usr/src/googletest/googlemock/include -isystem /usr/src/googletest/googletest/include -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 --std=c++14 -Wall -pedantic -Wextra -Wcast-align -Wcast-qual -Wformat -Wredundant-decls -Wswitch-default -Wnon-virtual-dtor -Wctor-dtor-privacy -Wold-style-cast -MD -MT tests/core/persistent_string_cache/CMakeFiles/speed_test.dir/speed_test.cpp.o -MF CMakeFiles/speed_test.dir/speed_test.cpp.o.d -o CMakeFiles/speed_test.dir/speed_test.cpp.o -c /<<PKGBUILDDIR>>/tests/core/persistent_string_cache/speed_test.cpp
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/persistent_string_cache_test.cpp: In member function ‘virtual void PersistentStringCache_stats_Test::TestBody()’:
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/persistent_string_cache_test.cpp:372:53: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
  372 |             PersistentCacheStats s4(move(c->stats()));
      |                                                     ^
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/persistent_string_cache_test.cpp:372:53: note: remove ‘std::move’ call
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/speed_test.cpp: In function ‘std::string make_key(int, int)’:
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/speed_test.cpp:99:10: error: ‘setfill’ was not declared in this scope
   99 |     s << setfill('0') << setw(keylen) << random_int(0, max_key);
      |          ^~~~~~~
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/speed_test.cpp:32:1: note: ‘std::setfill’ is defined in header ‘<iomanip>’; this is probably fixable by adding ‘#include <iomanip>’
   31 | #include <thread>
  +++ |+#include <iomanip>
   32 |
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/speed_test.cpp:99:26: error: ‘setw’ was not declared in this scope
   99 |     s << setfill('0') << setw(keylen) << random_int(0, max_key);
      |                          ^~~~
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/speed_test.cpp:99:26: note: ‘std::setw’ is defined in header ‘<iomanip>’; this is probably fixable by adding ‘#include <iomanip>’
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/speed_test.cpp: In member function ‘virtual void PersistentStringCache_basic_Test::TestBody()’:
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/speed_test.cpp:151:14: error: ‘setfill’ was not declared in this scope
  151 |         s << setfill('0') << setw(keylen) << i;
      |              ^~~~~~~
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/speed_test.cpp:151:14: note: ‘std::setfill’ is defined in header ‘<iomanip>’; this is probably fixable by adding ‘#include <iomanip>’
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/speed_test.cpp:151:30: error: ‘setw’ was not declared in this scope
  151 |         s << setfill('0') << setw(keylen) << i;
      |                              ^~~~
/<<PKGBUILDDIR>>/tests/core/persistent_string_cache/speed_test.cpp:151:30: note: ‘std::setw’ is defined in header ‘<iomanip>’; this is probably fixable by adding ‘#include <iomanip>’
make[3]: *** [tests/core/persistent_string_cache/CMakeFiles/speed_test.dir/build.make:79: tests/core/persistent_string_cache/CMakeFiles/speed_test.dir/speed_test.cpp.o] Error 1
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:1270: tests/core/persistent_string_cache/CMakeFiles/speed_test.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
```

Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
 tests/core/persistent_string_cache/speed_test.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/core/persistent_string_cache/speed_test.cpp b/tests/core/persistent_string_cache/speed_test.cpp
index a816d0e..76417be 100644
--- a/tests/core/persistent_string_cache/speed_test.cpp
+++ b/tests/core/persistent_string_cache/speed_test.cpp
@@ -26,6 +26,7 @@
 #pragma GCC diagnostic pop
 
 #include <chrono>
+#include <iomanip>
 #include <iostream>
 #include <random>
 #include <thread>
-- 
2.39.2

