diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 1bf35b727..5bc69b0e2 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -3168,43 +3168,51 @@ void nullPointer_wmemcmp(wchar_t *p) #define pred [](int i){return i==0;} -// -// -// -void stdfind(const std::list &ints1, const std::list &ints2) +void stdalgorithm(const std::list &ints1, const std::list &ints2) { + // // cppcheck-suppress mismatchingContainers // cppcheck-suppress ignoredReturnValue std::find(ints1.begin(), ints2.end(), 123); // cppcheck-suppress mismatchingContainers if (std::find(ints1.begin(), ints1.end(), 123) == ints2.end()) {} + // // cppcheck-suppress mismatchingContainers // cppcheck-suppress ignoredReturnValue std::find_if(ints1.begin(), ints2.end(), pred); // cppcheck-suppress mismatchingContainers if (std::find_if(ints1.begin(), ints1.end(), pred) == ints2.end()) {} + // // cppcheck-suppress mismatchingContainers // cppcheck-suppress ignoredReturnValue std::find_if_not(ints1.begin(), ints2.end(), pred); // cppcheck-suppress mismatchingContainers if (std::find_if_not(ints1.begin(), ints1.end(), pred) == ints2.end()) {} -} -// -// -// -void stdallof(const std::list &ints1, const std::list &ints2) { + // // cppcheck-suppress mismatchingContainers // cppcheck-suppress ignoredReturnValue std::all_of(ints1.begin(), ints2.end(), pred); + // // cppcheck-suppress mismatchingContainers // cppcheck-suppress ignoredReturnValue std::any_of(ints1.begin(), ints2.end(), pred); + // // cppcheck-suppress mismatchingContainers // cppcheck-suppress ignoredReturnValue std::none_of(ints1.begin(), ints2.end(), pred); + + // + // cppcheck-suppress mismatchingContainers + // cppcheck-suppress ignoredReturnValue + std::count(ints1.begin(), ints2.end(), 123); + + // + // cppcheck-suppress mismatchingContainers + // cppcheck-suppress ignoredReturnValue + std::count_if(ints1.begin(), ints2.end(), pred); }