From c2537654815c015d82719dd46023997b647a5e9c Mon Sep 17 00:00:00 2001 From: Yin-Chia Yeh Date: Tue, 24 Mar 2015 10:48:08 -0700 Subject: [PATCH] Camera: update test per interface change CameraModule does not allow for accessing raw module pointer anymore. Also cleanup some warnings. Bug: 19897963 Change-Id: I111cc093f09f5fb3c4b13693d5d0687e1f441058 --- tests/camera2/CameraModuleFixture.h | 4 ++-- tests/camera2/CameraMultiStreamTests.cpp | 3 ++- tests/camera2/CameraStreamFixture.h | 2 +- tests/camera2/camera2_utils.cpp | 7 +++---- tests/camera2/camera2_utils.h | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/camera2/CameraModuleFixture.h b/tests/camera2/CameraModuleFixture.h index bf82a97f..3a2df69d 100644 --- a/tests/camera2/CameraModuleFixture.h +++ b/tests/camera2/CameraModuleFixture.h @@ -65,7 +65,7 @@ struct CameraModuleFixture { ASSERT_LE(0, mNumberOfCameras); ASSERT_LE( - CAMERA_MODULE_API_VERSION_2_0, mModule->getRawModule()->module_api_version) + CAMERA_MODULE_API_VERSION_2_0, mModule->getModuleApiVersion()) << "Wrong module API version"; /* For using this fixture in other tests only */ @@ -83,7 +83,7 @@ struct CameraModuleFixture { mDevice.clear(); if (!TEST_EXTENSION_FORKING_ENABLED) { - ASSERT_EQ(0, HWModuleHelpers::closeModule(mModule->getRawModule())) + ASSERT_EQ(0, HWModuleHelpers::closeModule(mModule->getDso())) << "Failed to close camera HAL module"; } } diff --git a/tests/camera2/CameraMultiStreamTests.cpp b/tests/camera2/CameraMultiStreamTests.cpp index bfadfea5..0f8d5782 100644 --- a/tests/camera2/CameraMultiStreamTests.cpp +++ b/tests/camera2/CameraMultiStreamTests.cpp @@ -528,7 +528,8 @@ TEST_F(CameraMultiStreamTest, DISABLED_MultiBurst) { // Find the right sizes for preview, metering, and capture streams int64_t minFrameDuration = DEFAULT_FRAME_DURATION; - Size processedMinSize, processedMaxSize, jpegMaxSize; + Size processedMinSize = {0, 0}, processedMaxSize = {0, 0}; + Size jpegMaxSize = {0, 0}; int32_t minIdx, maxIdx; GetMinSize(implDefData, implDefCount, &processedMinSize, &minIdx); diff --git a/tests/camera2/CameraStreamFixture.h b/tests/camera2/CameraStreamFixture.h index 8a8c27d2..e234f7ee 100644 --- a/tests/camera2/CameraStreamFixture.h +++ b/tests/camera2/CameraStreamFixture.h @@ -111,7 +111,7 @@ private: mHeight = entry.data.i32[1]; } else { buildOutputResolutions(); - const int32_t *implDefResolutions; + const int32_t *implDefResolutions = NULL; size_t implDefResolutionsCount; int format = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED; diff --git a/tests/camera2/camera2_utils.cpp b/tests/camera2/camera2_utils.cpp index 930b909a..d9629396 100644 --- a/tests/camera2/camera2_utils.cpp +++ b/tests/camera2/camera2_utils.cpp @@ -580,14 +580,13 @@ void FrameWaiter::onFrameAvailable(const BufferItem& /* item */) { mCondition.signal(); } -int HWModuleHelpers::closeModule(const hw_module_t* module) { +int HWModuleHelpers::closeModule(void *dso) { int status; - - if (!module) { + if (!dso) { return -EINVAL; } - status = dlclose(module->dso); + status = dlclose(dso); if (status != 0) { char const *err_str = dlerror(); ALOGE("%s dlclose failed, error: %s", __func__, err_str ?: "unknown"); diff --git a/tests/camera2/camera2_utils.h b/tests/camera2/camera2_utils.h index 2072eb67..ab1fcfb2 100644 --- a/tests/camera2/camera2_utils.h +++ b/tests/camera2/camera2_utils.h @@ -240,7 +240,7 @@ class FrameWaiter : public CpuConsumer::FrameAvailableListener { struct HWModuleHelpers { /* attempt to unload the library with dlclose */ - static int closeModule(const hw_module_t* module); + static int closeModule(void* dso); }; }