11/*
2- * Copyright (c) 2016-2022 Morwenn
2+ * Copyright (c) 2016-2025 Morwenn
33 * SPDX-License-Identifier: MIT
44 */
55#include < forward_list>
@@ -15,17 +15,17 @@ TEST_CASE( "presortedness measure: runs", "[probe][runs]" )
1515
1616 SECTION ( " simple tests" )
1717 {
18- std::forward_list<int > li = { 40 , 49 , 58 , 99 , 60 , 70 , 12 , 87 , 9 , 8 , 82 , 91 , 99 , 67 , 82 , 92 };
18+ const std::forward_list<int > li = { 40 , 49 , 58 , 99 , 60 , 70 , 12 , 87 , 9 , 8 , 82 , 91 , 99 , 67 , 82 , 92 };
1919 CHECK ( runs (li) == 5 );
2020 CHECK ( runs (li.begin (), li.end ()) == 5 );
2121
2222 // From Right invariant metrics and measures of
2323 // presortedness by Estivill-Castro, Mannila and Wood
24- std::forward_list<int > li2 = { 4 , 2 , 6 , 5 , 3 , 1 , 9 , 7 , 10 , 8 };
24+ const std::forward_list<int > li2 = { 4 , 2 , 6 , 5 , 3 , 1 , 9 , 7 , 10 , 8 };
2525 CHECK ( runs (li2) == 6 );
2626 CHECK ( runs (li2.begin (), li2.end ()) == 6 );
2727
28- std::vector<internal_compare<int >> tricky (li.begin (), li.end ());
28+ const std::vector<internal_compare<int >> tricky (li.begin (), li.end ());
2929 CHECK ( runs (tricky, &internal_compare<int >::compare_to) == 5 );
3030 }
3131
@@ -34,7 +34,7 @@ TEST_CASE( "presortedness measure: runs", "[probe][runs]" )
3434 // The upper bound should correspond to the size of
3535 // the input sequence minus one
3636
37- std::forward_list<int > li = { 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 };
37+ const std::forward_list<int > li = { 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 };
3838 auto max_n = runs.max_for_size (cppsort::utility::size (li));
3939 CHECK ( max_n == 10 );
4040 CHECK ( runs (li) == max_n );
0 commit comments