Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int testSphereSet(BRLCAD::Sphere sph, Vector3D center, Vector3D height, double radius)
- {
- sph.Set(center,height,radius);
- // test stuff here
- return 0; // if test passed
- return 1;
- }
- static int testSphereSetRadius(BRLCAD::Sphere sph, double radius)
- {
- sph.Set(radius);
- //test stuff here
- return 0;
- return 1;
- }
- static int testSphereType(BRLCAD::Sphere sph)
- {
- if(sph.Type()=="Sphere") return 0;
- return 1;
- }
- void main(int argc, char* argv[])
- {
- if(argc==7) // only run tests if we have 7 parametres
- {
- bool ok=0;
- double radius;
- Vector3D center,height;
- center.coordinates[0]=argv[0];
- center.coordinates[1]=argv[1];
- center.coordinates[2]=argv[2];
- height.coordinates[0]=argv[3];
- height.coordinates[1]=argv[4];
- height.coordinates[2]=argv[5];
- radius=argv[6];
- if (testSphereSet(sph,center,height,radius))
- {
- std::cout <<"Test failed at function : Set";
- ok=1;
- }
- if (testSphereSetRadius(sph,radius))
- {
- std::cout <<"Test failed at function : SetRadius";
- ok=1;
- }
- if (testSphereType(sph))
- {
- std::cout <<"Test failed at function : Type";
- ok=1;
- }
- if (ok==0 && sph.IsValid())
- database.add(sph);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment