diff --git a/.restyled.yaml b/.restyled.yaml index aecd497b..b538c72a 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -1,20 +1,21 @@ --- exclude: - - "**/*.api.h" - # shfmt doesn't support this file + # shfmt doesn't support this file - "other/analysis/run-clang-tidy" restylers: - astyle: arguments: ["--options=other/astyle/astylerc"] include: - - "!**/*.cc" + - "**/*.c" + - "**/*.h" - autopep8 - black - clang-format: image: restyled/restyler-clang-format:13.0.1 include: - "**/*.cc" + - "**/*.hh" - prettier-yaml - reorder-python-imports - shellharden diff --git a/testing/fuzzing/BUILD.bazel b/testing/fuzzing/BUILD.bazel index 008a4313..ce23b792 100644 --- a/testing/fuzzing/BUILD.bazel +++ b/testing/fuzzing/BUILD.bazel @@ -4,10 +4,10 @@ load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test") cc_library( name = "fuzz_support", srcs = [ - "func_conversion.h", + "func_conversion.hh", "fuzz_support.cc", ], - hdrs = ["fuzz_support.h"], + hdrs = ["fuzz_support.hh"], visibility = ["//c-toxcore:__subpackages__"], deps = [ "//c-toxcore/toxcore:crypto_core", @@ -18,7 +18,7 @@ cc_library( cc_library( name = "fuzz_tox", - hdrs = ["fuzz_tox.h"], + hdrs = ["fuzz_tox.hh"], visibility = ["//c-toxcore:__subpackages__"], deps = [":fuzz_support"], ) diff --git a/testing/fuzzing/CMakeLists.txt b/testing/fuzzing/CMakeLists.txt index 7efbb8c5..3ab9ecd9 100644 --- a/testing/fuzzing/CMakeLists.txt +++ b/testing/fuzzing/CMakeLists.txt @@ -1,5 +1,5 @@ # Override network and random functions -add_library(fuzz_support func_conversion.h fuzz_support.cc fuzz_support.h) +add_library(fuzz_support func_conversion.hh fuzz_support.cc fuzz_support.hh) set(LIBFUZZER_LINKER_FLAGS) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") diff --git a/testing/fuzzing/bootstrap_fuzz_test.cc b/testing/fuzzing/bootstrap_fuzz_test.cc index 11b70b7d..6210d022 100644 --- a/testing/fuzzing/bootstrap_fuzz_test.cc +++ b/testing/fuzzing/bootstrap_fuzz_test.cc @@ -4,8 +4,8 @@ #include "../../toxcore/tox.h" #include "../../toxcore/tox_dispatch.h" #include "../../toxcore/tox_events.h" -#include "fuzz_support.h" -#include "fuzz_tox.h" +#include "fuzz_support.hh" +#include "fuzz_tox.hh" namespace { diff --git a/testing/fuzzing/e2e_fuzz_test.cc b/testing/fuzzing/e2e_fuzz_test.cc index 40634270..4854e30a 100644 --- a/testing/fuzzing/e2e_fuzz_test.cc +++ b/testing/fuzzing/e2e_fuzz_test.cc @@ -12,8 +12,8 @@ #include "../../toxcore/tox.h" #include "../../toxcore/tox_dispatch.h" #include "../../toxcore/tox_events.h" -#include "fuzz_support.h" -#include "fuzz_tox.h" +#include "fuzz_support.hh" +#include "fuzz_tox.hh" namespace { diff --git a/testing/fuzzing/func_conversion.h b/testing/fuzzing/func_conversion.hh similarity index 100% rename from testing/fuzzing/func_conversion.h rename to testing/fuzzing/func_conversion.hh diff --git a/testing/fuzzing/fuzz_support.cc b/testing/fuzzing/fuzz_support.cc index fd6b9c43..e1a39078 100644 --- a/testing/fuzzing/fuzz_support.cc +++ b/testing/fuzzing/fuzz_support.cc @@ -2,7 +2,7 @@ * Copyright © 2021-2022 The TokTok team. */ -#include "fuzz_support.h" +#include "fuzz_support.hh" #include #include @@ -18,7 +18,7 @@ #include "../../toxcore/crypto_core.h" #include "../../toxcore/network.h" #include "../../toxcore/tox_private.h" -#include "func_conversion.h" +#include "func_conversion.hh" // TODO(iphydf): Put this somewhere shared. struct Network_Addr { diff --git a/testing/fuzzing/fuzz_support.h b/testing/fuzzing/fuzz_support.hh similarity index 98% rename from testing/fuzzing/fuzz_support.h rename to testing/fuzzing/fuzz_support.hh index 01e472c5..7f03d341 100644 --- a/testing/fuzzing/fuzz_support.h +++ b/testing/fuzzing/fuzz_support.hh @@ -19,7 +19,7 @@ struct Fuzz_Data { static constexpr bool DEBUG = false; - static constexpr std::size_t TRACE_TRAP = -1; // 579; + static constexpr std::size_t TRACE_TRAP = -1; // 579; private: const uint8_t *data_; @@ -303,7 +303,8 @@ struct Record_System : System { if (recording_.size() == Fuzz_Data::TRACE_TRAP) { __asm__("int $3"); } - std::printf("%s: produce@%zu(bool %s)\n", name_, recording_.size(), byte ? "true" : "false"); + std::printf( + "%s: produce@%zu(bool %s)\n", name_, recording_.size(), byte ? "true" : "false"); } recording_.push_back(byte); } diff --git a/testing/fuzzing/fuzz_tox.h b/testing/fuzzing/fuzz_tox.hh similarity index 100% rename from testing/fuzzing/fuzz_tox.h rename to testing/fuzzing/fuzz_tox.hh diff --git a/testing/fuzzing/protodump.cc b/testing/fuzzing/protodump.cc index 70ab6c80..91a89d04 100644 --- a/testing/fuzzing/protodump.cc +++ b/testing/fuzzing/protodump.cc @@ -33,7 +33,7 @@ #include "../../toxcore/tox_private.h" #include "../../toxcore/tox_struct.h" #include "../../toxcore/util.h" -#include "fuzz_support.h" +#include "fuzz_support.hh" namespace { diff --git a/testing/fuzzing/protodump_reduce.cc b/testing/fuzzing/protodump_reduce.cc index d824bdac..7ca14ee5 100644 --- a/testing/fuzzing/protodump_reduce.cc +++ b/testing/fuzzing/protodump_reduce.cc @@ -6,8 +6,8 @@ #include "../../toxcore/tox_dispatch.h" #include "../../toxcore/tox_events.h" #include "../../toxcore/tox_private.h" -#include "fuzz_support.h" -#include "fuzz_tox.h" +#include "fuzz_support.hh" +#include "fuzz_tox.hh" namespace { diff --git a/testing/fuzzing/toxsave_fuzz_test.cc b/testing/fuzzing/toxsave_fuzz_test.cc index a5ac0f15..2cb134cb 100644 --- a/testing/fuzzing/toxsave_fuzz_test.cc +++ b/testing/fuzzing/toxsave_fuzz_test.cc @@ -4,7 +4,7 @@ #include "../../toxcore/tox.h" #include "../../toxcore/tox_private.h" -#include "fuzz_support.h" +#include "fuzz_support.hh" namespace { diff --git a/toxcore/DHT_fuzz_test.cc b/toxcore/DHT_fuzz_test.cc index e741e9b2..868aedec 100644 --- a/toxcore/DHT_fuzz_test.cc +++ b/toxcore/DHT_fuzz_test.cc @@ -5,7 +5,7 @@ #include #include -#include "../testing/fuzzing/fuzz_support.h" +#include "../testing/fuzzing/fuzz_support.hh" namespace { diff --git a/toxcore/forwarding_fuzz_test.cc b/toxcore/forwarding_fuzz_test.cc index 99d2121f..da772a19 100644 --- a/toxcore/forwarding_fuzz_test.cc +++ b/toxcore/forwarding_fuzz_test.cc @@ -5,8 +5,8 @@ #include #include -#include "../testing/fuzzing/fuzz_support.h" -#include "../testing/fuzzing/fuzz_tox.h" +#include "../testing/fuzzing/fuzz_support.hh" +#include "../testing/fuzzing/fuzz_tox.hh" namespace { diff --git a/toxcore/group_announce_fuzz_test.cc b/toxcore/group_announce_fuzz_test.cc index eba5e877..eb0dfb62 100644 --- a/toxcore/group_announce_fuzz_test.cc +++ b/toxcore/group_announce_fuzz_test.cc @@ -5,7 +5,7 @@ #include #include -#include "../testing/fuzzing/fuzz_support.h" +#include "../testing/fuzzing/fuzz_support.hh" #include "mem_test_util.hh" namespace { diff --git a/toxcore/group_moderation_fuzz_test.cc b/toxcore/group_moderation_fuzz_test.cc index 9edca19d..dde78ba1 100644 --- a/toxcore/group_moderation_fuzz_test.cc +++ b/toxcore/group_moderation_fuzz_test.cc @@ -1,6 +1,6 @@ #include "group_moderation.h" -#include "../testing/fuzzing/fuzz_support.h" +#include "../testing/fuzzing/fuzz_support.hh" #include "mem_test_util.hh" namespace { diff --git a/toxcore/tox_events_fuzz_test.cc b/toxcore/tox_events_fuzz_test.cc index 480d80a4..79505eb3 100644 --- a/toxcore/tox_events_fuzz_test.cc +++ b/toxcore/tox_events_fuzz_test.cc @@ -5,7 +5,7 @@ #include #include -#include "../testing/fuzzing/fuzz_support.h" +#include "../testing/fuzzing/fuzz_support.hh" #include "tox_dispatch.h" namespace {