summaryrefslogtreecommitdiffstats
path: root/camera/tests/VendorTagDescriptorTests.cpp
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2015-06-16 11:00:37 -0700
committerRuben Brunk <rubenbrunk@google.com>2015-07-06 17:49:44 -0700
commit3450ba7879be6522ea46a56c5e66e5382f5dd5ba (patch)
tree201ed5e416af4f44012e6b5c7f2b16bd30cfc673 /camera/tests/VendorTagDescriptorTests.cpp
parenta3b3caaae3fc23b99c5c455ee429f79c270cfbae (diff)
downloadframeworks_av-3450ba7879be6522ea46a56c5e66e5382f5dd5ba.zip
frameworks_av-3450ba7879be6522ea46a56c5e66e5382f5dd5ba.tar.gz
frameworks_av-3450ba7879be6522ea46a56c5e66e5382f5dd5ba.tar.bz2
camera2: Fix native binder interface and add tests.
- Add CameraBinderTests for limited coverage of native camera2 binder interfaces for the camera service. - Fix several bugs in the native binder interfaces. Bug: 18468810 Change-Id: Iab2d81a5cacd20daf7454aeeed033cc13d88452c
Diffstat (limited to 'camera/tests/VendorTagDescriptorTests.cpp')
-rw-r--r--camera/tests/VendorTagDescriptorTests.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/camera/tests/VendorTagDescriptorTests.cpp b/camera/tests/VendorTagDescriptorTests.cpp
index 6624e79..9082dbf 100644
--- a/camera/tests/VendorTagDescriptorTests.cpp
+++ b/camera/tests/VendorTagDescriptorTests.cpp
@@ -53,6 +53,10 @@ static bool ContainsTag(uint32_t* tagArray, size_t size, uint32_t tag) {
extern "C" {
+static int zero_get_tag_count(const vendor_tag_ops_t* vOps) {
+ return 0;
+}
+
static int default_get_tag_count(const vendor_tag_ops_t* vOps) {
return VENDOR_TAG_COUNT_ERR;
}
@@ -173,10 +177,13 @@ TEST(VendorTagDescriptorTest, ErrorConditions) {
vendor_tag_ops_t vOps;
FillWithDefaults(&vOps);
+ // Make empty tag count
+ vOps.get_tag_count = zero_get_tag_count;
+
// Ensure create fails when using null vOps
EXPECT_EQ(BAD_VALUE, VendorTagDescriptor::createDescriptorFromOps(/*vOps*/NULL, vDesc));
- // Ensure create works when there are no vtags defined in a well-formed vOps
+ // Ensure creat succeeds for empty vendor tag ops
ASSERT_EQ(OK, VendorTagDescriptor::createDescriptorFromOps(&vOps, vDesc));
// Ensure defaults are returned when no vtags are defined, or tag is unknown