From cb86080b39af49ecff9a60ed47e8ae72993c34cd Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 摹曛, 26 11月 2015 03:26:06 +0800
Subject: [PATCH] Fix unit test

---
 libscpi/inc/scpi/config.h |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/libscpi/inc/scpi/config.h b/libscpi/inc/scpi/config.h
index c3f4e7e..2a8c90c 100644
--- a/libscpi/inc/scpi/config.h
+++ b/libscpi/inc/scpi/config.h
@@ -89,6 +89,18 @@
 #define USE_USER_ERROR_LIST 0
 #endif
 
+#ifndef USE_COMMAND_TAGS
+#define USE_COMMAND_TAGS 1
+#endif
+
+#ifndef USE_DEPRECATED_FUNCTIONS
+#define USE_DEPRECATED_FUNCTIONS 1
+#endif
+
+#ifndef USE_CUSTOM_DTOSTR
+#define USE_CUSTOM_DTOSTR 0
+#endif
+
 /* Compiler specific */
 /* RealView/Keil ARM Compiler, e.g. Cortex-M CPUs */
 #if defined(__CC_ARM)
@@ -167,14 +179,18 @@
 
 #if HAVE_DTOSTRE
 #define SCPIDEFINE_floatToStr(v, s, l) strlen(dtostre((double)(v), (s), 6, DTOSTR_PLUS_SIGN | DTOSTR_ALWAYS_SIGN | DTOSTR_UPPERCASE))
+#elif USE_CUSTOM_DTOSTRE
+#define SCPIDEFINE_floatToStr(v, s, l) strlen(SCPI_dtostre((v), (s), (l), 6, 0))
 #else
 #define SCPIDEFINE_floatToStr(v, s, l) snprintf((s), (l), "%g", (v))
 #endif
 
 #if HAVE_DTOSTRE
-#define SCPIDEFINE_doubleToStr(v, s, l) strlen(dtostre((v), (s), 6, DTOSTR_PLUS_SIGN | DTOSTR_ALWAYS_SIGN | DTOSTR_UPPERCASE))
+#define SCPIDEFINE_doubleToStr(v, s, l) strlen(dtostre((v), (s), 15, DTOSTR_PLUS_SIGN | DTOSTR_ALWAYS_SIGN | DTOSTR_UPPERCASE))
+#elif USE_CUSTOM_DTOSTRE
+#define SCPIDEFINE_doubleToStr(v, s, l) strlen(SCPI_dtostre((v), (s), (l), 15, 0))
 #else
-#define SCPIDEFINE_doubleToStr(v, s, l) snprintf((s), (l), "%lg", (v))
+#define SCPIDEFINE_doubleToStr(v, s, l) snprintf((s), (l), "%.15lg", (v))
 #endif
 
 

--
Gitblit v1.9.1