|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <QTest> |
|
19 |
|
20 #include <QList> |
|
21 #include "cxefakesettings.h" |
|
22 #include "unittest_cxequalitypresetssymbian.h" |
|
23 #include "cxequalitypresetssymbian.h" |
|
24 #include "cxequalitydetails.h" |
|
25 #include "cxutils.h" |
|
26 |
|
27 UnitTestCxeQualityPresetsSymbian::UnitTestCxeQualityPresetsSymbian() |
|
28 { |
|
29 } |
|
30 |
|
31 |
|
32 UnitTestCxeQualityPresetsSymbian::~UnitTestCxeQualityPresetsSymbian() |
|
33 { |
|
34 cleanup(); |
|
35 } |
|
36 |
|
37 |
|
38 void UnitTestCxeQualityPresetsSymbian::init() |
|
39 { |
|
40 mSettings = new CxeFakeSettings(); |
|
41 mQualityPresets = new CxeQualityPresetsSymbian(*mSettings); |
|
42 } |
|
43 |
|
44 void UnitTestCxeQualityPresetsSymbian::cleanup() |
|
45 { |
|
46 delete mQualityPresets; |
|
47 mQualityPresets = NULL; |
|
48 |
|
49 delete mSettings; |
|
50 mSettings = NULL; |
|
51 } |
|
52 |
|
53 void UnitTestCxeQualityPresetsSymbian::testImageQualityPresets() |
|
54 { |
|
55 CX_DEBUG_ENTER_FUNCTION(); |
|
56 |
|
57 QList<CxeImageDetails> imagePresets = |
|
58 mQualityPresets->imageQualityPresets(Cxe::PrimaryCameraIndex); |
|
59 |
|
60 QVERIFY(imagePresets.count() > 0); |
|
61 |
|
62 QCOMPARE(imagePresets[0].mWidth, 0); |
|
63 QCOMPARE(imagePresets[0].mHeight, 0); |
|
64 |
|
65 imagePresets.clear(); |
|
66 imagePresets = mQualityPresets->imageQualityPresets(Cxe::SecondaryCameraIndex); |
|
67 QVERIFY(imagePresets.count() > 0); |
|
68 |
|
69 QCOMPARE(imagePresets[0].mWidth, 0); |
|
70 QCOMPARE(imagePresets[0].mHeight, 0); |
|
71 |
|
72 CX_DEBUG_EXIT_FUNCTION(); |
|
73 } |
|
74 |
|
75 |
|
76 void UnitTestCxeQualityPresetsSymbian::testVideoQualityPresets() |
|
77 { |
|
78 CX_DEBUG_ENTER_FUNCTION(); |
|
79 |
|
80 QList<CxeVideoDetails> videoPresets = |
|
81 mQualityPresets->videoQualityPresets(Cxe::PrimaryCameraIndex); |
|
82 |
|
83 QVERIFY(videoPresets.count() > 0); |
|
84 |
|
85 QCOMPARE(videoPresets[0].mWidth, 640); |
|
86 QCOMPARE(videoPresets[0].mHeight, 360); |
|
87 |
|
88 videoPresets.clear(); |
|
89 videoPresets = mQualityPresets->videoQualityPresets(Cxe::SecondaryCameraIndex); |
|
90 QVERIFY(videoPresets.count() > 0); |
|
91 |
|
92 QCOMPARE(videoPresets[0].mWidth, 640); |
|
93 QCOMPARE(videoPresets[0].mHeight, 360); |
|
94 |
|
95 CX_DEBUG_EXIT_FUNCTION(); |
|
96 } |
|
97 |
|
98 // main() function non-GUI testing |
|
99 QTEST_MAIN(UnitTestCxeQualityPresetsSymbian); |
|
100 |
|
101 // End of file |