blob: e06e4e9c65eb412c8da0ec0e8a7185500ed1cb0d [file] [log] [blame]
Igor Murashkine302ee32012-11-05 11:14:49 -08001/*
2 * Copyright (C) 2012 The Android Open Source Project
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#include <gtest/gtest.h>
18
19#define LOG_TAG "DISABLED_CameraStreamTest"
20#define LOG_NDEBUG 0
21#include <utils/Log.h>
22
23#include "hardware/hardware.h"
24#include "hardware/camera2.h"
25
26#include "Camera2Device.h"
27#include "utils/StrongPointer.h"
28
29#include <gui/CpuConsumer.h>
30#include <gui/SurfaceTextureClient.h>
31
32#include "CameraStreamFixture.h"
33
34
35using namespace android;
36using namespace android::camera2;
37
38namespace android {
39namespace camera2 {
40namespace tests {
41
42class DISABLED_CameraStreamTest
43 : public ::testing::TestWithParam<CameraStreamParams>,
44 public CameraStreamFixture {
45
46public:
47 DISABLED_CameraStreamTest() : CameraStreamFixture(GetParam()) {
48 }
49
50 ~DISABLED_CameraStreamTest() {
51 }
52
53 virtual void SetUp() {
54 }
55 virtual void TearDown() {
56 }
57
58protected:
59
60};
61
62TEST_P(DISABLED_CameraStreamTest, CreateStream) {
63
64 if (HasFatalFailure()) {
65 return;
66 }
67
68 CreateStream();
69
70 if (HasFatalFailure()) {
71 return;
72 }
73
74 DeleteStream();
75}
76
77//TODO: use a combinatoric generator
78static CameraStreamParams TestParameters[] = {
79 {
80 /*cameraId*/ 0,
81 /*mFormat*/ HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED,
82 /*mHeapCount*/ 1
83 },
84 {
85 /*cameraId*/ 0,
86 /*mFormat*/ HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED,
87 /*mHeapCount*/ 2
88 },
89 {
90 /*cameraId*/ 0,
91 /*mFormat*/ HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED,
92 /*mHeapCount*/ 3
93 },
94 {
95 /*cameraId*/ 0,
96 /*mFormat*/ HAL_PIXEL_FORMAT_YCrCb_420_SP, // NV21
97 /*mHeapCount*/ 1
98 },
99 {
100 /*cameraId*/ 0,
101 /*mFormat*/ HAL_PIXEL_FORMAT_YCrCb_420_SP,
102 /*mHeapCount*/ 2
103 },
104 {
105 /*cameraId*/ 0,
106 /*mFormat*/ HAL_PIXEL_FORMAT_YCrCb_420_SP,
107 /*mHeapCount*/ 3
108 },
109 {
110 /*cameraId*/ 0,
111 /*mFormat*/ HAL_PIXEL_FORMAT_YV12,
112 /*mHeapCount*/ 1
113 },
114 {
115 /*cameraId*/ 0,
116 /*mFormat*/ HAL_PIXEL_FORMAT_YV12,
117 /*mHeapCount*/ 2
118 },
119 {
120 /*cameraId*/ 0,
121 /*mFormat*/ HAL_PIXEL_FORMAT_YV12,
122 /*mHeapCount*/ 3
123 },
124 {
125 /*cameraId*/ 0,
126 /*mFormat*/ HAL_PIXEL_FORMAT_RAW_SENSOR,
127 /*mHeapCount*/ 1
128 },
129 {
130 /*cameraId*/ 0,
131 /*mFormat*/ HAL_PIXEL_FORMAT_RAW_SENSOR,
132 /*mHeapCount*/ 2
133 },
134 {
135 /*cameraId*/ 0,
136 /*mFormat*/ HAL_PIXEL_FORMAT_RAW_SENSOR,
137 /*mHeapCount*/ 3
138 },
139};
140
141INSTANTIATE_TEST_CASE_P(StreamParameterCombinations, DISABLED_CameraStreamTest,
142 testing::ValuesIn(TestParameters));
143
144
145}
146}
147}
148