• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 HiHope Open Source Organization.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <cerrno>
17 #include <cstdio>
18 #include <cstdlib>
19 #include <string>
20 #include <fcntl.h>
21 #include <unistd.h>
22 #include <vector>
23 #include <arpa/inet.h>
24 #include <gtest/gtest.h>
25 #include <netinet/in.h>
26 #include <sys/stat.h>
27 #include <sys/socket.h>
28 #include <sys/types.h>
29 #include "securec.h"
30 
31 using namespace testing::ext;
32 
33 class HatsSchedYieldTest : public testing::Test {
34 public:
35 static void SetUpTestCase();
36 static void TearDownTestCase();
37 void SetUp();
38 void TearDown();
39 private:
40 };
SetUp()41 void HatsSchedYieldTest::SetUp()
42 {
43 }
TearDown()44 void HatsSchedYieldTest::TearDown()
45 {
46 }
SetUpTestCase()47 void HatsSchedYieldTest::SetUpTestCase()
48 {
49 }
TearDownTestCase()50 void HatsSchedYieldTest::TearDownTestCase()
51 {
52 }
53 
54 /*
55  * @tc.number : SUB_KERNEL_SYSCALL_SCHEDYIELD_0100
56  * @tc.name   : SchedyieldTestSuccess_0001
57  * @tc.desc   : sched_yield test success.
58  * @tc.size   : MediumTest
59  * @tc.type   : Function
60  * @tc.level  : Level 1
61  */
62 HWTEST_F(HatsSchedYieldTest, SchedyieldTestSuccess_0001, Function | MediumTest | Level1)
63 {
64     int ret = sched_yield();
65     EXPECT_EQ(ret, 0);
66 }
67