Path: blob/master/modules/gapi/test/own/scalar_tests.cpp
16339 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"8#include "opencv2/gapi/own/scalar.hpp"910namespace opencv_test11{1213TEST(Scalar, CreateEmpty)14{15cv::gapi::own::Scalar s;1617for (int i = 0; i < 4; ++i)18{19EXPECT_EQ(s[i], 0.0);20}21}2223TEST(Scalar, CreateFromVal)24{25cv::gapi::own::Scalar s(5.0);2627EXPECT_EQ(s[0], 5.0);28EXPECT_EQ(s[1], 0.0);29EXPECT_EQ(s[2], 0.0);30EXPECT_EQ(s[3], 0.0);31}3233TEST(Scalar, CreateFromVals)34{35cv::gapi::own::Scalar s(5.3, 3.3, 4.1, -2.0);3637EXPECT_EQ(s[0], 5.3);38EXPECT_EQ(s[1], 3.3);39EXPECT_EQ(s[2], 4.1);40EXPECT_EQ(s[3], -2.0);41}4243} // namespace opencv_test444546