Use ms_user_get_root_length
[platform/core/multimedia/libmedia-service.git] / unittest / libmedia_service_unittest.cpp
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17
18 #include "libmedia_service_unittest.h"
19 #include "media-svc.h"
20 #include <media-util.h>
21
22
23 using ::testing::InitGoogleTest;
24 using ::testing::Test;
25 using ::testing::TestCase;
26
27 class libmedia_service_Test : public ::testing::Test {
28         protected:
29                 void SetUp() {
30                         std::cout << "SetUp()" << std::endl;
31                 }
32
33                 void TearDown() {
34                         std::cout << "TearDown()" << std::endl;
35                 }
36 };
37
38 TEST(libmedia_service_Test, media_svc_connect_disconnect_p)
39 {
40         MediaSvcHandle *handle = NULL;
41         int ret = MS_MEDIA_ERR_NONE;
42
43         ret = media_svc_connect(&handle, getuid(), false);
44         EXPECT_EQ(ret, MS_MEDIA_ERR_NONE);
45
46         ret = media_svc_disconnect(handle);
47         EXPECT_EQ(ret, MS_MEDIA_ERR_NONE);
48 }
49
50 int main(int argc, char **argv)
51 {
52         InitGoogleTest(&argc, argv);
53
54         return RUN_ALL_TESTS();
55 }