Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: RE: Problem in macLib macExpandString?
From: Mark Rivers <rivers@cars.uchicago.edu>
To: Michael Davidsaver <mdavidsaver@gmail.com>
Cc: EPICS Core Talk <core-talk@aps.anl.gov>
Date: Mon, 17 Apr 2017 01:54:30 +0000
Hi Michael,

Thanks for the suggestion.  I have made the following changes to macLibTest.c

corvette:src/libCom/test>diff macLibTest.c.orig macLibTest.c
68c68
<     testPlan(89);
---
>     testPlan(91);
204a205,207
>
>     check("$(FOO)$(FOO1)", "!VAL2$(FOO1,undefined)");
>     check("$(FOO1)$(FOO)", "!$(FOO1,undefined)VAL2");

When I run that new version of the test with the version of macCore.c in 3.15.5 I get the following output:

corvette:src/libCom/test>O.linux-x86_64/macLibTest
1..91
ok  1 - FOO => FOO
ok  2 - $(FOO) => $(FOO,undefined)
ok  3 - ${FOO} => $(FOO,undefined)
ok  4 - ${FOO=${FOO}} => $(FOO,undefined)
ok  5 - ${FOO,FOO} => $(FOO,undefined)
ok  6 - ${FOO,FOO=${FOO}} => $(FOO,recursive)
ok  7 - ${FOO,BAR} => $(FOO,undefined)
ok  8 - ${FOO,BAR=baz} => $(FOO,undefined)
ok  9 - ${FOO,BAR=${FOO}} => $(FOO,undefined)
ok 10 - ${FOO,BAR=baz,FUM} => $(FOO,undefined)
ok 11 - ${FOO=${BAR},BAR=${FOO}} => $(FOO,undefined)
ok 12 - ${FOO,FOO=${BAR},BAR=${FOO}} => $(BAR,recursive)
ok 13 - ${=} =>
ok 14 - x${=}y => xy
ok 15 - ${,=} =>
ok 16 - x${,=}y => xy
ok 17 - ${FOO=} =>
ok 18 - x${FOO=}y => xy
ok 19 - ${FOO=,} =>
ok 20 - x${FOO=,}y => xy
ok 21 - ${FOO,FOO=} =>
ok 22 - x${FOO,FOO=}y => xy
ok 23 - ${FOO=,BAR} =>
ok 24 - x${FOO=,BAR}y => xy
ok 25 - ${FOO=${BAR=}} =>
ok 26 - x${FOO=${BAR=}}y => xy
ok 27 - ${FOO=,BAR=baz} =>
ok 28 - x${FOO=,BAR=baz}y => xy
ok 29 - ${FOO=${BAR},BAR=} =>
ok 30 - x${FOO=${BAR},BAR=}y => xy
ok 31 - ${=BAR} => BAR
ok 32 - x${=BAR}y => xBARy
ok 33 - ${FOO=BAR} => BAR
ok 34 - x${FOO=BAR}y => xBARy
ok 35 - ${FOO} => BLETCH
ok 36 - ${FOO,FOO} => BLETCH
ok 37 - x${FOO}y => xBLETCHy
ok 38 - x${FOO}y${FOO}z => xBLETCHyBLETCHz
ok 39 - ${FOO=BAR} => BLETCH
ok 40 - x${FOO=BAR}y => xBLETCHy
ok 41 - ${FOO=${BAZ}} => BLETCH
ok 42 - ${FOO=${BAZ},BAR=${BAZ}} => BLETCH
ok 43 - x${FOO=${BAZ}}y => xBLETCHy
ok 44 - x${FOO=${BAZ},BAR=${BAZ}}y => xBLETCHy
ok 45 - ${BAR=${FOO}} => BLETCH
ok 46 - x${BAR=${FOO}}y => xBLETCHy
ok 47 - w${BAR=x${FOO}y}z => wxBLETCHyz
ok 48 - ${FOO,FOO=BAR} => BAR
ok 49 - x${FOO,FOO=BAR}y => xBARy
ok 50 - ${BAR,BAR=${FOO}} => BLETCH
ok 51 - x${BAR,BAR=${FOO}}y => xBLETCHy
ok 52 - ${BAR,BAR=${${FOO}},BLETCH=GRIBBLE} => GRIBBLE
ok 53 - x${BAR,BAR=${${FOO}},BLETCH=GRIBBLE}y => xGRIBBLEy
ok 54 - ${${BAR,BAR=${FOO}},BLETCH=GRIBBLE} => GRIBBLE
ok 55 - x${${BAR,BAR=${FOO}},BLETCH=GRIBBLE}y => xGRIBBLEy
ok 56 - ${N=${FOO}/${BAR},BAR=GLEEP} => BLETCH/GLEEP
ok 57 - ${FOO}/${BAR} => BLETCH/GLEEP
ok 58 - x${FOO}/${BAR}y => xBLETCH/GLEEPy
ok 59 - ${FOO,BAR}/${BAR} => BLETCH/GLEEP
ok 60 - ${FOO,BAR=x}/${BAR} => BLETCH/GLEEP
ok 61 - ${BAZ=BLETCH,BAR}/${BAR} => BLETCH/GLEEP
ok 62 - ${BAZ=BLETCH,BAR=x}/${BAR} => BLETCH/GLEEP
ok 63 - ${N=${FOO}/${BAR}} => BLETCH/GLEEP
ok 64 - ${${FOO}} => BAR
ok 65 - x${${FOO}}y => xBARy
ok 66 - ${${FOO}=GRIBBLE} => BAR
ok 67 - x${${FOO}=GRIBBLE}y => xBARy
ok 68 - ${${FOO}} => GLEEP
ok 69 - ${BLETCH=${FOO}} => GLEEP
ok 70 - ${FOO} => GLEEP
ok 71 - ${FOO=BLETCH,BAR=BAZ} => BAZ
ok 72 - ${FOO} => $(BAZ,undefined)
ok 73 - ${FOO} => GRIBBLE
ok 74 - ${FOO,BAZ=GEEK} => GEEK
ok 75 - ${FOO} => VAL1
ok 76 - ${FOO} => VAL2
ok 77 - $(FOO)$(FOO1) => VAL2$(FOO1,undefined)
not ok 78 - $(FOO1)$(FOO) => $(FOO1,undefined)VAL2
# Return status was 21, expected -21
ok 79 - ${FOO} => $(BAR,recursive)
ok 80 - ${FOO=GRIBBLE} => $(BAR,recursive)
ok 81 - ${FOO=GRIBBLE,BAR=${FOO}} => $(BAR,recursive)
ok 82 - ${FOO,FOO=${FOO}} => $(FOO,recursive)
ok 83 - ${FOO=GRIBBLE,FOO=${FOO}} => $(FOO,recursive)
ok 84 - expansion returned 51, expected 51
ok 85 - final character 79, expect 79 (y)
ok 86 - terminator character 0, expect 0
ok 87 - sentinel character 7e, expect 7e, (~)
ok 88 - expansion returned 52, expected 52
ok 89 - final character 7a, expect 7a (z)
ok 90 - terminator character 0, expect 0
ok 91 - sentinel character 7e, expect 7e, (~)

    Results
    =======
       Tests: 91
      Passed:  90 = 98.90%
      Failed:   1 =  1.10%


