TEEC_Result res = TEEC_InitializeContext(NULL, &context);
contextPtr.reset(&context);
- // OpTEE return TEEC_ERROR_ITEM_NOT_FOUND, when cannot access to /dev/tee
+#ifdef TEF_BACKEND_OPTEE
+ TEEC_Result desiredResult = isTeeEnabled ? TEEC_ERROR_ITEM_NOT_FOUND : TEEC_ERROR_NOT_IMPLEMENTED;
+#else
TEEC_Result desiredResult = isTeeEnabled ? TEEC_ERROR_ACCESS_DENIED : TEEC_ERROR_NOT_IMPLEMENTED;
+#endif /* TEF_BACKEND_OPTEE */
RUNNER_ASSERT_MSG(res == desiredResult,
"Initializing context returned wrong error code: " << errToString(res)
<< ", expected: " << errToString(desiredResult));