#7 code generation

code-gen
closed-fixed
5
2002-06-05
2002-06-01
Anonymous
No

generated methods have
test code
no test code assertion
then test code again
e.g. below
is this a bug? or a parameter issues
public void testGetType() {

varHierarchyNode.setType((java.lang.Long)new
Long(Long.MIN_VALUE));
assertEquals((java.lang.Long)new Long
(Long.MIN_VALUE), varHierarchyNode.getType());
varHierarchyNode.setType((java.lang.Long)new
Long(-1));
assertEquals((java.lang.Long)new Long(-1),
varHierarchyNode.getType());
varHierarchyNode.setType((java.lang.Long)new
Long(0));
assertEquals((java.lang.Long)new Long(0),
varHierarchyNode.getType());
varHierarchyNode.setType((java.lang.Long)new
Long(1));
assertEquals((java.lang.Long)new Long(1),
varHierarchyNode.getType());
varHierarchyNode.setType((java.lang.Long)new
Long(Long.MAX_VALUE));
assertEquals((java.lang.Long)new Long
(Long.MAX_VALUE), varHierarchyNode.getType());
assertTrue("Warning! This new test method with no
real test code inside.", false);
varHierarchyNode.setType((java.lang.Long)new
Long(Long.MIN_VALUE));
assertEquals((java.lang.Long)new Long
(Long.MIN_VALUE), varHierarchyNode.getType());
varHierarchyNode.setType((java.lang.Long)new
Long(-1));
assertEquals((java.lang.Long)new Long(-1),
varHierarchyNode.getType());
varHierarchyNode.setType((java.lang.Long)new
Long(0));
assertEquals((java.lang.Long)new Long(0),
varHierarchyNode.getType());
varHierarchyNode.setType((java.lang.Long)new
Long(1));
assertEquals((java.lang.Long)new Long(1),
varHierarchyNode.getType());
varHierarchyNode.setType((java.lang.Long)new
Long(Long.MAX_VALUE));
assertEquals((java.lang.Long)new Long
(Long.MAX_VALUE), varHierarchyNode.getType());

} // end of testGetType()

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I've fixed by changing the following line in CodeHints
    code_hints +=
    " assertTrue(\"Warning! This new test method with
    no real test code inside.\", false);\n";//+
    //code_hints;

    i.e. remove the final + codeHints

     
  • Artur Hefczyc

    Artur Hefczyc - 2002-06-05
    • status: open --> closed-fixed
     
  • Artur Hefczyc

    Artur Hefczyc - 2002-06-05

    Logged In: YES
    user_id=234194

    Yes it was a bug, sample test code shouldn't be repeated.
    Fixed as suggested below, thanks.

     

Log in to post a comment.