diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-10-08 15:34:56 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-10-08 15:41:50 +0200 |
commit | c9325cea0aa43f328644157dee4eafe3d7b45e6f (patch) | |
tree | 7c688b9cfd8acf45771193f41d69639f9a47dfab /test | |
parent | 0e024eb055e6e8272f419e898ae9eefd0085c34f (diff) | |
download | justbuild-c9325cea0aa43f328644157dee4eafe3d7b45e6f.tar.gz |
Name local variables using lower_case
...and private members using lower_case_
Diffstat (limited to 'test')
-rw-r--r-- | test/buildtool/file_system/git_repo.test.cpp | 10 | ||||
-rw-r--r-- | test/buildtool/multithreading/async_map_consumer.test.cpp | 2 | ||||
-rw-r--r-- | test/other_tools/git_operations/git_repo_remote.test.cpp | 26 | ||||
-rw-r--r-- | test/other_tools/utils/curl_usage.test.cpp | 14 | ||||
-rw-r--r-- | test/utils/logging/log_config.hpp | 4 |
5 files changed, 28 insertions, 28 deletions
diff --git a/test/buildtool/file_system/git_repo.test.cpp b/test/buildtool/file_system/git_repo.test.cpp index ae3ded41..4fb5c0cb 100644 --- a/test/buildtool/file_system/git_repo.test.cpp +++ b/test/buildtool/file_system/git_repo.test.cpp @@ -214,12 +214,12 @@ TEST_CASE("Single-threaded real repository local operations", "[git_repo]") { } SECTION("Get head commit") { - auto repo_wHead_path = TestUtils::CreateTestRepoWithCheckout(); - REQUIRE(repo_wHead_path); - auto repo_wHead = GitRepo::Open(*repo_wHead_path); - REQUIRE(repo_wHead); + auto repo_head_path = TestUtils::CreateTestRepoWithCheckout(); + REQUIRE(repo_head_path); + auto repo_head = GitRepo::Open(*repo_head_path); + REQUIRE(repo_head); - auto head_commit = repo_wHead->GetHeadCommit(logger); + auto head_commit = repo_head->GetHeadCommit(logger); REQUIRE(head_commit); CHECK(*head_commit == kRootCommit); } diff --git a/test/buildtool/multithreading/async_map_consumer.test.cpp b/test/buildtool/multithreading/async_map_consumer.test.cpp index 3ba3eebf..4f7d54d8 100644 --- a/test/buildtool/multithreading/async_map_consumer.test.cpp +++ b/test/buildtool/multithreading/async_map_consumer.test.cpp @@ -248,7 +248,7 @@ TEST_CASE("Failure detection", "[async_map_consumer]") { bool failed{}; SECTION("Unfinished pending keys") { - int const kStep{3}; + static constexpr int kStep = 3; REQUIRE(std::lcm(kMaxVal, kStep) > kMaxVal); auto map = CountToMaxConsumer(kMaxVal, kStep); { 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 d1efe97c..39f0bd8a 100644 --- a/test/other_tools/git_operations/git_repo_remote.test.cpp +++ b/test/other_tools/git_operations/git_repo_remote.test.cpp @@ -269,26 +269,26 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") { SECTION("Fetch with refspec into repository") { // set repo to fetch into - auto path_fetch_wRefspec = TestUtils::GetRepoPath(); - auto repo_fetch_wRefspec = GitRepoRemote::InitAndOpen( - path_fetch_wRefspec, /*is_bare=*/true); - REQUIRE(repo_fetch_wRefspec); + auto path_fetch_refspec = TestUtils::GetRepoPath(); + auto repo_fetch_refspec = GitRepoRemote::InitAndOpen( + path_fetch_refspec, /*is_bare=*/true); + REQUIRE(repo_fetch_refspec); // check commit is not there before fetch CHECK_FALSE( - *repo_fetch_wRefspec->CheckCommitExists(kRootCommit, logger)); + *repo_fetch_refspec->CheckCommitExists(kRootCommit, logger)); // fetch all - REQUIRE(repo_fetch_wRefspec->FetchViaTmpRepo(storage_config.Get(), - *repo_path, - "master", - {}, - "git", - {}, - logger)); + REQUIRE(repo_fetch_refspec->FetchViaTmpRepo(storage_config.Get(), + *repo_path, + "master", + {}, + "git", + {}, + logger)); // check commit is there after fetch - CHECK(*repo_fetch_wRefspec->CheckCommitExists(kRootCommit, logger)); + CHECK(*repo_fetch_refspec->CheckCommitExists(kRootCommit, logger)); } } diff --git a/test/other_tools/utils/curl_usage.test.cpp b/test/other_tools/utils/curl_usage.test.cpp index d3b3fd49..980793bf 100644 --- a/test/other_tools/utils/curl_usage.test.cpp +++ b/test/other_tools/utils/curl_usage.test.cpp @@ -38,27 +38,27 @@ TEST_CASE("Curl context", "[curl_context]") { } TEST_CASE("Curl easy handle", "[curl_easy_handle]") { - auto kServerUrl = std::string("http://127.0.0.1:") + getPort() + - std::string("/test_file.txt"); - auto kTargetDir = + auto const serve_url = std::string("http://127.0.0.1:") + getPort() + + std::string("/test_file.txt"); + auto const target_dir = std::filesystem::path(std::getenv("TEST_TMPDIR")) / "target_dir"; // make target dir - CHECK(FileSystemManager::CreateDirectory(kTargetDir)); + CHECK(FileSystemManager::CreateDirectory(target_dir)); // create handle auto curl_handle = CurlEasyHandle::Create(); REQUIRE(curl_handle); SECTION("Curl download to file") { // download test file from local HTTP server into new location - auto file_path = kTargetDir / "test_file.txt"; - REQUIRE(curl_handle->DownloadToFile(kServerUrl, file_path) == 0); + auto file_path = target_dir / "test_file.txt"; + REQUIRE(curl_handle->DownloadToFile(serve_url, file_path) == 0); REQUIRE(FileSystemManager::IsFile(file_path)); } SECTION("Curl download to string") { // download test file from local HTTP server into string - auto content = curl_handle->DownloadToString(kServerUrl); + auto content = curl_handle->DownloadToString(serve_url); REQUIRE(content); REQUIRE(*content == "test\n"); } diff --git a/test/utils/logging/log_config.hpp b/test/utils/logging/log_config.hpp index 816e73b9..3b920917 100644 --- a/test/utils/logging/log_config.hpp +++ b/test/utils/logging/log_config.hpp @@ -24,8 +24,8 @@ #include "src/buildtool/logging/log_sink_cmdline.hpp" static auto ReadLogLevelFromEnv() -> LogLevel { - LogLevel const kDefaultTestLogLevel{LogLevel::Error}; - LogLevel const kMaximumTestLogLevel{LogLevel::Trace}; + static constexpr LogLevel kDefaultTestLogLevel = LogLevel::Error; + static constexpr LogLevel kMaximumTestLogLevel = LogLevel::Trace; auto log_level{kDefaultTestLogLevel}; |