standardize tests: template macros, c++20 ranges, naming conventions#226
Merged
Conversation
added 8 commits
July 6, 2026 11:39
…s not a strict win)" This reverts commit 04f35f6.
…anges::unique/remove_if
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standardizes
tests/library_checker_aizu_tests/to the same conventions the library already follows: template macros, C++20 ranges/<bit>, and the naming conventions from #223. Test-only change — no library headers touched.Tests already include
kactl_macros.hpp(viatemplate.hpp), so the macros were available everywhere but used inconsistently — e.g. 14 files usedrep(...)while 108 used raw loops, and 84 files usedvector<int>while 31 usedvi, sometimes mixed within one file.Template macros (matching library style)
for (int i = a; i < b; i++)->rep(i, a, b)(~290 sites; loops with a second init variable, non-<conditions, or non-++increments left as rawfor)vector<int>->vi(175 sites),pair<int, int>->pii(28)long long/int64_t->ll(33 sites;uint64_tuntouched)ssize(x)/(int)size(x)->sz(x)(20)begin(x), end(x)->all(x)(47)C++20 standardization (matching #221)
Use the
ranges::/views::/<bit>form consistently wherever it applies:algo(all(x), ...)->ranges::algo(x, ...)for sort, reverse, fill, count, find, min/max_element, generate, transform, lower_bound, etc. (~70 sites across 29 files)ranges::find(x, v) == end(x)/ranges::count; associative containers use.contains()__lg-><bit>(bit_width/bit_floor) inseg_tree_midpoint.test.cppiota,accumulate,partial_sum(no C++20 ranges counterpart), genuinely offset/partial rangesunique/remove_ifstay in iterator form (algo(all(x), ...)) — theranges::versions return a subrange needing abegin(...)unwrap and trip cppcheckmismatchingContainerExpressionfalse positives (same rule as standardize on c++20: ranges/views and <bit> used consistently #221)Naming conventions (matching #223)
ans->res(range_parallel_dsu, count_paths)curr->cur,prev->prv(5 files)seen/used->vis(3 files)priority->pri(pq_ds_undo_sliding_window)next->nxt(functional_graph, directed_cycle)Verification
clang-format --dry-run --Werror(dev config) passes on all touched filesg++ -std=c++20 -O2 -Wall -Wextraendl, no member-call.size()/.begin()forms, nolong long/vector<int>stragglers, no__lg