2 * Copyright (c) 2021 Samsung Electronics Co., Ltd. All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "Driver.test.h"
18 #include "TestHelper.h"
20 #include <gtest/gtest.h>
22 TEST(DriverTest, NoArg_NEG)
25 argv.add("circle-opselector");
27 ::testing::internal::CaptureStderr();
28 ::testing::internal::CaptureStdout();
29 int result = entry(1, argv.argv());
30 ::testing::internal::GetCapturedStdout();
31 ASSERT_EQ(EXIT_FAILURE, result);
34 TEST(DriverTest, Wrong_ID_NEG)
36 std::string str1 = "1";
37 std::string empty = "";
38 std::string no_integer = "1531538X5";
40 ASSERT_EQ(true, is_number(str1));
41 ASSERT_EQ(false, is_number(empty));
42 ASSERT_EQ(false, is_number(no_integer));
45 TEST(DriverTest, Split)
47 std::vector<uint32_t> vec1;
48 std::vector<uint32_t> vec2;
50 std::string hyphen = "1-3,8-10";
51 std::string comma = "1,2,3";
64 ASSERT_EQ(vec1, split_id_input(hyphen));
65 ASSERT_EQ(vec2, split_id_input(comma));