Skip to content

Commit

Permalink
The number of tests does not depend on the architecture's pointer width
Browse files Browse the repository at this point in the history
Use `u32` instead of `usize` for counting them.
  • Loading branch information
tbu- committed May 20, 2024
1 parent f31684d commit 9bbe530
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/llvm-project
Submodule llvm-project updated 159 files
8 changes: 4 additions & 4 deletions src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ use std::path::{Path, PathBuf};
// should all be 1000 or lower. Limits significantly smaller than 1000 are also
// desirable, because large numbers of files are unwieldy in general. See issue
// #73494.
const ENTRY_LIMIT: usize = 900;
const ENTRY_LIMIT: u32 = 900;
// FIXME: The following limits should be reduced eventually.

const ISSUES_ENTRY_LIMIT: usize = 1676;
const ISSUES_ENTRY_LIMIT: u32 = 1676;

const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
"rs", // test source files
Expand Down Expand Up @@ -52,7 +52,7 @@ const EXTENSION_EXCEPTION_PATHS: &[&str] = &[
];

fn check_entries(tests_path: &Path, bad: &mut bool) {
let mut directories: HashMap<PathBuf, usize> = HashMap::new();
let mut directories: HashMap<PathBuf, u32> = HashMap::new();

for dir in Walk::new(&tests_path.join("ui")) {
if let Ok(entry) = dir {
Expand All @@ -61,7 +61,7 @@ fn check_entries(tests_path: &Path, bad: &mut bool) {
}
}

let (mut max, mut max_issues) = (0usize, 0usize);
let (mut max, mut max_issues) = (0, 0);
for (dir_path, count) in directories {
let is_issues_dir = tests_path.join("ui/issues") == dir_path;
let (limit, maxcnt) = if is_issues_dir {
Expand Down

0 comments on commit 9bbe530

Please sign in to comment.