Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / fluid / modules / gapi / test / own / scalar_tests.cpp
1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
4 //
5 // Copyright (C) 2018-2019 Intel Corporation
6
7
8 #include "test_precomp.hpp"
9 #include "opencv2/gapi/own/scalar.hpp"
10
11 namespace opencv_test
12 {
13
14 TEST(Scalar, CreateEmpty)
15 {
16     cv::gapi::own::Scalar s;
17
18     for (int i = 0; i < 4; ++i)
19     {
20         EXPECT_EQ(s[i], 0.0);
21     }
22 }
23
24 TEST(Scalar, CreateFromVal)
25 {
26     cv::gapi::own::Scalar s(5.0);
27
28     EXPECT_EQ(s[0], 5.0);
29     EXPECT_EQ(s[1], 0.0);
30     EXPECT_EQ(s[2], 0.0);
31     EXPECT_EQ(s[3], 0.0);
32 }
33
34 TEST(Scalar, CreateFromVals)
35 {
36     cv::gapi::own::Scalar s(5.3, 3.3, 4.1, -2.0);
37
38     EXPECT_EQ(s[0], 5.3);
39     EXPECT_EQ(s[1], 3.3);
40     EXPECT_EQ(s[2], 4.1);
41     EXPECT_EQ(s[3], -2.0);
42 }
43
44 } // namespace opencv_test