This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: New Lightweight tests


On Wed, 2006-02-22 at 09:11 +0100, Roman Kennke wrote:
> Hi Lillian,
> 
> I have some comments regarding the TestHarness change:
> 
> +  
> +  /**
> +   * Compares two colors.
> +   * 
> +   * @param a -
> +   *          Color to compare
> +   * @param b -
> +   *          Color to compare
> +   * @param match -
> +   *          True if colors should be equivalent.
> +   */
> +  public void checkColor(Color a, Color b, boolean match)
> +  {
> +    if (match)
> +      check(a.getRed() == b.getRed() && a.getGreen() == b.getGreen()
> +            && a.getBlue() == b.getBlue());
> +    else
> +      check(!(a.getRed() == b.getRed() && a.getGreen() == b.getGreen() 
> +          && a.getBlue() == b.getBlue()));
> +  }
> 
> I don't understand the point here. Why not use check(color1, color2)?
> This would use equals() which also compares the rgb values (or whatever
> the color value is made up of). The match parameter is also hard to
> understand, it effectivle negates the result? check(!
> color1.equals(color2)) ?

See the reply I sent to David.

> 
> /**
> +   * This method checks the pixel colors of a Rectangle's corners
> +   * 
> +   * @param r -
> +   *          The Robot to use to get the pixel colors.
> 
> I don't know if we have rules for this in Mauve, but in Classpath we
> would have a period after corners and the @param comment written without
> the '-', without the capital T and without period. For API comments we
> basically adopted Sun's rules:
> 
> http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
> 
> Anyway, this is only a very minor nitpick, and I don't know what the
> rules are in Mauve anyway or if we even have some, I only say it here so
> you keep it in mind in future classpath hacking :-)
> 
> Roman
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]