Refactor tests a bit to reduce code duplication.
(Still needs more work).
Change-Id: I164c206ab0deb354c3298ee00b6570e9180c4f56
diff --git a/google_keymaster.cpp b/google_keymaster.cpp
index 582a03b..f34d1ea 100644
--- a/google_keymaster.cpp
+++ b/google_keymaster.cpp
@@ -243,6 +243,9 @@
void GoogleKeymaster::UpdateOperation(const UpdateOperationRequest& request,
UpdateOperationResponse* response) {
+ if (response == NULL)
+ return;
+
OpTableEntry* entry = FindOperation(request.op_handle);
if (entry == NULL) {
response->error = KM_ERROR_INVALID_OPERATION_HANDLE;
@@ -259,6 +262,9 @@
void GoogleKeymaster::FinishOperation(const FinishOperationRequest& request,
FinishOperationResponse* response) {
+ if (response == NULL)
+ return;
+
OpTableEntry* entry = FindOperation(request.op_handle);
if (entry == NULL) {
response->error = KM_ERROR_INVALID_OPERATION_HANDLE;