Dali 3D User Interface Engine
utc-Dali-TtsPlayer.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 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 <dali/dali.h>
19 #include <dali-test-suite-utils.h>
20 
21 using namespace Dali;
22 
24 {
26 }
27 
29 {
31 }
32 
33 namespace
34 {
35 
36 } // unnamed namespace
37 
39 {
40  Dali::TtsPlayer player;
41  DALI_TEST_CHECK( !player );
42  END_TEST;
43 }
44 
46 {
47  Dali::TtsPlayer player;
48  Dali::TtsPlayer copy( player );
49  DALI_TEST_CHECK( copy == player );
50 
51  END_TEST;
52 }
53 
55 {
56  Dali::TtsPlayer player;
57  Dali::TtsPlayer copy;
58  DALI_TEST_CHECK( ! copy );
59  copy = player;
60  DALI_TEST_CHECK( copy == player );
61 
62  END_TEST;
63 }
64 
66 {
67  Dali::TtsPlayer* player = new Dali::TtsPlayer();
68  delete player;
69 
70  DALI_TEST_CHECK( true );
71  END_TEST;
72 }
73 
75 {
76  Internal::Adaptor::TtsPlayer* internalPlayer = NULL;
77  Dali::TtsPlayer player(internalPlayer);
78  DALI_TEST_CHECK( !player ); // Should not reach here!
79 
80  END_TEST;
81 }
82 
84 {
86  DALI_TEST_CHECK( !player );
87  END_TEST;
88 }
89 
91 {
93 
94  try
95  {
96  player.Play("text");
97  DALI_TEST_CHECK( false ); // Should not reach here!
98  }
99  catch( ... )
100  {
101  DALI_TEST_CHECK( true );
102  }
103 
104  END_TEST;
105 }
106 
108 {
110 
111  try
112  {
113  player.Stop();
114  DALI_TEST_CHECK( false ); // Should not reach here!
115  }
116  catch( ... )
117  {
118  DALI_TEST_CHECK( true );
119  }
120 
121  END_TEST;
122 }
123 
125 {
127 
128  try
129  {
130  player.Pause();
131  DALI_TEST_CHECK( false ); // Should not reach here!
132  }
133  catch( ... )
134  {
135  DALI_TEST_CHECK( true );
136  }
137 
138  END_TEST;
139 }
140 
142 {
144 
145  try
146  {
147  player.Resume();
148  DALI_TEST_CHECK( false ); // Should not reach here!
149  }
150  catch( ... )
151  {
152  DALI_TEST_CHECK( true );
153  }
154 
155  END_TEST;
156 }
157 
159 {
161 
162  try
163  {
164  Dali::TtsPlayer::State state = player.GetState();
165  tet_printf( "Error: TtsPlayer state = %d, expected exception\n", (unsigned int)state );
166  DALI_TEST_CHECK( false ); // Should not reach here!
167  }
168  catch( ... )
169  {
170  DALI_TEST_CHECK( true );
171  }
172 
173  END_TEST;
174 }
175 
Dali Docs Home
Read more about Dali