I made this change to macCore.c

corvette:src/libCom/macLib>diff macCore.c.orig macCore.c
872c872
<                 entry->error = refentry->error;
---
>                 if (refentry->error == TRUE) entry->error = TRUE;


When I then run the modified version of macLibTest I get the following output:

corvette:src/libCom/test>O.linux-x86_64/macLibTest
1..91
ok  1 - FOO => FOO
ok  2 - $(FOO) => $(FOO,undefined)
ok  3 - ${FOO} => $(FOO,undefined)
ok  4 - ${FOO=${FOO}} => $(FOO,undefined)
ok  5 - ${FOO,FOO} => $(FOO,undefined)
ok  6 - ${FOO,FOO=${FOO}} => $(FOO,recursive)
ok  7 - ${FOO,BAR} => $(FOO,undefined)
ok  8 - ${FOO,BAR=baz} => $(FOO,undefined)
ok  9 - ${FOO,BAR=${FOO}} => $(FOO,undefined)
ok 10 - ${FOO,BAR=baz,FUM} => $(FOO,undefined)
ok 11 - ${FOO=${BAR},BAR=${FOO}} => $(FOO,undefined)
ok 12 - ${FOO,FOO=${BAR},BAR=${FOO}} => $(BAR,recursive)
ok 13 - ${=} =>
ok 14 - x${=}y => xy
ok 15 - ${,=} =>
ok 16 - x${,=}y => xy
ok 17 - ${FOO=} =>
ok 18 - x${FOO=}y => xy
ok 19 - ${FOO=,} =>
ok 20 - x${FOO=,}y => xy
ok 21 - ${FOO,FOO=} =>
ok 22 - x${FOO,FOO=}y => xy
ok 23 - ${FOO=,BAR} =>
ok 24 - x${FOO=,BAR}y => xy
ok 25 - ${FOO=${BAR=}} =>
ok 26 - x${FOO=${BAR=}}y => xy
ok 27 - ${FOO=,BAR=baz} =>
ok 28 - x${FOO=,BAR=baz}y => xy
ok 29 - ${FOO=${BAR},BAR=} =>
ok 30 - x${FOO=${BAR},BAR=}y => xy
ok 31 - ${=BAR} => BAR
ok 32 - x${=BAR}y => xBARy
ok 33 - ${FOO=BAR} => BAR
ok 34 - x${FOO=BAR}y => xBARy
ok 35 - ${FOO} => BLETCH
ok 36 - ${FOO,FOO} => BLETCH
ok 37 - x${FOO}y => xBLETCHy
ok 38 - x${FOO}y${FOO}z => xBLETCHyBLETCHz
ok 39 - ${FOO=BAR} => BLETCH
ok 40 - x${FOO=BAR}y => xBLETCHy
ok 41 - ${FOO=${BAZ}} => BLETCH
ok 42 - ${FOO=${BAZ},BAR=${BAZ}} => BLETCH
ok 43 - x${FOO=${BAZ}}y => xBLETCHy
ok 44 - x${FOO=${BAZ},BAR=${BAZ}}y => xBLETCHy
ok 45 - ${BAR=${FOO}} => BLETCH
ok 46 - x${BAR=${FOO}}y => xBLETCHy
ok 47 - w${BAR=x${FOO}y}z => wxBLETCHyz
ok 48 - ${FOO,FOO=BAR} => BAR
ok 49 - x${FOO,FOO=BAR}y => xBARy
ok 50 - ${BAR,BAR=${FOO}} => BLETCH
ok 51 - x${BAR,BAR=${FOO}}y => xBLETCHy
ok 52 - ${BAR,BAR=${${FOO}},BLETCH=GRIBBLE} => GRIBBLE
ok 53 - x${BAR,BAR=${${FOO}},BLETCH=GRIBBLE}y => xGRIBBLEy
ok 54 - ${${BAR,BAR=${FOO}},BLETCH=GRIBBLE} => GRIBBLE
ok 55 - x${${BAR,BAR=${FOO}},BLETCH=GRIBBLE}y => xGRIBBLEy
ok 56 - ${N=${FOO}/${BAR},BAR=GLEEP} => BLETCH/GLEEP
ok 57 - ${FOO}/${BAR} => BLETCH/GLEEP
ok 58 - x${FOO}/${BAR}y => xBLETCH/GLEEPy
ok 59 - ${FOO,BAR}/${BAR} => BLETCH/GLEEP
ok 60 - ${FOO,BAR=x}/${BAR} => BLETCH/GLEEP
ok 61 - ${BAZ=BLETCH,BAR}/${BAR} => BLETCH/GLEEP
ok 62 - ${BAZ=BLETCH,BAR=x}/${BAR} => BLETCH/GLEEP
ok 63 - ${N=${FOO}/${BAR}} => BLETCH/GLEEP
ok 64 - ${${FOO}} => BAR
ok 65 - x${${FOO}}y => xBARy
ok 66 - ${${FOO}=GRIBBLE} => BAR
ok 67 - x${${FOO}=GRIBBLE}y => xBARy
ok 68 - ${${FOO}} => GLEEP
ok 69 - ${BLETCH=${FOO}} => GLEEP
ok 70 - ${FOO} => GLEEP
ok 71 - ${FOO=BLETCH,BAR=BAZ} => BAZ
ok 72 - ${FOO} => $(BAZ,undefined)
ok 73 - ${FOO} => GRIBBLE
ok 74 - ${FOO,BAZ=GEEK} => GEEK
ok 75 - ${FOO} => VAL1
ok 76 - ${FOO} => VAL2
ok 77 - $(FOO)$(FOO1) => VAL2$(FOO1,undefined)
ok 78 - $(FOO1)$(FOO) => $(FOO1,undefined)VAL2
ok 79 - ${FOO} => $(BAR,recursive)
ok 80 - ${FOO=GRIBBLE} => $(BAR,recursive)
ok 81 - ${FOO=GRIBBLE,BAR=${FOO}} => $(BAR,recursive)
ok 82 - ${FOO,FOO=${FOO}} => $(FOO,recursive)
ok 83 - ${FOO=GRIBBLE,FOO=${FOO}} => $(FOO,recursive)
ok 84 - expansion returned 51, expected 51
ok 85 - final character 79, expect 79 (y)
ok 86 - terminator character 0, expect 0
ok 87 - sentinel character 7e, expect 7e, (~)
ok 88 - expansion returned 52, expected 52
ok 89 - final character 7a, expect 7a (z)
ok 90 - terminator character 0, expect 0
ok 91 - sentinel character 7e, expect 7e, (~)

    Results
    =======
       Tests: 91
      Passed:  91 = 100.00%


