@ -66,7 +66,8 @@ status_t setupTestMapper(ZoomRatioMapper *m, float maxDigitalZoom,
return res ;
}
return m - > initZoomRatioTags ( & deviceInfo , hasZoomRatioRange , usePreCorrectArray ) ;
* m = ZoomRatioMapper ( & deviceInfo , hasZoomRatioRange , usePreCorrectArray ) ;
return OK ;
}
TEST ( ZoomRatioTest , Initialization ) {
@ -86,12 +87,12 @@ TEST(ZoomRatioTest, Initialization) {
res = ZoomRatioMapper : : overrideZoomRatioTags ( & deviceInfo , & supportNativeZoomRatio ) ;
ASSERT_EQ ( res , OK ) ;
ASSERT_EQ ( supportNativeZoomRatio , false ) ;
res = mapperNoZoomRange . initZoomRatioTags ( & deviceInfo ,
mapperNoZoomRange = ZoomRatioMapper ( & deviceInfo ,
supportNativeZoomRatio , true /*usePreCorrectArray*/ ) ;
ASSERT_ EQ( res , OK ) ;
res = mapperNoZoomRange . initZoomRatioTags ( & deviceInfo ,
ASSERT_ TRUE( mapperNoZoomRange . isValid ( ) ) ;
mapperNoZoomRange = ZoomRatioMapper ( & deviceInfo ,
supportNativeZoomRatio , false /*usePreCorrectArray*/ ) ;
ASSERT_ EQ( res , OK ) ;
ASSERT_ TRUE( mapperNoZoomRange . isValid ( ) ) ;
entry = deviceInfo . find ( ANDROID_CONTROL_ZOOM_RATIO_RANGE ) ;
ASSERT_EQ ( entry . count , 2U ) ;
@ -120,12 +121,12 @@ TEST(ZoomRatioTest, Initialization) {
ASSERT_EQ ( res , OK ) ;
ASSERT_EQ ( supportNativeZoomRatio , true ) ;
ZoomRatioMapper mapperWithZoomRange ;
res = mapperWithZoomRange . initZoomRatioTags ( & deviceInfo ,
mapperWithZoomRange = ZoomRatioMapper ( & deviceInfo ,
supportNativeZoomRatio , true /*usePreCorrectArray*/ ) ;
ASSERT_ EQ( res , OK ) ;
res = mapperWithZoomRange . initZoomRatioTags ( & deviceInfo ,
ASSERT_ TRUE( mapperWithZoomRange . isValid ( ) ) ;
mapperWithZoomRange = ZoomRatioMapper ( & deviceInfo ,
supportNativeZoomRatio , false /*usePreCorrectArray*/ ) ;
ASSERT_ EQ( res , OK ) ;
ASSERT_ TRUE( mapperWithZoomRange . isValid ( ) ) ;
entry = deviceInfo . find ( ANDROID_CONTROL_ZOOM_RATIO_RANGE ) ;
ASSERT_EQ ( entry . count , 2U ) ;