Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 63776)
+++ CMakeLists.txt	(working copy)
@@ -39,6 +39,7 @@
 set (ciTests_SRC
 	halfspace.cpp
 	primitives.cpp
+	torus.cpp
 )
 
 add_executable(tester_ci_primitives ${ciTests_SRC})
Index: primitives.cpp
===================================================================
--- primitives.cpp	(revision 63776)
+++ primitives.cpp	(working copy)
@@ -47,6 +47,7 @@
 
 	    if (database.Load(argv[1])) {
 		test_halfspace(database);
+		test_torus(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_torus(BRLCAD::Database& database);
 
 
 #endif // PRIMITIVES_H
Index: torus.cpp
===================================================================
--- torus.cpp	(revision 0)
+++ torus.cpp	(working copy)
@@ -0,0 +1,216 @@
+/*                      T O R U S . C P P
+ * BRL-CAD
+ *
+ * Copyright (c) 2014 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 Torus.cpp
+ *
+ *  BRL-CAD core C++ interface:
+ *      torus (ID_TOR) database object implementation
+ *
+ *  Origin -
+ *      TNO (Netherlands)
+ *      IABG mbH (Germany)
+ */ 
+
+/*
+   Tests the following functions defined on a Torus object :
+   Center, SetCenter, Normal, SetNormal, TubeCenterLineRadius,
+   SetTubeCenterLineRadius, TubeRadius, SetTubeRadius, Set,
+   ClassName, Type, IsValid, Clone.
+*/
+
+#include <iostream>
+#include <brlcad/Torus.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 testTorusCenter(BRLCAD::Torus t, Vector3D center)
+{
+    if (cmp(t.Center(),center) == 0) return 0;
+    return 1;
+}
+
+/* Tests the SetCenter() function */
+static int testTorusSetCenter(BRLCAD::Torus t, Vector3D center)
+{
+    t.SetCenter(center);
+    if (cmp(t.Center(),center) == 0) return 0;
+    return 1;
+}
+
+/* Tests the Normal() function */
+static int testTorusNormal(BRLCAD::Torus t, Vector3D normal)
+{
+    if (cmp(t.Normal(),normal) == 0) return 0;
+    return 1;
+}
+
+/* Tests the SetNormal() function */
+static int testTorusSetNormal(BRLCAD::Torus t, Vector3D normal)
+{
+    t.SetNormal(normal);
+    if (cmp(t.Normal(),normal) == 0) return 0;
+    return 1;
+}
+
+/* Tests the TubeCenterLineRadius() function */
+static int testTorusTubeCenterLineRadius(BRLCAD::Torus t, double TCLR)
+{
+    if (t.TubeCenterLineRadius() == TCLR) return 0;
+    return 1;
+}
+
+/* Tests the SetTubeCenterLineRadius() function */
+static int testTorusSetTubeCenterLineRadius(BRLCAD::Torus t, double TCLR)
+{
+    t.SetTubeCenterLineRadius(TCLR);
+    if (t.TubeCenterLineRadius() == TCLR) return 0;
+    return 1;
+}
+
+/* Tests the TubeRadius() function */
+static int testTorusTubeRadius(BRLCAD::Torus t, double TR)
+{
+    if (t.TubeRadius() == TR) return 0;
+    return 1;
+}
+
+/* Tests the SetTubeRadius() function */
+static int testTorusSetTubeRadius(BRLCAD::Torus t, double TR)
+{
+    t.SetTubeRadius(TR);
+    if (t.TubeRadius() == TR) return 0;
+    return 1;
+}
+
+/* Tests the Set() function */
+static int testTorusSet(BRLCAD::Torus t, Vector3D center, Vector3D normal, double TCLR, double TR)
+{
+    t.Set(center,normal,TCLR,TR);
+    if (cmp(t.Center(),center) == 0 && cmp(t.Normal(),normal) == 0 &&
+       t.TubeCenterLineRadius() == TCLR && t.TubeRadius() == TR) return 0;
+    return 1;
+}
+
+/* Tests the ClassName() function */
+static int testTorusClassName(BRLCAD::Torus t) 
+{
+	if (t.ClassName() == "Torus") 
+		return 0;
+	return 1;
+}
+
+/* Tests the Type() function */
+static int testTorusType(BRLCAD::Torus t)
+{
+	if (t.Type() == t.ClassName()) 
+		return 0;
+	return 1;
+}
+
+/* Tests the IsValid() function */
+static int testTorusIsValid(BRLCAD::Torus t) 
+{
+	if (t.IsValid() == true) 
+		return 0;
+	return 1;
+}
+
+/* Tests the Clone() function */
+static int testTorusClone(BRLCAD::Torus t)
+{
+    BRLCAD::Torus t2;
+    t2 = t.Clone();
+    if (cmp(t.Center(),t2.Center()) == 0 && cmp(t.Normal(),t2.Normal()) == 0 &&
+       t.TubeCenterLineRadius() == t2.TubeCenterLineRadius &&
+       t.TubeRadius() == t2.TubeRadius()) return 0;
+    return 1;
+}
+
+/* We now run all the tests */
+void test_torus(BRLCAD::Database& database)
+{	
+
+	/* Initialize a Torus to test on */
+	BRLCAD::Torus t;
+	t.Set(Vector3D(1.0,1.0,1.0),Vector3D(1.0,1.0,1.0),10,10);
+    
+    /* Initialize a boolean to see if one or more of the tests failed */
+	bool ok = 0;
+    
+    /* We now run all the tests */
+    if (testTorusCenter(t,Vector3D(1.0,1.0,1.0))){
+        ok = 1;
+        std::cout << "Test failed at function : Center()";
+    }
+    if (testTorusSetCenter(t,Vector3D(2.0,2.0,2.0))){
+        ok = 1;
+        std::cout << "Test failed at function : SetCenter()";
+    }
+    if (testTorusNormal(t,Vector3D(1.0,1.0,1.0))){
+        ok = 1;
+        std::cout << "Test failed at function : Normal()";
+    }
+    if (testTorusSetNormal(t,Vector3D(2.0,2.0,2.0))){
+        ok = 1;
+        std::cout << "Test failed at function : SetNormal()";
+    }
+    if (testTorusTubeCenterLineRadius(t,10)){
+        ok = 1;
+        std::cout << "Test failed at function : TubeCenterLineRadius()";
+    }
+    if (testTorusSetTubeCenterLineRadius(t,20)){
+        ok = 1;
+        std::cout << "Test failed at function : SetTubeCenterLineRadius()";
+    }
+    if (testTorusTubeRadius(t,10)){
+        ok = 1;
+        std::cout << "Test failed at function : TubeRadius()";
+    }
+    if (testTorusSetTubeRadius(t,20)){
+        ok = 1;
+        std::cout << "Test failed at function : SetTubeRadius()";
+    }
+    if (testTorusSet(t, Vector3D(3.0,3.0,3.0), Vector3D(3.0,3.0,3.0,3.0), 30, 30)){
+        ok = 1;
+        std::cout << "Test failed at function : Set()";
+    }
+    if (testTorusClassName(t)){
+        ok = 1;
+        std::cout << "Test failed at function : ClassName()";
+    }
+    if (testTorusType(t)){
+        ok = 1;
+        std::cout << "Test failed at function : Type()";
+    }
+    if (testTorusClone(t)){
+        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 && t.Isvalid()) database.add(t); 
+}
\ No newline at end of file
