Index: src/Shapes/ShapeOps.cpp
===================================================================
--- src/Shapes/ShapeOps.cpp	(revision 571d048445007f27e1ef0c620af6a034eacacef7)
+++ src/Shapes/ShapeOps.cpp	(revision 84721b64723f4546ae9f3f1785703ef9fc47d7ed)
@@ -177,9 +177,7 @@
   ShapeOpsBase_impl(_arg),factors(_factors)
 {
-  ASSERT(factors[0]>0,"cannot stretch a shape by a negative amount");
-  ASSERT(factors[1]>0,"cannot stretch a shape by a negative amount");
-  ASSERT(factors[2]>0,"cannot stretch a shape by a negative amount");
   for(int i = NDIM;i--;){
-    reciFactors[i] = 1/factors[i];
+    ASSERT(factors[i]>0.,"cannot stretch a shape by a negative amount");
+    reciFactors[i] = 1./factors[i];
   }
 }
Index: src/Shapes/unittests/Makefile.am
===================================================================
--- src/Shapes/unittests/Makefile.am	(revision 571d048445007f27e1ef0c620af6a034eacacef7)
+++ src/Shapes/unittests/Makefile.am	(revision 84721b64723f4546ae9f3f1785703ef9fc47d7ed)
@@ -4,11 +4,14 @@
 
 SHAPETESTSSOURCES = \
-	../Shapes/unittests/BaseShapesUnitTest.cpp
+	../Shapes/unittests/BaseShapesUnitTest.cpp \
+	../Shapes/unittests/ShapeOpsUnitTest.cpp
 
 SHAPETESTSHEADERS= \
-	../Shapes/unittests/BaseShapesUnitTest.hpp
+	../Shapes/unittests/BaseShapesUnitTest.hpp \
+	../Shapes/unittests/ShapeOpsUnitTest.hpp
 
 SHAPETESTS = \
-  BaseShapesUnitTest
+  BaseShapesUnitTest \
+  ShapeOpsUnitTest
   
 TESTS += $(SHAPETESTS)
@@ -30,4 +33,12 @@
 BaseShapesUnitTest_LDADD = $(SHAPELIBS)
 
+ShapeOpsUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../Shapes/unittests/ShapeOpsUnitTest.cpp \
+	../Shapes/unittests/ShapeOpsUnitTest.hpp
+nodist_ShapeOpsUnitTest_SOURCES = \
+	../Helpers/defs.hpp \
+	../Helpers/defs.cpp
+ShapeOpsUnitTest_LDADD = $(SHAPELIBS)
+
 
 #AUTOMAKE_OPTIONS = parallel-tests
Index: src/Shapes/unittests/ShapeOpsUnitTest.cpp
===================================================================
--- src/Shapes/unittests/ShapeOpsUnitTest.cpp	(revision 84721b64723f4546ae9f3f1785703ef9fc47d7ed)
+++ src/Shapes/unittests/ShapeOpsUnitTest.cpp	(revision 84721b64723f4546ae9f3f1785703ef9fc47d7ed)
@@ -0,0 +1,108 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ShapeOpsUnitTest.cpp
+ *
+ *  Created on: Jun 18, 2010
+ *      Author: crueger
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include <cmath>
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+#include "CodePatterns/Assert.hpp"
+
+#include "Helpers/defs.hpp"
+#include "LinearAlgebra/RealSpaceMatrix.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "Shapes/BaseShapes.hpp"
+#include "Shapes/Shape.hpp"
+#include "Shapes/ShapeOps.hpp"
+
+#include "ShapeOpsUnitTest.hpp"
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( ShapeOpsTest );
+
+void ShapeOpsTest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+}
+
+void ShapeOpsTest::tearDown()
+{}
+
+void ShapeOpsTest::resizeTest()
+{
+  Shape s = resize(Sphere(), 2.);
+
+  CPPUNIT_ASSERT( s.isInside( Vector(1.5,0.,0.) ) );
+  CPPUNIT_ASSERT( s.isInside( Vector(0.,1.5,0.) ) );
+  CPPUNIT_ASSERT( s.isInside( Vector(0.,0.,1.5) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(2.,0.,0.) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(0.,2.,0.) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(0.,0.,2.) ) );
+}
+
+void ShapeOpsTest::translateTest()
+{
+  Shape s = translate(Sphere(), Vector(1.,0.,0.));
+
+  CPPUNIT_ASSERT( s.isInside( Vector(1.5,0.,0.) ) );
+  CPPUNIT_ASSERT( s.isInside( Vector(1.,.5,0.) ) );
+  CPPUNIT_ASSERT( s.isInside( Vector(1.,0.,.5) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(2.,0.,0.) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(1.,1.,0.) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(1.,0.,1.) ) );
+  CPPUNIT_ASSERT( !s.isInside( Vector(-.5,0.,0.) ) );
+  CPPUNIT_ASSERT( !s.isInside( Vector(0.,-.5,0.) ) );
+  CPPUNIT_ASSERT( !s.isInside( Vector(0.,0.,-.5) ) );
+}
+
+void ShapeOpsTest::stretchTest()
+{
+#ifndef NDEBUG
+  CPPUNIT_ASSERT_THROW( Shape test = stretch(Sphere(), Vector(-2.,0.,0.)), Assert::AssertionFailure );
+#endif
+  Shape s = stretch(Sphere(), Vector(2.,1.,1.));
+
+  CPPUNIT_ASSERT( s.isInside( Vector(1.5,0.,0.) ) );
+  CPPUNIT_ASSERT( !s.isInside( Vector(0.,1.5,0.) ) );
+  CPPUNIT_ASSERT( !s.isInside( Vector(0.,0.,1.5) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(2.,0.,0.) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(0.,1.,0.) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(0.,1.,0.) ) );
+}
+
+void ShapeOpsTest::transformTest()
+{
+  RealSpaceMatrix M;
+  M.setRotation(45., 0., 0.);
+  Shape s = transform(Sphere(), M);
+
+  CPPUNIT_ASSERT( s.isInside( Vector(.5,0.,0.) ) );
+  CPPUNIT_ASSERT( s.isInside( Vector(0.,.5,0.) ) );
+  CPPUNIT_ASSERT( s.isInside( Vector(0.,0.,.5) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(1.,0.,0.) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(0.,1.,0.) ) );
+  CPPUNIT_ASSERT( s.isOnSurface( Vector(0.,0.,1.) ) );
+}
+
Index: src/Shapes/unittests/ShapeOpsUnitTest.hpp
===================================================================
--- src/Shapes/unittests/ShapeOpsUnitTest.hpp	(revision 84721b64723f4546ae9f3f1785703ef9fc47d7ed)
+++ src/Shapes/unittests/ShapeOpsUnitTest.hpp	(revision 84721b64723f4546ae9f3f1785703ef9fc47d7ed)
@@ -0,0 +1,38 @@
+/*
+ * ShapeOpsUnitTest.hpp
+ *
+ *  Created on: Jun 18, 2010
+ *      Author: crueger
+ */
+
+#ifndef SHAPEOPSUNITTEST_HPP_
+#define SHAPEOPSUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class ShapeOpsTest : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( ShapeOpsTest) ;
+  CPPUNIT_TEST ( resizeTest );
+  CPPUNIT_TEST ( translateTest );
+  CPPUNIT_TEST ( stretchTest );
+  CPPUNIT_TEST ( transformTest );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void resizeTest();
+  void translateTest();
+  void stretchTest();
+  void transformTest();
+};
+
+#endif /* SHAPEOPSUNITTEST_HPP_ */
