Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 63776)
+++ CMakeLists.txt	(working copy)
@@ -39,6 +39,7 @@
 set (ciTests_SRC
 	halfspace.cpp
 	primitives.cpp
+	ellipticaltorus.cpp
 )
 
 add_executable(tester_ci_primitives ${ciTests_SRC})
Index: ellipticaltorus.cpp
===================================================================
--- ellipticaltorus.cpp	(revision 0)
+++ ellipticaltorus.cpp	(working copy)
@@ -0,0 +1,243 @@
+/*             E L L I P T I C A L T O R U S . C P P
+ * BRL-CAD
+ *
+ * Copyright (c) 2011 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file EllipticalTorus.h
+ *
+ *  BRL-CAD core C++ interface:
+ *       elliptical torus (ID_ETO) database object implementation
+ *
+ *  Origin -
+ *      TNO (Netherlands)
+ *      IABG mbH (Germany)
+ */
+/*
+   Tests the following functions defined on an EllpiticalTorus object :
+   Center, SetCenter, Normal, SetNormal, TubeCenterLineRadius,
+   SetTubeCenterLineRadius, TubeSemiMajorAxis, SetTubeSemiMajorAxis,
+   TubeSemiMinorAxis, SetTubeSemiMinorAxis, Set, ClassName, Type, IsValid, 
+   Clone.
+*/
+#include <iostream>
+#include <brlcad/EllipticalTorus.h>
+using namespace BRLCAD;
+
+/* A function to compare two Vector3Ds */
+static bool cmp(Vector3D a, Vector3D b)
+{
+	if (a.coordinates[0] == b.coordinates[0] && a.coordinates[1] == b.coordinates[1] && a.coordinates[2] == b.coordinates[2]) 
+		return 0;
+	return 1;
+}
+
+/* Tests the Center() function */
+static int testEllipticalTorusCenter(BRLCAD::EllipticalTorus et, Vector3D center)
+{
+    if (cmp(et.Center(),center) == 0) return 0;
+    return 1;
+}
+
+/* Tests the SetCenter() function */
+static int testEllipticalTorusSetCenter(BRLCAD::EllipticalTorus et, Vector3D center)
+{
+    et.SetCenter(center);
+    if (cmp(et.Center(),center) == 0) return 0;
+    return 1;
+}
+
+/* Tests the Normal() function */
+static int testEllipticalTorusNormal(BRLCAD::EllipticalTorus et, Vector3D normal)
+{
+    if (cmp(et.Normal(),normal) == 0) return 0;
+    return 1;
+}
+
+/* Tests the SetNormal() function */
+static int testEllipticalTorusSetNormal(BRLCAD::EllipticalTorus et, Vector3D normal)
+{
+    et.SetNormal(normal);
+    if (cmp(et.Normal(),normal) == 0) return 0;
+    return 1;
+}
+
+/* Tests the TubeCenterLineRadius() function */
+static int testEllipticalTorusTubeCenterLineRadius(BRLCAD::EllipticalTorus et, double TCLR)
+{
+    if (et.TubeCenterLineRadius() == TCLR) return 0;
+    return 1;
+}
+
+/* Tests the SetTubeCenterLineRadius() function */
+static int testEllipticalTorusSetTubeCenterLineRadius(BRLCAD::EllipticalTorus et, double TCLR)
+{
+    et.SetTubeCenterLineRadius(TCLR);
+    if (et.TubeCenterLineRadius() == TCLR) return 0;
+    return 1;
+}
+
+/* Tests the TubeSemiMajorAxis() function */
+static int testEllipticalTorusTubeSemiMajorAxis(BRLCAD::EllipticalTorus et, Vector3D TSMA)
+{
+    if (cmp(et.TubeSemiMajorAxis(),TSMA) == 0) return 0;
+    return 1;
+}
+
+/* Tests the SetTubeSemiMajorAxis() function */
+static int testEllipticalTorusSetTubeSemiMajorAxis(BRLCAD::EllipticalTorus et, Vector3D TSMA)
+{
+    et.SetTubeSemiMajorAxis(TSMA);
+    if (cmp(et.TubeSemiMajorAxis(),TSMA) == 0) return 0;
+    return 1;
+}
+
+/* Tests the TubeSemiMinorAxis() function */
+static int testEllipticalTorusTubeSemiMinorAxisBRLCAD::EllipticalTorus et, double length)
+{
+    if (et.TubeSemiMinorAxis() == length) return 0;
+    return 1;
+}
+
+/* Tests the SetTubeSemiMinorAxis() function */
+static int testEllipticalTorusSetTubeSemiMinorAxis(BRLCAD::EllipticalTorus et, double length)
+{
+    et.SetTubeSemiMinorAxis(length);
+    if (et.TubeSemiMinorAxis() == length) return 0;
+    return 1;
+}
+
+/* Tests the ClassName() function */
+static int testEllipticalTorusClassName(BRLCAD::EllipticalTorus et) 
+{
+	if (et.ClassName() == "EllipticalTorus") 
+		return 0;
+	return 1;
+}
+
+/* Tests the Type() function */
+static int testEllipticalTorusType(BRLCAD::EllipticalTorus et)
+{
+	if (et.Type() == et.ClassName()) 
+		return 0;
+   return 1;
+}
+
+/* Tests the IsValid() function */
+static int testEllipticalTorusIsValid(BRLCAD::EllipticalTorus et) 
+{
+	if (et.IsValid() == true) 
+		return 0;
+	return 1;
+}
+
+/* Tests the Set() function */
+static int testEllipticalTorusSet(BRLCAD::EllipticalTorus et, Vector3D center, Vector3D normal, double TCLR, Vector3D TSMA, double length)
+{
+    et.Set(center,normal,TCLR,TSMA,length);
+    if (cmp(et.Center(),center) == 0 &&
+        cmp(et.Normal(),normal) == 0 &&
+        et.TubeCenterLineRadius() == TCLR &&
+        cmp(et.TubeSemiMajorAxis(),TSMA) == 0 &&
+        et.TubeSemiMinorAxis() == length) return 0;
+    return 1;
+}
+
+/* Tests the Clone() function */
+static int testEllipticalTorusClone(BRLCAD::EllipticalTorus et)
+{
+    BRLCAD::EllipticalTorus et2;
+    et2=et.Clone();
+    if (cmp(et.Center(),et2.Center()) == 0 &&
+        cmp(et.Normal(),et2.Normal()) == 0 &&
+        et.TubeCenterLineRadius() == et2.TubeCenterLineRadius() &&
+        cmp(et.TubeSemiMajorAxis(),et2.TubeSemiMajorAxis()) == 0 &&
+        et.TubeSemiMinorAxis() == et2.TubeSemiMinorAxis()) return 0;
+    return 1;
+}
+
+/* We now run all the tests */
+void test_ellipticaltorus(BRLCAD::Database& database)
+{	
+
+	/* Initialize an EllipticalTorus to test on */
+	BRLCAD::EllipticalTorus et;
+	et.Set(Vector3D(1.0,1.0,1.0),Vector3D(1.0,1.0,1.0),10,Vector3D(1.0,1.0,1.0),10);
+    
+    /* Initialize a boolean to see if one or more of the tests failed */
+	bool ok = 0;
+    
+    /* We now run all the tests */
+    if (testEllipticalTorusCenter(t,Vector3D(1.0,1.0,1.0))){
+        ok = 1;
+        std::cout << "Test failed at function : Center()";
+    }
+    if (testEllipticalTorusSetCenter(et,Vector3D(2.0,2.0,2.0))){
+        ok = 1;
+        std::cout << "Test failed at function : SetCenter()";
+    }
+    if (testEllipticalTorusNormal(et,Vector3D(1.0,1.0,1.0))){
+        ok = 1;
+        std::cout << "Test failed at function : Normal()";
+    }
+    if (testEllipticalTorusSetNormal(et,Vector3D(2.0,2.0,2.0))){
+        ok = 1;
+        std::cout << "Test failed at function : SetNormal()";
+    }
+    if (testEllipticalTorusTubeCenterLineRadius(et,10)){
+        ok = 1;
+        std::cout << "Test failed at function : TubeCenterLineRadius()";
+    }
+    if (testEllipticalTorusSetTubeCenterLineRadius(et,20)){
+        ok = 1;
+        std::cout << "Test failed at function : SetTubeCenterLineRadius()";
+    }
+    if (testEllipticalTorusTubeSemiMinorAxis(et,10)){
+        ok = 1;
+        std::cout << "Test failed at function : TubeSemiMinorAxis()";
+    }
+    if (testEllipticalTorusSetTubeSemiMinorAxis(et,20)){
+        ok = 1;
+        std::cout << "Test failed at function : SetTubeMinorAxis()";
+    }
+    if (testEllipticalTorusTubeSemiMajorAxis(et,Vector3D(1.0,1.0,1.0))){
+        ok = 1;
+        std::cout << "Test failed at function : TubeSemiMajorAxis()";
+    }
+    if (testEllipticalTorusSetTubeSemiMajorAxis(et,Vector3D(2.0,2.0,2.0))){
+        ok = 1;
+        std::cout << "Test failed at function : SetTubeSemiMajorAxis()";
+    }
+    if (testEllipticalTorusSet(et,Vector3D(3.0,3.0,3.0),Vector3D(3.0,3.0,3.0),30,Vector3D(3.0,3.0,3.0),30)){
+        ok = 1;
+        std::cout << "Test failed at function : Set()";
+    }
+    if (testEllipticalTorusClassName(et)){
+        ok = 1;
+        std::cout << "Test failed at function : ClassName()";
+    }
+    if (testEllipticalTorusType(et)){
+        ok = 1;
+        std::cout << "Test failed at function : Type()";
+    }
+    if (testEllipticalTorusClone(et)){
+        ok = 1;
+        std::cout << "Test failed at function : Clone()";
+    }
+    
+    /* We only add the torus to the database if it failed no tests and is a valid torus */
+	if (ok==0 && et.Isvalid()==true) database.add(et); 
+}
\ No newline at end of file
Index: primitives.cpp
===================================================================
--- primitives.cpp	(revision 63776)
+++ primitives.cpp	(working copy)
@@ -47,6 +47,7 @@
 
 	    if (database.Load(argv[1])) {
 		test_halfspace(database);
+		test_ellipticaltorus(database);
 	    } else {
 		std::cout << "Could not load file: " << argv[1] << std::endln;
 		ret = 2;
Index: primitives.h
===================================================================
--- primitives.h	(revision 63776)
+++ primitives.h	(working copy)
@@ -30,6 +30,7 @@
 
 
 void test_halfspace(BRLCAD::Database& database);
+void test_ellipticaltorus(BRLCAD::Database& database);
 
 
 #endif // PRIMITIVES_H
