From 79ca37aefec8e26a1a74b0b2b9c36e0c9af6d9c1 Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周一, 29 1月 2018 16:21:41 +0800
Subject: [PATCH] Fix ASAN unit tests for travis

---
 libscpi/src/minimal.c |   68 ++++++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/libscpi/src/minimal.c b/libscpi/src/minimal.c
index 630f55d..ae56da6 100644
--- a/libscpi/src/minimal.c
+++ b/libscpi/src/minimal.c
@@ -40,6 +40,7 @@
 #include "scpi/constants.h"
 #include "scpi/error.h"
 #include "scpi/ieee488.h"
+#include "utils_private.h"
 
 /**
  * Command stub function
@@ -80,6 +81,9 @@
     scpi_error_t error;
     SCPI_ErrorPop(context, &error);
     SCPI_ResultError(context, &error);
+#if USE_DEVICE_DEPENDENT_ERROR_INFORMATION
+    SCPIDEFINE_free(&context->error_info_heap, error.device_dependent_info, false);
+#endif
     return SCPI_RES_OK;
 }
 
@@ -90,6 +94,18 @@
  */
 scpi_result_t SCPI_SystemErrorCountQ(scpi_t * context) {
     SCPI_ResultInt32(context, SCPI_ErrorCount(context));
+
+    return SCPI_RES_OK;
+}
+
+/**
+ * STATus:QUEStionable:CONDition?
+ * @param context
+ * @return
+ */
+scpi_result_t SCPI_StatusQuestionableConditionQ(scpi_t * context) {
+    /* return value */
+    SCPI_ResultInt32(context, SCPI_RegGet(context, SCPI_REG_QUESC));
 
     return SCPI_RES_OK;
 }
@@ -135,6 +151,58 @@
 }
 
 /**
+ * STATus:OPERation:CONDition?
+ * @param context
+ * @return
+ */
+scpi_result_t SCPI_StatusOperationConditionQ(scpi_t * context) {
+    /* return value */
+    SCPI_ResultInt32(context, SCPI_RegGet(context, SCPI_REG_OPERC));
+
+    return SCPI_RES_OK;
+}
+
+/**
+ * STATus:OPERation[:EVENt]?
+ * @param context
+ * @return
+ */
+scpi_result_t SCPI_StatusOperationEventQ(scpi_t * context) {
+    /* return value */
+    SCPI_ResultInt32(context, SCPI_RegGet(context, SCPI_REG_OPER));
+
+    /* clear register */
+    SCPI_RegSet(context, SCPI_REG_OPER, 0);
+
+    return SCPI_RES_OK;
+}
+
+/**
+ * STATus:OPERation:ENABle?
+ * @param context
+ * @return
+ */
+ scpi_result_t SCPI_StatusOperationEnableQ(scpi_t * context) {
+    /* return value */
+    SCPI_ResultInt32(context, SCPI_RegGet(context, SCPI_REG_OPERE));
+
+    return SCPI_RES_OK;
+}
+
+/**
+ * STATus:OPERation:ENABle
+ * @param context
+ * @return
+ */
+scpi_result_t SCPI_StatusOperationEnable(scpi_t * context) {
+    int32_t new_OPERE;
+    if (SCPI_ParamInt32(context, &new_OPERE, TRUE)) {
+        SCPI_RegSet(context, SCPI_REG_OPERE, (scpi_reg_val_t) new_OPERE);
+    }
+    return SCPI_RES_OK;
+}
+
+/**
  * STATus:PRESet
  * @param context
  * @return

--
Gitblit v1.9.1