am b3ac07c0: Camera2 Tests: fix some sanity checks

* commit 'b3ac07c0028b0afe8f9b009e37af90ec9a697b44':
  Camera2 Tests: fix some sanity checks
This commit is contained in:
Zhijun He 2013-09-17 18:29:35 -07:00 committed by Android Git Automerger
commit 8a658946e9
2 changed files with 6 additions and 10 deletions

View file

@ -134,10 +134,6 @@ TEST_F(CameraMetadataTest, types) {
TEST_F(CameraMetadataTest, RequiredFormats) {
TEST_EXTENSION_FORKING_INIT;
EXPECT_TRUE(
HasElementInArrayFromStaticTag(ANDROID_SCALER_AVAILABLE_FORMATS,
HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED));
EXPECT_TRUE(
HasElementInArrayFromStaticTag(ANDROID_SCALER_AVAILABLE_FORMATS,
HAL_PIXEL_FORMAT_BLOB)); // JPEG
@ -169,9 +165,11 @@ TEST_F(CameraMetadataTest, SaneResolutions) {
// Iff there are listed raw resolutions, the format should be available
int rawResolutionsCount =
GetEntryCountFromStaticTag(ANDROID_SCALER_AVAILABLE_RAW_SIZES);
EXPECT_EQ(rawResolutionsCount > 0,
HasElementInArrayFromStaticTag(ANDROID_SCALER_AVAILABLE_FORMATS,
HAL_PIXEL_FORMAT_RAW_SENSOR));
if (rawResolutionsCount > 0) {
EXPECT_TRUE(
HasElementInArrayFromStaticTag(ANDROID_SCALER_AVAILABLE_FORMATS,
HAL_PIXEL_FORMAT_RAW_SENSOR));
}
// Required processed sizes.
int processedSizeCount =

View file

@ -80,9 +80,7 @@ TEST_F(CameraModuleTest, LoadModuleBadIndices) {
int idx[] = { -1, mNumberOfCameras, mNumberOfCameras + 1 };
for (unsigned i = 0; i < sizeof(idx)/sizeof(idx[0]); ++i) {
// Since the initialization should fail at device open(), it doesn't
// matter which version of CameraNDevice is used here
mDevice = new Camera2Device(idx[i]);
CreateCamera(idx[i], &mDevice);
status_t deviceInitializeCode = initializeDevice(idx[i]);
EXPECT_NE(OK, deviceInitializeCode);
EXPECT_EQ(-ENODEV, deviceInitializeCode)