summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-10-08 12:34:05 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-10-08 15:41:50 +0200
commitab9ff1405f9dd27addb6106e6d6e3ea45c730cc4 (patch)
treeb7f2c3787752fb16f73b16e9e3343d2bf5e59d0f /test
parent6f03f36201fa79f3802f3235779ec5a451287e21 (diff)
downloadjustbuild-ab9ff1405f9dd27addb6106e6d6e3ea45c730cc4.tar.gz
Name constexpr variables using kCamelCase.
Diffstat (limited to 'test')
-rw-r--r--test/buildtool/file_system/git_repo.test.cpp4
-rw-r--r--test/buildtool/file_system/resolve_symlinks_map.test.cpp8
-rw-r--r--test/other_tools/git_operations/critical_git_ops.test.cpp10
-rw-r--r--test/other_tools/git_operations/git_repo_remote.test.cpp4
4 files changed, 13 insertions, 13 deletions
diff --git a/test/buildtool/file_system/git_repo.test.cpp b/test/buildtool/file_system/git_repo.test.cpp
index fbe92a85..ae3ded41 100644
--- a/test/buildtool/file_system/git_repo.test.cpp
+++ b/test/buildtool/file_system/git_repo.test.cpp
@@ -611,7 +611,7 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo]") {
threads.reserve(kNumThreads);
SECTION("Lookups in the same ODB") {
- constexpr int NUM_CASES = 10;
+ constexpr int kNumCases = 10;
for (int id{}; id < kNumThreads; ++id) {
threads.emplace_back(
[&storage_config,
@@ -621,7 +621,7 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo]") {
&starting_signal](int tid) {
starting_signal.wait(false);
// cases based on thread number
- switch (tid % NUM_CASES) {
+ switch (tid % kNumCases) {
case 0: {
auto remote_repo = GitRepo::Open(remote_cas);
REQUIRE(remote_repo);
diff --git a/test/buildtool/file_system/resolve_symlinks_map.test.cpp b/test/buildtool/file_system/resolve_symlinks_map.test.cpp
index 01865f6d..5831aee1 100644
--- a/test/buildtool/file_system/resolve_symlinks_map.test.cpp
+++ b/test/buildtool/file_system/resolve_symlinks_map.test.cpp
@@ -120,7 +120,7 @@ TEST_CASE("Resolve symlinks", "[resolve_symlinks_map]") {
auto resolve_symlinks_map = CreateResolveSymlinksMap();
SECTION("Source repo is target repo") {
- constexpr auto NUM_CASES = 3;
+ constexpr auto kNumCases = 3;
std::vector<ResolvedGitObject> expected = {
{kFooId, ObjectType::File, "baz/foo"},
{kBazBarLinkId, ObjectType::Symlink, "bar_l"},
@@ -151,7 +151,7 @@ TEST_CASE("Resolve symlinks", "[resolve_symlinks_map]") {
source_cas,
source_cas)},
[&expected, &source_cas](auto const& values) {
- for (auto i = 0; i < NUM_CASES; ++i) {
+ for (auto i = 0; i < kNumCases; ++i) {
auto const& res = ResolvedGitObject{*values[i]};
CHECK(res.id == expected[i].id);
CHECK(res.type == expected[i].type);
@@ -176,7 +176,7 @@ TEST_CASE("Resolve symlinks", "[resolve_symlinks_map]") {
auto target_cas = GitCAS::Open(*target_repo_path);
REQUIRE(target_cas);
- constexpr auto NUM_CASES = 3;
+ constexpr auto kNumCases = 3;
std::vector<ResolvedGitObject> expected = {
{kFooId, ObjectType::File, "baz/foo"},
{kBazBarLinkId, ObjectType::Symlink, "bar_l"},
@@ -207,7 +207,7 @@ TEST_CASE("Resolve symlinks", "[resolve_symlinks_map]") {
source_cas,
target_cas)},
[&expected, &target_cas](auto const& values) {
- for (auto i = 0; i < NUM_CASES; ++i) {
+ for (auto i = 0; i < kNumCases; ++i) {
auto const& res = ResolvedGitObject{*values[i]};
CHECK(res.id == expected[i].id);
CHECK(res.type == expected[i].type);
diff --git a/test/other_tools/git_operations/critical_git_ops.test.cpp b/test/other_tools/git_operations/critical_git_ops.test.cpp
index c15842e7..aa93b391 100644
--- a/test/other_tools/git_operations/critical_git_ops.test.cpp
+++ b/test/other_tools/git_operations/critical_git_ops.test.cpp
@@ -152,21 +152,21 @@ TEST_CASE("Critical git operations", "[critical_git_op_map]") {
// Add ops to the map. None should throw, as repeating the same operation
// should retrieve the value from the map, not call the operation again.
// helper lists
- constexpr auto NUM_METHODS = 6;
- std::vector<std::size_t> ops_all(NUM_METHODS); // indices of all ops tested
+ constexpr auto kNumMethods = 6;
+ std::vector<std::size_t> ops_all(kNumMethods); // indices of all ops tested
std::iota(ops_all.begin(), ops_all.end(), 0);
const std::vector<std::size_t> ops_with_result{
0, 4}; // indices of ops that return a non-empty string
// Add to the map all ops multiple times
- constexpr auto REPEATS = 3;
- for ([[maybe_unused]] auto k = REPEATS; k > 0; --k) {
+ constexpr auto kRepeats = 3;
+ for ([[maybe_unused]] auto k = kRepeats; k > 0; --k) {
auto error = false;
auto error_msg = std::string("NONE");
{
TaskSystem ts;
- for ([[maybe_unused]] auto j = REPEATS; j > 0; --j) {
+ for ([[maybe_unused]] auto j = kRepeats; j > 0; --j) {
crit_op_map.ConsumeAfterKeysReady(
&ts,
{GitOpKey{.params =
diff --git a/test/other_tools/git_operations/git_repo_remote.test.cpp b/test/other_tools/git_operations/git_repo_remote.test.cpp
index a4f0daa6..d1efe97c 100644
--- a/test/other_tools/git_operations/git_repo_remote.test.cpp
+++ b/test/other_tools/git_operations/git_repo_remote.test.cpp
@@ -345,7 +345,7 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo_remote]") {
REQUIRE(target_repo);
SECTION("Fetching into same repository from remote") {
- constexpr int NUM_CASES = 4;
+ constexpr int kNumCases = 4;
for (int id{}; id < kNumThreads; ++id) {
threads.emplace_back(
[&storage_config,
@@ -355,7 +355,7 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo_remote]") {
&starting_signal](int tid) {
starting_signal.wait(false);
// cases based on thread number
- switch (tid % NUM_CASES) {
+ switch (tid % kNumCases) {
case 0: {
auto result_containing =
target_repo->CheckCommitExists(kRootCommit,