diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2012-05-14 15:25:27 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2012-05-14 15:27:00 -0700 |
commit | 6adfd6b8ce32f042d001296f08e5b439af2635c1 (patch) | |
tree | ed464cdb8cfbe40cba465ce4c8acc2758117281f /tests | |
parent | e6a3c3c1135d8c097be5e82103abdd832c02de7c (diff) | |
download | hardware_libhardware-6adfd6b8ce32f042d001296f08e5b439af2635c1.zip hardware_libhardware-6adfd6b8ce32f042d001296f08e5b439af2635c1.tar.gz hardware_libhardware-6adfd6b8ce32f042d001296f08e5b439af2635c1.tar.bz2 |
Camera2: Add test for construct_default_request.
Bug: 6243944
Change-Id: I59b03d7ebece2a4b7672b265bd9f960b3faea621
Diffstat (limited to 'tests')
-rw-r--r-- | tests/camera2/camera2.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/camera2/camera2.cpp b/tests/camera2/camera2.cpp index cc2face..6c22426 100644 --- a/tests/camera2/camera2.cpp +++ b/tests/camera2/camera2.cpp @@ -572,4 +572,34 @@ TEST_F(Camera2Test, CaptureBurstRaw) { } } +TEST_F(Camera2Test, ConstructDefaultRequests) { + status_t res; + + for (int id = 0; id < getNumCameras(); id++) { + if (!isHal2Supported(id)) continue; + + ASSERT_NO_FATAL_FAILURE(setUpCamera(id)); + + for (int i = CAMERA2_TEMPLATE_PREVIEW; i < CAMERA2_TEMPLATE_COUNT; + i++) { + camera_metadata_t *request = NULL; + res = mDevice->ops->construct_default_request(mDevice, + i, + &request); + EXPECT_EQ(NO_ERROR, res) << + "Unable to construct request from template type %d", i; + EXPECT_TRUE(request != NULL); + EXPECT_LT((size_t)0, get_camera_metadata_entry_count(request)); + EXPECT_LT((size_t)0, get_camera_metadata_data_count(request)); + + IF_ALOGV() { + std::cout << " ** Template type " << i << ":"<<std::endl; + dump_camera_metadata(request, 0, 2); + } + + free_camera_metadata(request); + } + } +} + } // namespace android |