#256 [PATCH][v1] Ellipsoid API unit test

Incomplete
closed-fixed
9
2014-12-09
2014-03-12
No

I've added an API test just for the Ellipsoid class.

Some questions:
- is the general test structure acceptable?
- should the methods be tested for correctness or just functionality
- there is a TODO left in code, I'm open for suggestions

I'll probably get a better idea and finish this test after some feedback on this patch

Thanks,
Andrei

1 Attachments

Discussion

  • Daniel Roßberg

    Daniel Roßberg - 2014-03-13

    I'm missing the database here. How about a structure like this:

    AllPrimitives.cpp >>>>>
    MakeArb8(){}
    MakeEllipsoid(){}
    ...
    main(){
    BRLCAD::FileDatabase database(argv[1]);
    MakeArb8(database);
    MakeEllipsoid(database);
    ...
    }
    <<<<<<<<<<

    Tests for functionality should be enough here, but you could check for IsValid() for every primitive.
    The result will be a BRL-CAD geometry file which contains examples of every primitive type supported by this interface.

    Daniel

     
  • Andrei Popescu

    Andrei Popescu - 2014-04-03

    Daniel, I have changed the unit test according to what I understood from your comments.

    Andrei

     
  • Daniel Roßberg

    Daniel Roßberg - 2014-04-04

    Does this compile?

     
  • Andrei Popescu

    Andrei Popescu - 2014-04-04

    oops, forgot to remove the Save, but aside of it it does.

     
  • Daniel Roßberg

    Daniel Roßberg - 2014-04-05

    OK, next step: Copyright 2011?

    To make point out what the program does I would like to see the different tests in own functions (e.g. TestArb8()). Then the main() consists of calls of these functions. This makes clear what will be tested there and there would be no need to mention the teted primitives in the comment then. When you implemented a new primitive it's easy to add a test for it.

    Daniel

     
  • Andrei Popescu

    Andrei Popescu - 2014-04-07

    Daniel,

    I fixed the copyright issue as well as broken down the test into small functions, one per primitive.

    Andrei

     
  • Daniel Roßberg

    Daniel Roßberg - 2014-04-07

    Before we fine-tune it you should fix the copy-n-paste remnant "std::cout << database.Title();". It doesn't make sense here.

    In general the patch would be OK then. However, we still have to settle to the coding conventions.

    Daniel

     
    Last edit: Daniel Roßberg 2014-04-07
  • Andrei Popescu

    Andrei Popescu - 2014-08-16

    Daniel,

    I've added simple tests for new primitives(except pipe, since it s not yet accepted, however, I ran into a bit of trouble, I couldn't use rtgeom.h, for some reason. (I needed Vector3D)

    Thanks

     
  • Daniel Roßberg

    Daniel Roßberg - 2014-12-09
    • status: unread --> closed-fixed
    • assigned_to: Andrei Popescu --> Daniel Roßberg
     
  • Daniel Roßberg

    Daniel Roßberg - 2014-12-09

    with revision 63634

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks