EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: EPICS Base Release-Candidate Double Feature!
From: <[email protected]>
To: <[email protected]>, <[email protected]>
Date: Sat, 12 Nov 2016 14:06:05 +0000
Hi Andrew,

Your patch does indeed fix the formatting  problem present in earlier versions of Visual Studio, but it appears that when Microsoft corrected this issue in Visual Studio 2015 they decided to remove the  _set_output_format()  function at the same time! So I just needed to adjust the test to: 

#if defined(_WIN32) 
#if    (defined(_MINGW) &&  __MSVCRT_VERSION__ >= 0x0800) ||  \
              (defined(_MSC_VER) && _MSC_VER < 1900)
    _set_output_format(_TWO_DIGIT_EXPONENT);
#endif
#endif /* defined(_WIN32) */

and then it works OK with both VS 2010 and 2015 for     testPlan(163)

Regards,

Freddie

-----Original Message-----
From: Andrew Johnson [mailto:[email protected]] 
Sent: 11 November 2016 20:43
To: Akeroyd, Freddie (STFC,RAL,ISIS); [email protected]
Subject: Re: EPICS Base Release-Candidate Double Feature!

Hi Freddie,

On 11/10/2016 05:52 PM, [email protected] wrote:
> epicsStdioTest.c plans 166 tests on Windows but 163 otherwise, if I 
> build using Visual Studio 2010 instead 166 tests passed OK. On further 
> investigation it seems the issue occurs within
> testEpicsSnprintf() and is due to Microsoft changing (fixing) the 
> formatting  of "%8.2e" by sprint():
> 
> In Visual Studio 2010 this generates    1.23e+004
> In Visual Studio 2015 this generates    1.23e+04

Thanks for the report. Does this patch make the test pass on both compilers?

=== modified file 'src/libCom/test/epicsStdioTest.c'
--- src/libCom/test/epicsStdioTest.c    2012-02-03 22:12:06 +0000
+++ src/libCom/test/epicsStdioTest.c    2016-11-11 20:40:36 +0000
@@ -39,6 +39,11 @@
     int size;
     int rtn, rlen;

+#if defined(WIN32) && \
+    (!defined(_MINGW) || __MSVCRT_VERSION__ >= 0x0800)
+    _set_output_format(_TWO_DIGIT_EXPONENT);
+#endif
+
     sprintf(exbuffer, format, ivalue, fvalue, svalue);
     rlen = strlen(expected)+1;

@@ -122,11 +127,7 @@

 MAIN(epicsStdioTest)
 {
-#ifdef _WIN32
-    testPlan(166);
-#else
     testPlan(163);
-#endif
     testEpicsSnprintf();
     testStdoutRedir("report");
     return testDone();


- Andrew


--
Arguing for surveillance because you have nothing to hide is no different than making the claim, "I don't care about freedom of speech because I have nothing to say." -- Edward Snowdon


Replies:
Re: EPICS Base Release-Candidate Double Feature! Johnson, Andrew N.
References:
EPICS Base Release-Candidate Double Feature! Andrew Johnson
RE: EPICS Base Release-Candidate Double Feature! freddie.akeroyd
Re: EPICS Base Release-Candidate Double Feature! Andrew Johnson

Navigate by Date:
Prev: Re: Modbus Device Support for Advantech ADAM6017, 6018 David Vine
Next: Re: EPICS Base Release-Candidate Double Feature! Johnson, Andrew N.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: EPICS Base Release-Candidate Double Feature! Andrew Johnson
Next: Re: EPICS Base Release-Candidate Double Feature! Johnson, Andrew N.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 12 Nov 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·