Path: blob/master/modules/gapi/test/gapi_util_tests.cpp
16337 views
// This file is part of OpenCV project.1// It is subject to the license terms in the LICENSE file found in the top-level directory2// of this distribution and at http://opencv.org/license.html.3//4// Copyright (C) 2018 Intel Corporation567#include "test_precomp.hpp"89#include <type_traits>1011#include "opencv2/gapi/util/util.hpp"1213namespace opencv_test14{1516TEST(GAPIUtil, AllSatisfy)17{18static_assert(true == cv::detail::all_satisfy<std::is_integral, long, int, char>::value,19"[long, int, char] are all integral types");20static_assert(true == cv::detail::all_satisfy<std::is_integral, char>::value,21"char is an integral type");2223static_assert(false == cv::detail::all_satisfy<std::is_integral, float, int, char>::value,24"[float, int, char] are NOT all integral types");25static_assert(false == cv::detail::all_satisfy<std::is_integral, int, char, float>::value,26"[int, char, float] are NOT all integral types");27static_assert(false == cv::detail::all_satisfy<std::is_integral, float>::value,28"float is not an integral types");29}3031TEST(GAPIUtil, AllButLast)32{33using test1 = cv::detail::all_but_last<long, int, float>::type;34static_assert(true == cv::detail::all_satisfy<std::is_integral, test1>::value,35"[long, int] are all integral types (float skipped)");3637using test2 = cv::detail::all_but_last<int, float, char>::type;38static_assert(false == cv::detail::all_satisfy<std::is_integral, test2>::value,39"[int, float] are NOT all integral types");40}4142} // namespace opencv_test434445