clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.
Change-Id: I6bbb587615b9d6f158900201ca04a647cb3a8f96
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/test/cancel.cpp b/test/cancel.cpp
index 3efefb8..f1f9588 100644
--- a/test/cancel.cpp
+++ b/test/cancel.cpp
@@ -1,6 +1,7 @@
-#include <functional>
#include <stdplus/cancel.hpp>
+#include <functional>
+
#include <gtest/gtest.h>
namespace stdplus
diff --git a/test/dl.cpp b/test/dl.cpp
index cc16293..8ded85d 100644
--- a/test/dl.cpp
+++ b/test/dl.cpp
@@ -1,6 +1,7 @@
-#include <gtest/gtest.h>
#include <stdplus/dl.hpp>
+#include <gtest/gtest.h>
+
namespace stdplus
{
diff --git a/test/exception.cpp b/test/exception.cpp
index 5d22071..a0d2e54 100644
--- a/test/exception.cpp
+++ b/test/exception.cpp
@@ -1,6 +1,7 @@
-#include <gtest/gtest.h>
#include <stdplus/exception.hpp>
+#include <gtest/gtest.h>
+
namespace stdplus
{
namespace exception
diff --git a/test/fd/atomic.cpp b/test/fd/atomic.cpp
index c67ce41..b49112c 100644
--- a/test/fd/atomic.cpp
+++ b/test/fd/atomic.cpp
@@ -1,8 +1,9 @@
-#include <filesystem>
-#include <memory>
#include <stdplus/fd/atomic.hpp>
#include <stdplus/fd/ops.hpp>
#include <stdplus/gtest/tmp.hpp>
+
+#include <filesystem>
+#include <memory>
#include <string_view>
namespace stdplus
@@ -18,9 +19,7 @@
std::string filename;
std::unique_ptr<AtomicWriter> file;
- AtomicWriterTest() : filename(fmt::format("{}/out", CaseTmpDir()))
- {
- }
+ AtomicWriterTest() : filename(fmt::format("{}/out", CaseTmpDir())) {}
~AtomicWriterTest() noexcept
{
@@ -47,8 +46,8 @@
TEST_F(AtomicWriterTest, BadCommit)
{
auto tmp = fmt::format("{}/tmp.XXXXXX", CaseTmpDir());
- ASSERT_NO_THROW(file =
- std::make_unique<AtomicWriter>("/dev/null", 0644, tmp));
+ ASSERT_NO_THROW(
+ file = std::make_unique<AtomicWriter>("/dev/null", 0644, tmp));
writeExact(*file, "hi\n"sv);
EXPECT_TRUE(std::filesystem::exists(file->getTmpname()));
EXPECT_THROW(file->commit(), std::filesystem::filesystem_error);
diff --git a/test/fd/dupable.cpp b/test/fd/dupable.cpp
index e203932..3431e54 100644
--- a/test/fd/dupable.cpp
+++ b/test/fd/dupable.cpp
@@ -1,4 +1,2 @@
#include <stdplus/fd/dupable.hpp>
-int main(int, char*[])
-{
-}
+int main(int, char*[]) {}
diff --git a/test/fd/fmt.cpp b/test/fd/fmt.cpp
index f7ff9d8..770bc99 100644
--- a/test/fd/fmt.cpp
+++ b/test/fd/fmt.cpp
@@ -1,14 +1,15 @@
-#include <gtest/gtest.h>
-
#include <fmt/compile.h>
+#include <sys/mman.h>
+
#include <stdplus/fd/fmt.hpp>
#include <stdplus/fd/managed.hpp>
#include <stdplus/util/cexec.hpp>
-#include <sys/mman.h>
#include <string>
#include <string_view>
+#include <gtest/gtest.h>
+
namespace stdplus
{
namespace fd
diff --git a/test/fd/impl.cpp b/test/fd/impl.cpp
index 6d0c00b..7806b45 100644
--- a/test/fd/impl.cpp
+++ b/test/fd/impl.cpp
@@ -1,4 +1,2 @@
#include <stdplus/fd/impl.hpp>
-int main(int, char*[])
-{
-}
+int main(int, char*[]) {}
diff --git a/test/fd/intf.cpp b/test/fd/intf.cpp
index d4cc8c2..bc58756 100644
--- a/test/fd/intf.cpp
+++ b/test/fd/intf.cpp
@@ -1,4 +1,2 @@
#include <stdplus/fd/intf.hpp>
-int main(int, char*[])
-{
-}
+int main(int, char*[]) {}
diff --git a/test/fd/line.cpp b/test/fd/line.cpp
index 8d9eb32..2913a25 100644
--- a/test/fd/line.cpp
+++ b/test/fd/line.cpp
@@ -1,4 +1,5 @@
-#include <gtest/gtest.h>
+#include <sys/mman.h>
+
#include <stdplus/exception.hpp>
#include <stdplus/fd/gmock.hpp>
#include <stdplus/fd/line.hpp>
@@ -6,8 +7,10 @@
#include <stdplus/fd/ops.hpp>
#include <stdplus/raw.hpp>
#include <stdplus/util/cexec.hpp>
+
#include <string_view>
-#include <sys/mman.h>
+
+#include <gtest/gtest.h>
namespace stdplus
{
@@ -70,7 +73,10 @@
inline auto readSv(std::string_view s)
{
return [s](std::span<std::byte> buf) {
- memcpy(buf.data(), s.data(), s.size());
+ if (s.size())
+ {
+ memcpy(buf.data(), s.data(), s.size());
+ }
return buf.subspan(0, s.size());
};
}
diff --git a/test/fd/managed.cpp b/test/fd/managed.cpp
index f365618..a232fdc 100644
--- a/test/fd/managed.cpp
+++ b/test/fd/managed.cpp
@@ -1,4 +1,2 @@
#include <stdplus/fd/managed.hpp>
-int main(int, char*[])
-{
-}
+int main(int, char*[]) {}
diff --git a/test/fd/mmap.cpp b/test/fd/mmap.cpp
index 3f1ab33..bf73556 100644
--- a/test/fd/mmap.cpp
+++ b/test/fd/mmap.cpp
@@ -1,8 +1,10 @@
-#include <array>
-#include <gtest/gtest.h>
#include <stdplus/fd/create.hpp>
#include <stdplus/fd/mmap.hpp>
+#include <array>
+
+#include <gtest/gtest.h>
+
namespace stdplus
{
namespace fd
diff --git a/test/fd/mock.cpp b/test/fd/mock.cpp
index 0cc6dfd..a3ad784 100644
--- a/test/fd/mock.cpp
+++ b/test/fd/mock.cpp
@@ -1,6 +1,7 @@
-#include <gtest/gtest.h>
#include <stdplus/fd/gmock.hpp>
+#include <gtest/gtest.h>
+
namespace stdplus
{
diff --git a/test/fd/ops.cpp b/test/fd/ops.cpp
index 2d52101..c0328fe 100644
--- a/test/fd/ops.cpp
+++ b/test/fd/ops.cpp
@@ -1,6 +1,7 @@
-#include <gtest/gtest.h>
#include <stdplus/fd/ops.hpp>
+#include <gtest/gtest.h>
+
namespace stdplus
{
namespace fd
diff --git a/test/gtest/tmp.cpp b/test/gtest/tmp.cpp
index f473175..c1b7c74 100644
--- a/test/gtest/tmp.cpp
+++ b/test/gtest/tmp.cpp
@@ -1,15 +1,16 @@
-#include <filesystem>
-#include <gtest/gtest.h>
#include <stdplus/gtest/tmp.hpp>
+#include <filesystem>
+
+#include <gtest/gtest.h>
+
namespace stdplus
{
namespace gtest
{
class TestWithTmpTest : public TestWithTmp
-{
-};
+{};
TEST_F(TestWithTmpTest, One)
{
@@ -28,8 +29,7 @@
}
class TestWithTmpTest2 : public TestWithTmp
-{
-};
+{};
TEST_F(TestWithTmpTest2, One)
{
diff --git a/test/handle/copyable.cpp b/test/handle/copyable.cpp
index cd17c54..161b808 100644
--- a/test/handle/copyable.cpp
+++ b/test/handle/copyable.cpp
@@ -1,10 +1,12 @@
-#include <gtest/gtest.h>
-#include <optional>
#include <stdplus/handle/copyable.hpp>
+
+#include <optional>
#include <string>
#include <utility>
#include <vector>
+#include <gtest/gtest.h>
+
namespace stdplus
{
namespace
diff --git a/test/handle/managed.cpp b/test/handle/managed.cpp
index fb89195..74816e5 100644
--- a/test/handle/managed.cpp
+++ b/test/handle/managed.cpp
@@ -1,11 +1,13 @@
-#include <gtest/gtest.h>
-#include <optional>
#include <stdplus/handle/managed.hpp>
+
+#include <optional>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
+#include <gtest/gtest.h>
+
namespace stdplus
{
namespace
diff --git a/test/io_uring.cpp b/test/io_uring.cpp
index 8a9f2c0..7a646e2 100644
--- a/test/io_uring.cpp
+++ b/test/io_uring.cpp
@@ -1,14 +1,15 @@
+#include <fmt/format.h>
#include <poll.h>
+#include <sys/utsname.h>
+
+#include <stdplus/io_uring.hpp>
+#include <stdplus/util/cexec.hpp>
#include <array>
#include <charconv>
#include <chrono>
-#include <fmt/format.h>
#include <optional>
-#include <stdplus/io_uring.hpp>
-#include <stdplus/util/cexec.hpp>
#include <string_view>
-#include <sys/utsname.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/test/pinned.cpp b/test/pinned.cpp
index f33f41a..5e58dc4 100644
--- a/test/pinned.cpp
+++ b/test/pinned.cpp
@@ -1,7 +1,9 @@
-#include <gtest/gtest.h>
#include <stdplus/pinned.hpp>
+
#include <string>
+#include <gtest/gtest.h>
+
namespace stdplus
{
diff --git a/test/raw.cpp b/test/raw.cpp
index 0de4c33..fa3c77e 100644
--- a/test/raw.cpp
+++ b/test/raw.cpp
@@ -1,13 +1,16 @@
-#include <array>
#include <endian.h>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
+
+#include <stdplus/raw.hpp>
+
+#include <array>
#include <span>
#include <stdexcept>
-#include <stdplus/raw.hpp>
#include <string_view>
#include <vector>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
namespace stdplus
{
namespace raw
diff --git a/test/signal.cpp b/test/signal.cpp
index d060861..3ca2695 100644
--- a/test/signal.cpp
+++ b/test/signal.cpp
@@ -1,8 +1,11 @@
-#include <cstring>
-#include <gtest/gtest.h>
#include <signal.h>
+
#include <stdplus/signal.hpp>
+#include <cstring>
+
+#include <gtest/gtest.h>
+
namespace stdplus
{
namespace signal
diff --git a/test/str/cat.cpp b/test/str/cat.cpp
index 1633f6e..758facc 100644
--- a/test/str/cat.cpp
+++ b/test/str/cat.cpp
@@ -1,8 +1,10 @@
-#include <gtest/gtest.h>
#include <stdplus/str/cat.hpp>
+
#include <string>
#include <string_view>
+#include <gtest/gtest.h>
+
namespace stdplus
{
diff --git a/test/util/cexec.cpp b/test/util/cexec.cpp
index f5b7a5e..3c2099e 100644
--- a/test/util/cexec.cpp
+++ b/test/util/cexec.cpp
@@ -1,8 +1,10 @@
-#include <gtest/gtest.h>
#include <stdplus/util/cexec.hpp>
+
#include <string_view>
#include <system_error>
+#include <gtest/gtest.h>
+
namespace stdplus
{
namespace util
diff --git a/test/zstring.cpp b/test/zstring.cpp
index 69b3c9f..53c3a14 100644
--- a/test/zstring.cpp
+++ b/test/zstring.cpp
@@ -1,10 +1,13 @@
#include <fmt/format.h>
-#include <gtest/gtest.h>
-#include <iostream>
+
#include <stdplus/zstring.hpp>
+
+#include <iostream>
#include <string>
#include <string_view>
+#include <gtest/gtest.h>
+
using std::literals::string_literals::operator""s;
using std::literals::string_view_literals::operator""sv;
diff --git a/test/zstring_view.cpp b/test/zstring_view.cpp
index 40ad4d4..8b29bc9 100644
--- a/test/zstring_view.cpp
+++ b/test/zstring_view.cpp
@@ -1,11 +1,14 @@
#include <fmt/format.h>
-#include <gtest/gtest.h>
+
+#include <stdplus/zstring_view.hpp>
+
#include <iostream>
#include <set>
-#include <stdplus/zstring_view.hpp>
#include <string>
#include <unordered_set>
+#include <gtest/gtest.h>
+
namespace stdplus
{