Menu

Emma with Enums

Developers
2009-01-07
2013-05-09
  • Greg Hutchinson

    Greg Hutchinson - 2009-01-07

    I have a very small Enum class.

    package ca.attractors.blackjack;  

    public enum Suit {
        Clubs, Diamonds, Hearts, Spades
    }

    After running code coverage on my test case Emma displays the package statement in yellow (which gives me a 92.9 % code coverage). Is there a work around for this, or have I misunderstood something?

    Thanks very much.
    ... Greg ...

     
    • Greg Hutchinson

      Greg Hutchinson - 2009-01-07

      Sorry,
      This is (of course) using the plug-in for eclipse. The rest of the enum shows green. (covered)
      ... Greg ...

       
    • Marc R. Hoffmann

      The same question was raised before in the EclEmma forum. See this thread for a discussion:

      https://sourceforge.net/forum/message.php?msg_id=5088116

      "EclEmma/EMMA works on byte code, the syntax highlighting is based on the line numbers within the compiled class files. Some Java language constructs will create extra byte code which does not have any corresponding line of source code. In such cases the compiler picks some line for it. In your case the extra code is the method Side.valueOf()."

      -marc

       

Log in to post a comment.