From b90a17f64ff7f6d761d6e2332c5cd8a06e74f9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 2 Nov 2016 09:29:15 +0100 Subject: [PATCH] Test std::all_of, std::any_of, std::none_of --- test/cfg/std.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 4e31408b3..cfada1320 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -3165,6 +3165,9 @@ void nullPointer_wmemcmp(wchar_t *p) #include #include +// +// +// void stdfind(const std::list &ints1, const std::list &ints2) { // cppcheck-suppress mismatchingContainers @@ -3185,3 +3188,22 @@ void stdfind(const std::list &ints1, const std::list &ints2) // cppcheck-suppress mismatchingContainers if (std::find_if_not(ints1.begin(), ints1.end(), [](int i){return i!=0;}) == ints2.end()) {} } + +// +// +// +void stdallof(const std::list &ints1, const std::list &ints2) { + bool pred(int); + + // 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); +}