Refactoring ImageVisualShaderFactory::GetShader
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-FeedbackStyle.cpp
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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 <iostream>
19 #include <stdlib.h>
20
21 #include <dali-toolkit/internal/feedback/feedback-style.h>
22 #include <dali-toolkit-test-suite-utils.h>
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <dali/devel-api/adaptor-framework/feedback-player.h>
25
26 using namespace Dali;
27 using namespace Toolkit;
28
29 namespace Dali
30 {
31
32 namespace Internal
33 {
34
35 namespace Adaptor
36 {
37
38 /**
39  * @brief Sets the return value of the FeedbackPlayer::LoadFile() method of the stub implementation.
40  *
41  * Used to improve the line coverage.
42  *
43  * @param[in] feedbackPlayer The FeedbackPlayer singleton.
44  * @param[in] returnValue The desired return value for the FeedbackPlayer::LoadFile() method. Either true or false.
45  */
46 void SetLoadFileReturnValue( Dali::FeedbackPlayer feedbackPlayer, bool returnValue );
47
48 }
49
50 }
51
52 }
53
54 int UtcDaliFeedbackStyle(void)
55 {
56   // Not too much to test. Just to improve coverage.
57
58   ToolkitTestApplication application;
59   tet_infoline(" UtcDaliFeedbackStyle");
60
61   try
62   {
63     Toolkit::Internal::FeedbackStyle feedbackStyle;
64
65     Dali::FeedbackPlayer feedbackPlayer = Dali::FeedbackPlayer::Get();
66     Dali::Internal::Adaptor::SetLoadFileReturnValue(feedbackPlayer, false);
67
68     Toolkit::Internal::FeedbackStyle feedbackStyle2;
69
70     Dali::Internal::Adaptor::SetLoadFileReturnValue(feedbackPlayer, true);
71   }
72   catch(...)
73   {
74     tet_result(TET_FAIL);
75   }
76
77   tet_result(TET_PASS);
78   END_TEST;
79 }