This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

warning: "Multiple markers at this line - Syntax error - ProtocolTest.c, line 79 "

Other Parts Discussed in Thread: MSP430F5438A

Hallo Everyone,

i am using ccsv5 on msp430f5438a.

i am making an application and i want to test the modules of this application, thats why i used embedded unit tool and i tried to build a project with this tool and it was successfully builded.

but i get this this warnig after buliding:

Multiple markers at this line
- Syntax error
- ProtocolTest.c, line 79

what does this mean? and how can i fix this warning or this syntax error.

here is a sample of the code:

static void test_Init_Protocol(void)

{
InitProt();
TEST_ASSERT_EQUAL_INT(protInstance.pdLength, 0);  
TEST_ASSERT_EQUAL_INT(protInstance.byteCount, 0 );
TEST_ASSERT_EQUAL_INT(pdInstance.header, 0);
TEST_ASSERT_EQUAL_INT(pdInstance.length, 0);
TEST_ASSERT_EQUAL_INT(pdInstance.data[2], 0);
}

this warning is in every line which has the "TEST_ASSERT_EQUAL_INT()" macro.

Regards.

  • Hello,

    Mohammad Nasser said:

    but i get this this warnig after buliding:

    Multiple markers at this line
    - Syntax error
    - ProtocolTest.c, line 79

    what does this mean?

    Basically it means that there are multiple errors (more than one thing wrong) on each of those lines.

    Mohammad Nasser said:
    and how can i fix this warning or this syntax error.

    Since you only gave me a sample, I can only guess. Most likely you are missing the declaration for TEST_ASSERT_EQUAL_INT, protInstance or pdInstance (or all of them). That source file could simply be missing the header file reference. If you try to build it, the compiler should explicitly tell you what the errors are and you can try an fix it.

    Thanks

    ki

  • Thanks a lot Ki.

    the problem is that the project is building and i can execute it on the board. 

    so, what do these syntax erros mean.?

  • here is a screenshot of these "errors".

  • Can you provide the expanded TEST_ASSERT_EQUAL_INT marco? Maybe there is a nested macro/keyword that is not defined by the msp build tool.

    Regards,
    Patrick 

  • Hallo Patrick,

    here is the header file of this macro:

    #ifndef __ASSERTIMPL_H__
    #define __ASSERTIMPL_H__

    #ifdef __cplusplus
    extern "C" {
    #endif

    void addFailure(const char *msg, long line, const char *file); /*TestCase.c*/

    void assertImplementationInt(int expected,int actual, long line, const char *file);
    void assertImplementationCStr(const char *expected,const char *actual, long line, const char *file);

    #define TEST_ASSERT_EQUAL_STRING(expected,actual)\
    if (expected && actual && (stdimpl_strcmp(expected,actual)==0)) {} else {assertImplementationCStr(expected,actual,__LINE__,__FILE__);return;}

    #define TEST_ASSERT_EQUAL_INT(expected,actual)\
    if (expected == actual) {} else {assertImplementationInt(expected,actual,__LINE__,__FILE__);return;}

    #define TEST_ASSERT_NULL(pointer)\
    TEST_ASSERT_MESSAGE(pointer == NULL,#pointer " was not null.")

    #define TEST_ASSERT_NOT_NULL(pointer)\
    TEST_ASSERT_MESSAGE(pointer != NULL,#pointer " was null.")

    #define TEST_ASSERT_MESSAGE(condition, message)\
    if (condition) {} else {TEST_FAIL(message);}

    #define TEST_ASSERT(condition)\
    if (condition) {} else {TEST_FAIL(#condition);}

    #define TEST_FAIL(message)\
    if (0) {} else {addFailure(message,__LINE__,__FILE__);return;}

    #ifdef __cplusplus
    }
    #endif

    #endif/*__ASSERTIMPL_H__*/

  • There was an existing issue with the __FILE__ and __LINE__ macros, try to replace these two macros in your header file to see if this  resolve the errors that you got. If this is the case, then I can try to find the CQ number for this issue.

  • hi,

    the problem is that i didnt write these macros and the whole framework, that i am using for unit testing. and now  i am searching for another frameworks for unit testing, where _FILE_ and _LINE_ are not used.

  • Hi Mohammad,

    Thanks for the update. In general, you shouldn't need to set these macros, the build system should handle these macros for you.

    Your issue is related to this forum post, see http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/157438.aspx. For tracking purpose, there is a CQ number in the middle of this post.

    Regards,
    Patrick 

  • Hallo,

    i searched for another framework for unit-testing, and i find another framework, that uses these macros, and these warning dont appear.

    it is ucunit. and here ist its website: http://www.ucunit.org/index.html#index

    i dont have time now, to investigate the reasons, why in the other framework theses warnigs appear, and in the another one dont appear.

    Regards,

    Mohammad