So I think there is indeed a bug, and my patch appears to fix it without breaking any other tests in macLibTest.

Mark

________________________________________
From: Michael Davidsaver [mdavidsaver@gmail.com]
Sent: Sunday, April 16, 2017 5:17 PM
To: Mark Rivers
Subject: Re: Problem in macLib macExpandString?

On 04/16/2017 05:41 PM, Mark Rivers wrote:
> I can fix this problem with this patch to macCore.c.  However, I don't know if this will have unwanted side-effects.

Have you tried running macLibTest with your changes?

https://github.com/epics-base/epics-base/blob/3.14/src/libCom/test/macLibTest.c

Could you add your test cases here as well?



> corvette:src/libCom/macLib>diff macCore.c.orig macCore.c
> 872c872
> <                 entry->error = refentry->error;
> ---
>>                 if (refentry->error == TRUE) entry->error = TRUE;
>
> With this fix the test program then produces this output:
>
> corvette:ADCore/ADApp/ADSrc>../../bin/linux-x86_64/test_macExpandString
> Test1 input=$(A)$(B), status=2
> Test2 input=$(A)$(B)$(C), status=-16
> Test3 input=$(C)$(B)$(A), status=-16
> macLib: macro C is undefined (expanding string $(A)$(B)$(C))
>
> Mark
>
> ________________________________________
> From: tech-talk-bounces@aps.anl.gov [tech-talk-bounces@aps.anl.gov] on behalf of Mark Rivers [rivers@cars.uchicago.edu]
> Sent: Sunday, April 16, 2017 3:35 PM
> To: EPICS Tech-Talk
> Subject: RE: Problem in macLib macExpandString?
>
> I've written a little test program that I think proves there is a bug in macExpandString:
>
> Here is the program.  It defines the macros A and B.  It does not define the macro C.  It then calls macExpandString 3 times.  The first time it references only macros A and B, the second time A, B, C in that order, and the third time C, A, B in that order.
>
> #####################################
> #include <stdio.h>
> #include <macLib.h>
>
> int main(int argc, char *argv[])
> {
>   MAC_HANDLE *macHandle;
>   char **macPairs;
>   char expandOutput[100];
>   const char *test1 = "$(A)$(B)";
>   const char *test2 = "$(A)$(B)$(C)";
>   const char *test3 = "$(C)$(B)$(A)";
>   int status;
>
>   macCreateHandle(&macHandle, 0);
>   status = macParseDefns(macHandle, "A=1,B=2", &macPairs);
>   status = macInstallMacros(macHandle, macPairs);
>
>   status = macExpandString(macHandle, test1, expandOutput, sizeof(expandOutput));
>   printf("Test1 input=%s, status=%d\n", test1, status);
>   status = macExpandString(macHandle, test2, expandOutput, sizeof(expandOutput));
>   printf("Test2 input=%s, status=%d\n", test2, status);
>   status = macExpandString(macHandle, test3, expandOutput, sizeof(expandOutput));
>   printf("Test3 input=%s, status=%d\n", test3, status);
>
>   return 0;
> }
> #####################################
>
> Here is the output:
>
> corvette:ADCore/ADApp/ADSrc>../../bin/linux-x86_64/test_macExpandString
> Test1 input=$(A)$(B), status=2
> Test2 input=$(A)$(B)$(C), status=-16
> Test3 input=$(C)$(B)$(A), status=16
>
> The first 2 tests results are OK.  When only A and B are referenced it returns 2 characters as expected.  When the undefined C is the last macro in the string macExpandString returns -16, which is correct.  However, when the undefined C is not the last macro in the string macExpandString returns a positive number.  This is incorrect according to the documentation for macExpandString (http://www.aps.anl.gov/epics/base/R3-15/5-docs/AppDevGuide.pdf page 281), which says:
>
> /*following returns #chars copied, <0 if any macros are undefined*/
> long macExpandString(
>     MAC_HANDLE *handle,    /* opaque handle */
>     char *src,             /* source string */
>     char *dest,            /* destination string */
>     long maxlen            /* maximum number of characters to copy */
>                            /* to destination string */
> );
>
> I'm surprised this has not been seen previously, so perhaps I am doing something wrong?
>
> Thanks,
> Mark
>
>
>
>
>
> ________________________________
> From: Mark Rivers
> Sent: Sunday, April 16, 2017 2:41 PM
> To: EPICS Tech-Talk
> Subject: Problem in macLib macExpandString?
>
> I am trying to use macLib to do macro substitution in base 3.15.5.  It is generally working.  However sometimes when there is an undefined macro the return value from macExpandString is not negative when it should be.
>
> This is the code I am using to call macExpandString, with some debugging printf calls.  It prints the value returned by macValueExpand, as well as the input and output strings.
>
>         // Create a temporary buffer 10 times larger than input buffer
>         int bufferSize = buffer.length() * 10;
>         char *tmpBuffer = (char *)malloc(bufferSize);
> printf("Calling macExpandString, input length=%d, output buffer size=%d\n", (int)buffer.length(), bufferSize);
>         status = macExpandString(macHandle, buffer.c_str(), tmpBuffer, bufferSize);
> printf("macExpandString returned %d\n", status);
> printf("input:\n########\n%s\n########\n\n", buffer.c_str());
> printf("output:\n########\n%s\n########\n\n", tmpBuffer);
>
>
> Here is an example.  In this case the CAMERA macro is not defined.
>
> #####################################################################################################################
> Calling macExpandString, input length=1013, output buffer size=10130
> macLib: macro CAMERA is undefined (expanding string <?xml version="1.0" standalone="no" ?>
> <!-- Attributes -->
> <Attributes
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:noNamespaceSchemaLocation="../../../../../ADCore/XML_schema/NDAttributes.xsd"
>     >
>     <Attribute name="AcquireTime"         type="EPICS_PV" source="$(CAMERA)AcquireTime"         dbrtype="DBR_NATIVE"  description="Camera acquire time"/>
>     <Attribute name="RingCurrent"         type="EPICS_PV" source="S:SRcurrentAI"                dbrtype="DBR_NATIVE"  description="Storage ring current"/>
>     <Attribute name="RingCurrent_EGU"     type="EPICS_PV" source="S:SRcurrentAI.EGU"            dbrtype="DBR_NATIVE"  description="Storage ring current units"/>
>     <Attribute name="ID_Energy"           type="EPICS_PV" source="$(ID)Energy"                  dbrtype="DBR_NATIVE"  description="Undulator energy"/>
>     <Attribute name="ID_Energy_EGU"       type="EPICS_PV" source="$(ID)Energy.EGU"              dbrtype="DBR_NATIVE"  description="Undulator energy units"/>
> </Attributes>
> )
> macExpandString returned 1027
> input:
> ########
> <?xml version="1.0" standalone="no" ?>
> <!-- Attributes -->
> <Attributes
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:noNamespaceSchemaLocation="../../../../../ADCore/XML_schema/NDAttributes.xsd"
>     >
>     <Attribute name="AcquireTime"         type="EPICS_PV" source="$(CAMERA)AcquireTime"         dbrtype="DBR_NATIVE"  description="Camera acquire time"/>
>     <Attribute name="RingCurrent"         type="EPICS_PV" source="S:SRcurrentAI"                dbrtype="DBR_NATIVE"  description="Storage ring current"/>
>     <Attribute name="RingCurrent_EGU"     type="EPICS_PV" source="S:SRcurrentAI.EGU"            dbrtype="DBR_NATIVE"  description="Storage ring current units"/>
>     <Attribute name="ID_Energy"           type="EPICS_PV" source="$(ID)Energy"                  dbrtype="DBR_NATIVE"  description="Undulator energy"/>
>     <Attribute name="ID_Energy_EGU"       type="EPICS_PV" source="$(ID)Energy.EGU"              dbrtype="DBR_NATIVE"  description="Undulator energy units"/>
> </Attributes>
>
> ########
>
> output:
> ########
> <?xml version="1.0" standalone="no" ?>
> <!-- Attributes -->
> <Attributes
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:noNamespaceSchemaLocation="../../../../../ADCore/XML_schema/NDAttributes.xsd"
>     >
>     <Attribute name="AcquireTime"         type="EPICS_PV" source="$(CAMERA,undefined)AcquireTime"         dbrtype="DBR_NATIVE"  description="Camera acquire time"/>
>     <Attribute name="RingCurrent"         type="EPICS_PV" source="S:SRcurrentAI"                dbrtype="DBR_NATIVE"  description="Storage ring current"/>
>     <Attribute name="RingCurrent_EGU"     type="EPICS_PV" source="S:SRcurrentAI.EGU"            dbrtype="DBR_NATIVE"  description="Storage ring current units"/>
>     <Attribute name="ID_Energy"           type="EPICS_PV" source="ID13us:Energy"                  dbrtype="DBR_NATIVE"  description="Undulator energy"/>
>     <Attribute name="ID_Energy_EGU"       type="EPICS_PV" source="ID13us:Energy.EGU"              dbrtype="DBR_NATIVE"  description="Undulator energy units"/>
> </Attributes>
>
> ########
>
> #####################################################################################################################
>
> Note above that macExpand string is printing an error message as it should.  However, it is returning a positive integer 1037, while it should be returning a negative value because there was an undefined macro.
>
>
> If instead of CAMERA being undefined I don't define ID instead I get this output:
>
> #####################################################################################################################
> Calling macExpandString, input length=1013, output buffer size=10130
> macLib: macro ID is undefined (expanding string <?xml version="1.0" standalone="no" ?>
> <!-- Attributes -->
> <Attributes
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:noNamespaceSchemaLocation="../../../../../ADCore/XML_schema/NDAttributes.xsd"
>     >
>     <Attribute name="AcquireTime"         type="EPICS_PV" source="$(CAMERA)AcquireTime"         dbrtype="DBR_NATIVE"  description="Camera acquire time"/>
>     <Attribute name="RingCurrent"         type="EPICS_PV" source="S:SRcurrentAI"                dbrtype="DBR_NATIVE"  description="Storage ring current"/>
>     <Attribute name="RingCurrent_EGU"     type="EPICS_PV" source="S:SRcurrentAI.EGU"            dbrtype="DBR_NATIVE"  description="Storage ring current units"/>
>     <Attribute name="ID_Energy"           type="EPICS_PV" source="$(ID)Energy"                  dbrtype="DBR_NATIVE"  description="Undulator energy"/>
>     <Attribute name="ID_Energy_EGU"       type="EPICS_PV" source="$(ID)Energy.EGU"              dbrtype="DBR_NATIVE"  description="Undulator energy units"/>
> </Attributes>
> )
> macLib: macro ID is undefined (expanding string <?xml version="1.0" standalone="no" ?>
> <!-- Attributes -->
> <Attributes
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:noNamespaceSchemaLocation="../../../../../ADCore/XML_schema/NDAttributes.xsd"
>     >
>     <Attribute name="AcquireTime"         type="EPICS_PV" source="$(CAMERA)AcquireTime"         dbrtype="DBR_NATIVE"  description="Camera acquire time"/>
>     <Attribute name="RingCurrent"         type="EPICS_PV" source="S:SRcurrentAI"                dbrtype="DBR_NATIVE"  description="Storage ring current"/>
>     <Attribute name="RingCurrent_EGU"     type="EPICS_PV" source="S:SRcurrentAI.EGU"            dbrtype="DBR_NATIVE"  description="Storage ring current units"/>
>     <Attribute name="ID_Energy"           type="EPICS_PV" source="$(ID)Energy"                  dbrtype="DBR_NATIVE"  description="Undulator energy"/>
>     <Attribute name="ID_Energy_EGU"       type="EPICS_PV" source="$(ID)Energy.EGU"              dbrtype="DBR_NATIVE"  description="Undulator energy units"/>
> </Attributes>
> )
> macExpandString returned -1036
> input:
> ########
> <?xml version="1.0" standalone="no" ?>
> <!-- Attributes -->
> <Attributes
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:noNamespaceSchemaLocation="../../../../../ADCore/XML_schema/NDAttributes.xsd"
>     >
>     <Attribute name="AcquireTime"         type="EPICS_PV" source="$(CAMERA)AcquireTime"         dbrtype="DBR_NATIVE"  description="Camera acquire time"/>
>     <Attribute name="RingCurrent"         type="EPICS_PV" source="S:SRcurrentAI"                dbrtype="DBR_NATIVE"  description="Storage ring current"/>
>     <Attribute name="RingCurrent_EGU"     type="EPICS_PV" source="S:SRcurrentAI.EGU"            dbrtype="DBR_NATIVE"  description="Storage ring current units"/>
>     <Attribute name="ID_Energy"           type="EPICS_PV" source="$(ID)Energy"                  dbrtype="DBR_NATIVE"  description="Undulator energy"/>
>     <Attribute name="ID_Energy_EGU"       type="EPICS_PV" source="$(ID)Energy.EGU"              dbrtype="DBR_NATIVE"  description="Undulator energy units"/>
> </Attributes>
>
> ########
>
> output:
> ########
> <?xml version="1.0" standalone="no" ?>
> <!-- Attributes -->
> <Attributes
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:noNamespaceSchemaLocation="../../../../../ADCore/XML_schema/NDAttributes.xsd"
>     >
>     <Attribute name="AcquireTime"         type="EPICS_PV" source="13SIM1:cam1:AcquireTime"         dbrtype="DBR_NATIVE"  description="Camera acquire time"/>
>     <Attribute name="RingCurrent"         type="EPICS_PV" source="S:SRcurrentAI"                dbrtype="DBR_NATIVE"  description="Storage ring current"/>
>     <Attribute name="RingCurrent_EGU"     type="EPICS_PV" source="S:SRcurrentAI.EGU"            dbrtype="DBR_NATIVE"  description="Storage ring current units"/>
>     <Attribute name="ID_Energy"           type="EPICS_PV" source="$(ID,undefined)Energy"                  dbrtype="DBR_NATIVE"  description="Undulator energy"/>
>     <Attribute name="ID_Energy_EGU"       type="EPICS_PV" source="$(ID,undefined)Energy.EGU"              dbrtype="DBR_NATIVE"  description="Undulator energy units"/>
> </Attributes>
>
> ########
> #####################################################################################################################
>
> This is behaving correctly, macExpandString is returning a negative number, -1036 as it should.
>
> Am I doing something wrong or is this a bug?
>
>
> Thanks,
> Mark
>


Replies:
Re: Problem in macLib macExpandString? Andrew Johnson

Navigate by Date:
Prev: Build failed in Jenkins: epics-base-3.16-mac-test #75 APS Jenkins
Next: Re: Problem in macLib macExpandString? Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Jenkins build is back to normal : epics-base-3.16-win64s #88 APS Jenkins
Next: Re: Problem in macLib macExpandString? Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 21 Apr 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·