Index: test/VariantTest/VariantTest.cpp
===================================================================
--- test/VariantTest/VariantTest.cpp	(revision 2033)
+++ test/VariantTest/VariantTest.cpp	(working copy)
@@ -26,6 +26,14 @@
 
 using namespace PoDoFo;
 
+// #define VERBOSE_TEST
+#ifdef VERBOSE_TEST
+#define PRINTF printf
+#else
+#define PRINTF(...)
+#endif
+
+
 //
 // Test encoding of names.
 // pszString : internal representation, ie unencoded name
@@ -33,12 +41,12 @@
 //
 void TestName( const char* pszString, const char* pszExpectedEncoded ) 
 {
-    printf("Testing name: %s\n", pszString );
+    PRINTF("Testing name: %s\n", pszString );
 
     PdfName name( pszString );
-    printf("   -> Expected   Value: %s\n", pszExpectedEncoded );
-    printf("   -> Got        Value: %s\n", name.GetEscapedName().c_str() );
-    printf("   -> Unescaped  Value: %s\n", name.GetName().c_str() );
+    PRINTF("   -> Expected   Value: %s\n", pszExpectedEncoded );
+    PRINTF("   -> Got        Value: %s\n", name.GetEscapedName().c_str() );
+    PRINTF("   -> Unescaped  Value: %s\n", name.GetName().c_str() );
 
     if( strcmp( pszExpectedEncoded, name.GetEscapedName().c_str() ) != 0 ) 
     {
@@ -56,10 +64,10 @@
 void TestEncodedName( const char* pszString, const char* pszExpected ) 
 {
     PdfName name( PdfName::FromEscaped(pszString) );
-    printf("Testing encoded name: %s\n", pszString );
-    printf("   -> Expected   Value: %s\n", pszExpected );
-    printf("   -> Got        Value: %s\n", name.GetName().c_str() );
-    printf("   -> Escaped    Value: %s\n", name.GetEscapedName().c_str() );
+    PRINTF("Testing encoded name: %s\n", pszString );
+    PRINTF("   -> Expected   Value: %s\n", pszExpected );
+    PRINTF("   -> Got        Value: %s\n", name.GetName().c_str() );
+    PRINTF("   -> Escaped    Value: %s\n", name.GetEscapedName().c_str() );
 
     if ( strcmp( pszExpected, name.GetName().c_str() ) != 0 )
     {
@@ -79,9 +87,9 @@
     PdfName name1( PdfName::FromEscaped(pszName1) );
     PdfName name2( PdfName::FromEscaped(pszName2) );
 
-    printf("Testing equality of encoded names '%s' and '%s'\n", pszName1, pszName2);
-    printf("   -> Name1    Decoded Value: %s\n", name1.GetName().c_str());
-    printf("   -> Name2    Decoded Value: %s\n", name2.GetName().c_str());
+    PRINTF("Testing equality of encoded names '%s' and '%s'\n", pszName1, pszName2);
+    PRINTF("   -> Name1    Decoded Value: %s\n", name1.GetName().c_str());
+    PRINTF("   -> Name2    Decoded Value: %s\n", name2.GetName().c_str());
 
     if (name1 != name2)
     {
@@ -97,13 +105,13 @@
     if( !pszExpected )
         pszExpected = pszString;
 
-    printf("Testing with value: %s\n", pszString );
+    PRINTF("Testing with value: %s\n", pszString );
     PdfTokenizer tokenizer( pszString, strlen( pszString ) );
 
     tokenizer.GetNextVariant( variant, NULL );
 
-    printf("   -> Expected Datatype: %i\n", eDataType );
-    printf("   -> Got      Datatype: %i\n", variant.GetDataType() );
+    PRINTF("   -> Expected Datatype: %i\n", eDataType );
+    PRINTF("   -> Got      Datatype: %i\n", variant.GetDataType() );
     if( variant.GetDataType() != eDataType )
     {
         PODOFO_RAISE_ERROR( ePdfError_TestFailed );
@@ -110,7 +118,7 @@
     }
 
     variant.ToString( ret );
-    printf("   -> Convert To String: %s\n", ret.c_str() );
+    PRINTF("   -> Convert To String: %s\n", ret.c_str() );
     if( strcmp( pszExpected, ret.c_str() ) != 0 )
     {
         PODOFO_RAISE_ERROR( ePdfError_TestFailed );
@@ -121,8 +129,8 @@
 {
     PdfError   eCode;
 
-    printf("This test tests the PdfVariant class.\n");
-    printf("---\n");
+    PRINTF("This test tests the PdfVariant class.\n");
+    PRINTF("---\n");
 
     PODOFO_UNIQUEU_PTR<PdfFilter> pFilter( PdfFilterFactory::Create( ePdfFilter_ASCIIHexDecode ) );
 
@@ -135,7 +143,7 @@
     TEST_SAFE_OP( Test( "(Test: \\064)", ePdfDataType_String, "(Test: \064)" ) );
     TEST_SAFE_OP( Test( "(Test: \\0645)", ePdfDataType_String, "(Test: 45)" ) );
     TEST_SAFE_OP( Test( "(Test: \\478)", ePdfDataType_String, "(Test: '8)" ) );
-    printf("---\n");
+    PRINTF("---\n");
 
 
     // testing HEX Strings
@@ -142,16 +150,16 @@
     TEST_SAFE_OP( Test( "<FFEB0400A0CC>", ePdfDataType_HexString ) );
     TEST_SAFE_OP( Test( "<FFEB0400A0C>", ePdfDataType_HexString, "<FFEB0400A0C0>" ) );
     TEST_SAFE_OP( Test( "<>", ePdfDataType_HexString ) );
-    printf("---\n");
+    PRINTF("---\n");
 
     // testing bool
     TEST_SAFE_OP( Test( "false", ePdfDataType_Bool ) );
     TEST_SAFE_OP( Test( "true", ePdfDataType_Bool ) );
-    printf("---\n");
+    PRINTF("---\n");
 
     // testing null
     TEST_SAFE_OP( Test( "null", ePdfDataType_Null ) );
-    printf("---\n");
+    PRINTF("---\n");
 
     // testing numbers
     TEST_SAFE_OP( Test( "145", ePdfDataType_Number ) );
@@ -160,13 +168,13 @@
     TEST_SAFE_OP( Test( "-2.970000", ePdfDataType_Real ) );
     TEST_SAFE_OP( Test( "0", ePdfDataType_Number ) );
     TEST_SAFE_OP_IGNORE( Test( "4.", ePdfDataType_Real ) );
-    printf("---\n");
+    PRINTF("---\n");
 
     // testing references
     TEST_SAFE_OP( Test( "2 0 R", ePdfDataType_Reference ) );
     TEST_SAFE_OP( Test( "3 0 R", ePdfDataType_Reference ) );
     TEST_SAFE_OP( Test( "4 1 R", ePdfDataType_Reference ) );
-    printf("---\n");
+    PRINTF("---\n");
 
     // testing names
     TEST_SAFE_OP( Test( "/Type", ePdfDataType_Name ) );
@@ -178,7 +186,7 @@
     TEST_SAFE_OP( Test( "/@pattern", ePdfDataType_Name ) );
     TEST_SAFE_OP( Test( "/A;Name_With-Various***Characters?", ePdfDataType_Name ) );
     TEST_SAFE_OP( Test( "/", ePdfDataType_Name ) ); // empty names are legal, too!
-    printf("---\n");
+    PRINTF("---\n");
 
     // testing arrays
     TEST_SAFE_OP_IGNORE( Test( "[]", ePdfDataType_Array ) );  // this test may fail as the formating is different
@@ -191,7 +199,7 @@
     TEST_SAFE_OP_IGNORE( Test( "[<530464995927cef8aaf46eb953b93373><530464995927cef8aaf46eb953b93373>]", ePdfDataType_Array ) );
     TEST_SAFE_OP_IGNORE( Test( "[ 2 0 R (Test Data) 4 << /Key /Data >> 5 0 R ]", ePdfDataType_Array ) );
     TEST_SAFE_OP_IGNORE( Test( "[<</key/name>>2 0 R]", ePdfDataType_Array ) );
-    printf("---\n");
+    PRINTF("---\n");
 
     // Test some names. The first argument is the unencoded representation, the second
     // is the expected encoded result. The result must not only be /a/ correct encoded
@@ -200,7 +208,7 @@
     TEST_SAFE_OP( TestName( "Length\001\002\003Spaces\177",  "Length#01#02#03Spaces#7F" ) );
     TEST_SAFE_OP( TestName( "Length#01#02#03Spaces#7F", "Length#2301#2302#2303Spaces#237F" ) );
     TEST_SAFE_OP( TestName( "Tab\tTest", "Tab#09Test" ) );
-    printf("---\n");
+    PRINTF("---\n");
 
     // Test some pre-encoded names. The first argument is the encoded name that'll be
     // read from the PDF; the second is the expected representation.
@@ -208,13 +216,13 @@
     TEST_SAFE_OP( TestEncodedName( "paired#28#29parentheses", "paired()parentheses") );
     TEST_SAFE_OP( TestEncodedName( "The_Key_of_F#23_Minor", "The_Key_of_F#_Minor") );
     TEST_SAFE_OP( TestEncodedName( "A#42", "AB") );
-    printf("---\n");
+    PRINTF("---\n");
 
     // Make sure differently encoded names compare equal if their decoded values
     // are equal.
     TEST_SAFE_OP( TestNameEquality( "With Spaces", "With#20Spaces" ) );
     TEST_SAFE_OP( TestNameEquality( "#57#69#74#68#20#53#70#61#63#65#73", "With#20Spaces" ) );
-    printf("---\n");
+    PRINTF("---\n");
 
     // TODO: Move to AlgorithmTest
     char* pszHex = static_cast<char*>(malloc( sizeof(char) * 256 ));
@@ -270,6 +278,6 @@
 
     // TODO: test variant equality comparisons
 
-    printf("Test completed with error code: %i\n", eCode.GetError() );
+    PRINTF("Test completed with error code: %i\n", eCode.GetError() );
     return eCode.GetError();
 }
Index: test/unit/DateTest.cpp
===================================================================
--- test/unit/DateTest.cpp	(revision 2033)
+++ test/unit/DateTest.cpp	(working copy)
@@ -23,6 +23,8 @@
 
 using namespace PoDoFo;
 
+// #define VERBOSE_TEST
+
 // Registers the fixture into the 'registry'
 CPPUNIT_TEST_SUITE_REGISTRATION( DateTest );
 
@@ -111,7 +113,9 @@
   };
 
   for (const auto& d : data) {
+#ifdef VERBOSE_TEST
     std::cout << "Parse " << d.name << "\n";
+#endif
     assert(PoDoFo::PdfDate(d.date).IsValid());
   }
 }
Index: test/unit/DeviceTest.cpp
===================================================================
--- test/unit/DeviceTest.cpp	(revision 2033)
+++ test/unit/DeviceTest.cpp	(working copy)
@@ -27,6 +27,13 @@
 
 using namespace PoDoFo;
 
+// #define VERBOSE_TEST
+#ifdef VERBOSE_TEST
+#define PRINTF printf
+#else
+#define PRINTF(...)
+#endif
+
 // Registers the fixture into the 'registry'
 CPPUNIT_TEST_SUITE_REGISTRATION( DeviceTest );
 
@@ -42,68 +49,38 @@
 void DeviceTest::testDevices() 
 {
     const char* pszTestString = "Hello World Buffer!";
-    long        lLen          = strlen( pszTestString );
+    size_t      lLen          = strlen( pszTestString );
 
     PdfRefCountedBuffer buffer1;
     PdfRefCountedBuffer buffer2;
 
-    printf("-> Testing PdfRefCountedBuffer...\n");
+    PRINTF("-> Testing PdfRefCountedBuffer...\n");
 
     // test simple append 
-    printf("\t -> Appending\n");
+    PRINTF("\t -> Appending\n");
     PdfBufferOutputStream stream1( &buffer1 );
     stream1.Write( pszTestString, lLen );
     stream1.Close();
-    if( static_cast<long>(buffer1.GetSize()) != lLen ) 
-    {
-        fprintf( stderr, "Buffer size does not match! Size=%li should be %li\n", buffer1.GetSize(), lLen );
-        PODOFO_RAISE_ERROR( ePdfError_TestFailed );
-    }
-    
-    if( strcmp( buffer1.GetBuffer(), pszTestString ) != 0 ) 
-    {
-        fprintf( stderr, "Buffer contents do not match!\n" );
-        PODOFO_RAISE_ERROR( ePdfError_TestFailed );
-    }
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Buffer size", lLen, buffer1.GetSize() );
+    CPPUNIT_ASSERT_MESSAGE( "Buffer contents",
+        strncmp(pszTestString, buffer1.GetBuffer(), lLen)==0 );
 
     // test assignment
-    printf("\t -> Assignment\n");
+    PRINTF("\t -> Assignment\n");
     buffer2 = buffer1;
-    if( buffer1.GetSize() != buffer2.GetSize() ) 
-    {
-        fprintf( stderr, "Buffer sizes does not match! Size1=%li Size2=%li\n", buffer1.GetSize(), buffer2.GetSize() );
-        PODOFO_RAISE_ERROR( ePdfError_TestFailed );
-    }
+    CPPUNIT_ASSERT_EQUAL( buffer1.GetSize(), buffer2.GetSize() );
+    CPPUNIT_ASSERT_EQUAL( buffer1.GetBuffer(), buffer2.GetBuffer() );
 
-    if( strcmp( buffer1.GetBuffer(), buffer2.GetBuffer() ) != 0 ) 
-    {
-        fprintf( stderr, "Buffer contents do not match after assignment!\n" );
-        PODOFO_RAISE_ERROR( ePdfError_TestFailed );
-    }
-
     // test detach
-    printf("\t -> Detaching\n");
+    PRINTF("\t -> Detaching\n");
     PdfBufferOutputStream stream( &buffer2 );
     stream.Write( pszTestString, lLen );
     stream.Close();
-    if( static_cast<long>(buffer2.GetSize()) != lLen * 2 ) 
-    {
-        fprintf( stderr, "Buffer size after detach does not match! Size=%li should be %li\n", buffer2.GetSize(), lLen * 2 );
-        PODOFO_RAISE_ERROR( ePdfError_TestFailed );
-    }
+    CPPUNIT_ASSERT_EQUAL( lLen*2, buffer2.GetSize() );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "buffer1 should not be modified", lLen, buffer1.GetSize() );
+    CPPUNIT_ASSERT_MESSAGE( "buffer1 should not be modified",
+        strncmp(pszTestString, buffer1.GetBuffer(), lLen)==0 );
 
-    if( static_cast<long>(buffer1.GetSize()) != lLen ) 
-    {
-        fprintf( stderr, "Buffer1 size seems to be modified\n");
-        PODOFO_RAISE_ERROR( ePdfError_TestFailed );
-    }
-    
-    if( strcmp( buffer1.GetBuffer(), pszTestString ) != 0 ) 
-    {
-        fprintf( stderr, "Buffer1 contents seem to be modified!\n" );
-        PODOFO_RAISE_ERROR( ePdfError_TestFailed );
-    }
-        
     // large appends
     PdfBufferOutputStream streamLarge( &buffer1 );
     for( int i=0;i<100;i++ ) 
@@ -112,11 +89,6 @@
     }
     streamLarge.Close();
 
-    if( static_cast<long>(buffer1.GetSize()) != (lLen * 100 + lLen) ) 
-    {
-        fprintf( stderr, "Buffer1 size is wrong after 100 attaches: %li\n", buffer1.GetSize() );
-        PODOFO_RAISE_ERROR( ePdfError_TestFailed );
-    }
-    
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "buffer1 after 100 attaches", lLen*101, buffer1.GetSize() );
 }
 
Index: test/unit/EncryptTest.cpp
===================================================================
--- test/unit/EncryptTest.cpp	(revision 2033)
+++ test/unit/EncryptTest.cpp	(working copy)
@@ -25,6 +25,15 @@
 
 using namespace PoDoFo;
 
+// #define VERBOSE_TEST
+#ifdef VERBOSE_TEST
+#define PRINTF printf
+#else
+#define PRINTF(...)
+#endif
+
+#ifdef PODOFO_HAVE_OPENSSL
+
 // Registers the fixture into the 'registry'
 CPPUNIT_TEST_SUITE_REGISTRATION( EncryptTest );
 
@@ -249,12 +258,12 @@
     } catch( PdfError & e ) {
         e.PrintErrorMsg();
 
-        printf("Removing temp file: %s\n", sFilename.c_str());
+        PRINTF("Removing temp file: %s\n", sFilename.c_str());
         TestUtils::deleteFile(sFilename.c_str());
         throw e;
     }
 
-    printf("Removing temp file: %s\n", sFilename.c_str());
+    PRINTF("Removing temp file: %s\n", sFilename.c_str());
     TestUtils::deleteFile(sFilename.c_str());
 }
 
@@ -284,13 +293,13 @@
     } catch( PdfError & e ) {
         e.PrintErrorMsg();
 
-        printf("Removing temp file: %s\n", sFilename.c_str());
+        PRINTF("Removing temp file: %s\n", sFilename.c_str());
         TestUtils::deleteFile(sFilename.c_str());
 
         throw e;
     }
 
-    printf("Removing temp file: %s\n", sFilename.c_str());
+    PRINTF("Removing temp file: %s\n", sFilename.c_str());
     TestUtils::deleteFile(sFilename.c_str());
 }
 
@@ -315,7 +324,7 @@
     writer.SetEncrypted( "user", "owner" );
     writer.Write( pszFilename );
 
-    printf( "Wrote: %s (R=%i)\n", pszFilename, writer.GetEncrypt()->GetRevision() );
+    PRINTF( "Wrote: %s (R=%i)\n", pszFilename, writer.GetEncrypt()->GetRevision() );
 }
 
 void EncryptTest::testEnableAlgorithms()
@@ -388,10 +397,11 @@
     pStream->Write( pBuffer2, strlen( pBuffer2 ) );
     pStream->Close();
 
-    printf("Result: %i \n", memcmp( pEncBuffer, mem.TakeBuffer(), lLen ) );
+    PRINTF("Result: %i \n", memcmp( pEncBuffer, mem.TakeBuffer(), lLen ) );
 
 
     enc.Encrypt( reinterpret_cast<unsigned char*>(pEncBuffer), lLen );
-    printf("Decrypted buffer: %s\n", pEncBuffer );
+    PRINTF("Decrypted buffer: %s\n", pEncBuffer );
     */
 
+#endif // PODOFO_HAVE_OENSSL
Index: test/unit/FilterTest.cpp
===================================================================
--- test/unit/FilterTest.cpp	(revision 2033)
+++ test/unit/FilterTest.cpp	(working copy)
@@ -24,6 +24,14 @@
 
 #include <stdlib.h>
 
+// #define VERBOSE_TEST
+#ifdef VERBOSE_TEST
+#define PRINTF printf
+#else
+#define PRINTF(...)
+#endif
+
+
 // prefer std::unique_ptr over std::auto_ptr
 #ifdef PODOFO_HAVE_UNIQUE_PTR
 #define PODOFO_UNIQUEU_PTR std::unique_ptr
@@ -69,18 +77,18 @@
     PODOFO_UNIQUEU_PTR<PdfFilter> pFilter( PdfFilterFactory::Create( eFilter ) );
     if( !pFilter.get() )
     {
-        printf("!!! Filter %i not implemented.\n", eFilter);
+        PRINTF("!!! Filter %i not implemented.\n", eFilter);
         return;
     }
 
-    printf("Testing Algorithm %i:\n", eFilter);
-    printf("\t-> Testing Encoding\n");
+    PRINTF("Testing Algorithm %i:\n", eFilter);
+    PRINTF("\t-> Testing Encoding\n");
     try {
         pFilter->Encode( pTestBuffer, lTestLength, &pEncoded, &lEncoded );
     } catch( PdfError & e ) {
         if( e == ePdfError_UnsupportedFilter ) 
         {
-            printf("\t-> Encoding not supported for filter %i.\n", eFilter );
+            PRINTF("\t-> Encoding not supported for filter %i.\n", eFilter );
             return;
         }
         else
@@ -90,13 +98,13 @@
         }
     }
 
-    printf("\t-> Testing Decoding\n");
+    PRINTF("\t-> Testing Decoding\n");
     try {
         pFilter->Decode( pEncoded, lEncoded, &pDecoded, &lDecoded );
     } catch( PdfError & e ) {
         if( e == ePdfError_UnsupportedFilter ) 
         {
-            printf("\t-> Decoding not supported for filter %i.\n", eFilter);
+            PRINTF("\t-> Decoding not supported for filter %i.\n", eFilter);
             return;
         }
         else
@@ -106,9 +114,9 @@
         }
     }
 
-    printf("\t-> Original Data Length: %li\n", lTestLength );
-    printf("\t-> Encoded  Data Length: %li\n", lEncoded );
-    printf("\t-> Decoded  Data Length: %li\n", lDecoded );
+    PRINTF("\t-> Original Data Length: %li\n", lTestLength );
+    PRINTF("\t-> Encoded  Data Length: %li\n", lEncoded );
+    PRINTF("\t-> Decoded  Data Length: %li\n", lDecoded );
 
     CPPUNIT_ASSERT_EQUAL( static_cast<long>(lTestLength), static_cast<long>(lDecoded) );
     CPPUNIT_ASSERT_EQUAL( memcmp( pTestBuffer, pDecoded, lTestLength ), 0 );
@@ -116,7 +124,7 @@
     free( pEncoded );
     free( pDecoded );
 
-    printf("\t-> Test succeeded!\n");
+    PRINTF("\t-> Test succeeded!\n");
 }
 
 void FilterTest::testFilters()
@@ -133,7 +141,7 @@
     PODOFO_UNIQUEU_PTR<PdfFilter> pFilter( PdfFilterFactory::Create( ePdfFilter_CCITTFaxDecode ) );
     if( !pFilter.get() )
     {
-        printf("!!! ePdfFilter_CCITTFaxDecode not implemented skipping test!\n");
+        PRINTF("!!! ePdfFilter_CCITTFaxDecode not implemented skipping test!\n");
         return;
     }
 
Index: test/unit/FontTest.cpp
===================================================================
--- test/unit/FontTest.cpp	(revision 2033)
+++ test/unit/FontTest.cpp	(working copy)
@@ -25,6 +25,13 @@
 #include <ft2build.h>
 #include FT_FREETYPE_H
 
+// #define VERBOSE_TEST
+#ifdef VERBOSE_TEST
+#define PRINTF printf
+#else
+#define PRINTF(...)
+#endif
+
 using namespace PoDoFo;
 
 CPPUNIT_TEST_SUITE_REGISTRATION( FontTest );
@@ -66,7 +73,7 @@
 
     if( fontSet )
     {
-        printf("Testing %i fonts\n", fontSet->nfont );
+        PRINTF("Testing %i fonts\n", fontSet->nfont );
         int	j;
         for (j = 0; j < fontSet->nfont; j++)
         {
@@ -108,7 +115,7 @@
             {
                 if( error.GetError() == ePdfError_UnsupportedFontFormat )
                 {
-                    printf("Unsupported font format: %s\n", sPodofoFontPath.c_str());
+                    PRINTF("Unsupported font format: %s\n", sPodofoFontPath.c_str());
                 }
                 else
                 {
@@ -123,7 +130,7 @@
         }
         else
         {
-            printf("Ignoring font: %s\n", sPodofoFontPath.c_str());
+            PRINTF("Ignoring font: %s\n", sPodofoFontPath.c_str());
         }
     }
 } 
Index: test/unit/NameTest.cpp
===================================================================
--- test/unit/NameTest.cpp	(revision 2033)
+++ test/unit/NameTest.cpp	(working copy)
@@ -22,6 +22,13 @@
 
 #include <podofo.h>
 
+// #define VERBOSE_TEST
+#ifdef VERBOSE_TEST
+#define PRINTF printf
+#else
+#define PRINTF(...)
+#endif
+
 using namespace PoDoFo;
 
 // Registers the fixture into the 'registry'
@@ -127,12 +134,12 @@
 //
 void NameTest::TestName( const char* pszString, const char* pszExpectedEncoded ) 
 {
-    printf("Testing name: %s\n", pszString );
+    PRINTF("Testing name: %s\n", pszString );
 
     PdfName name( pszString );
-    printf("   -> Expected   Value: %s\n", pszExpectedEncoded );
-    printf("   -> Got        Value: %s\n", name.GetEscapedName().c_str() );
-    printf("   -> Unescaped  Value: %s\n", name.GetName().c_str() );
+    PRINTF("   -> Expected   Value: %s\n", pszExpectedEncoded );
+    PRINTF("   -> Got        Value: %s\n", name.GetEscapedName().c_str() );
+    PRINTF("   -> Unescaped  Value: %s\n", name.GetName().c_str() );
 
     CPPUNIT_ASSERT_EQUAL( strcmp( pszExpectedEncoded, name.GetEscapedName().c_str() ), 0 );
 
@@ -144,10 +151,10 @@
 void NameTest::TestEncodedName( const char* pszString, const char* pszExpected ) 
 {
     PdfName name( PdfName::FromEscaped(pszString) );
-    printf("Testing encoded name: %s\n", pszString );
-    printf("   -> Expected   Value: %s\n", pszExpected );
-    printf("   -> Got        Value: %s\n", name.GetName().c_str() );
-    printf("   -> Escaped    Value: %s\n", name.GetEscapedName().c_str() );
+    PRINTF("Testing encoded name: %s\n", pszString );
+    PRINTF("   -> Expected   Value: %s\n", pszExpected );
+    PRINTF("   -> Got        Value: %s\n", name.GetName().c_str() );
+    PRINTF("   -> Escaped    Value: %s\n", name.GetEscapedName().c_str() );
 
     if ( strcmp( pszExpected, name.GetName().c_str() ) != 0 )
     {
@@ -164,9 +171,9 @@
     PdfName name1( PdfName::FromEscaped(pszName1) );
     PdfName name2( PdfName::FromEscaped(pszName2) );
 
-    printf("Testing equality of encoded names '%s' and '%s'\n", pszName1, pszName2);
-    printf("   -> Name1    Decoded Value: %s\n", name1.GetName().c_str());
-    printf("   -> Name2    Decoded Value: %s\n", name2.GetName().c_str());
+    PRINTF("Testing equality of encoded names '%s' and '%s'\n", pszName1, pszName2);
+    PRINTF("   -> Name1    Decoded Value: %s\n", name1.GetName().c_str());
+    PRINTF("   -> Name2    Decoded Value: %s\n", name2.GetName().c_str());
 
     CPPUNIT_ASSERT_EQUAL( name1 == name2, true  ); // use operator==
     CPPUNIT_ASSERT_EQUAL( name1 != name2, false ); // use operator!=
Index: test/unit/StringTest.cpp
===================================================================
--- test/unit/StringTest.cpp	(revision 2033)
+++ test/unit/StringTest.cpp	(working copy)
@@ -42,6 +42,9 @@
 {
 }
 
+// #define VERBOSE_TEST
+#ifdef VERBOSE_TEST
+#define PRINTF printf
 void print(pdf_utf16be* pszUtf16, pdf_long lLen)
 {
     printf("start lLen=%li\n", static_cast<long>(lLen));
@@ -59,6 +62,10 @@
     
     printf("ende\n");
 }
+#else
+#define PRINTF(...)
+void print(pdf_utf16be*, pdf_long) {}
+#endif
 
 void StringTest::TestLibUnistringInternal(const char* pszString, const long lLenUtf8, const long lLenUtf16)
 {
@@ -157,19 +164,21 @@
     PdfString strUtf16b( reinterpret_cast<const pdf_utf16be*>(psStringJapUtf16BE), 21 );
 
     /*
+#ifdef VERBOSE_TEST
     std::cout << std::endl;
     std::cout << "utf8 :" << strUtf8 << "  " << strUtf8.GetCharacterLength() << std::endl;
     std::cout << "utf16:" << strUtf16 << "  " << strUtf16.GetCharacterLength() <<  std::endl;
     std::cout << "wide : ";
     for( int i=0;i<=strUtf16.GetCharacterLength();i++ )
-        printf("%04x ", strUtf16.GetUnicode()[i]);
+        PRINTF("%04x ", strUtf16.GetUnicode()[i]);
     std::cout << std::endl;
 
 
     std::cout << "wide : ";
     for( int i=0;i<=strUtf16.GetCharacterLength();i++ )
-        printf("%4i ", i );
+        PRINTF("%4i ", i );
     std::cout << std::endl;
+#endif // VERBOSE_TEST
     */
     
     // Compare UTF16 to UTF8 string
@@ -305,7 +314,7 @@
     std::string ret;
     std::string expected = pszExpected;
 
-    printf("Testing with value: %s\n", pszSource );
+    PRINTF("Testing with value: %s\n", pszSource );
     PdfTokenizer tokenizer( pszSource, strlen( pszSource ) );
 
     tokenizer.GetNextVariant( variant, NULL );
@@ -312,7 +321,7 @@
     CPPUNIT_ASSERT_EQUAL( variant.GetDataType(), ePdfDataType_String );
 
     variant.ToString( ret );
-    printf("   -> Convert To String: %s\n", ret.c_str() );
+    PRINTF("   -> Convert To String: %s\n", ret.c_str() );
 
     CPPUNIT_ASSERT_EQUAL( expected, ret );
 
Index: test/unit/TestUtils.cpp
===================================================================
--- test/unit/TestUtils.cpp	(revision 2033)
+++ test/unit/TestUtils.cpp	(working copy)
@@ -53,7 +53,7 @@
     close(handle);
 #endif // _WIN32 || _WIN64
 
-    printf("Created tempfile: %s\n", tmpFilename);
+    // printf("Created tempfile: %s\n", tmpFilename);
     std::string sFilename = tmpFilename;
     return sFilename;
 }
Index: test/unit/TokenizerTest.cpp
===================================================================
--- test/unit/TokenizerTest.cpp	(revision 2033)
+++ test/unit/TokenizerTest.cpp	(working copy)
@@ -26,6 +26,13 @@
 
 CPPUNIT_TEST_SUITE_REGISTRATION( TokenizerTest );
 
+// #define VERBOSE_TEST
+#ifdef VERBOSE_TEST
+#define PRINTF printf
+#else
+#define PRINTF(...)
+#endif
+
 void TokenizerTest::Test( const char* pszString, EPdfDataType eDataType, const char* pszExpected )
 {
     PdfVariant  variant;
@@ -34,17 +41,17 @@
 
     expected = pszExpected ? pszExpected : pszString;
 
-    printf("Testing with value: %s\n", pszString );
+    PRINTF("Testing with value: %s\n", pszString );
     PdfTokenizer tokenizer( pszString, strlen( pszString ) );
 
     tokenizer.GetNextVariant( variant, NULL );
 
-    printf("   -> Expected Datatype: %i\n", eDataType );
-    printf("   -> Got      Datatype: %i\n", variant.GetDataType() );
+    PRINTF("   -> Expected Datatype: %i\n", eDataType );
+    PRINTF("   -> Got      Datatype: %i\n", variant.GetDataType() );
     CPPUNIT_ASSERT_EQUAL( variant.GetDataType(), eDataType );
 
     variant.ToString( ret );
-    printf("   -> Convert To String: %s\n", ret.c_str() );
+    PRINTF("   -> Convert To String: %s\n", ret.c_str() );
 
     CPPUNIT_ASSERT_EQUAL( expected, ret );
 }
@@ -120,9 +127,9 @@
     CPPUNIT_ASSERT_EQUAL( variant.GetName().GetName(), name2.GetName() );
     CPPUNIT_ASSERT_EQUAL( oss.str(), std::string(pszString) );
 
-    printf("!!! Name=[%s]\n", variant.GetName().GetName().c_str() );
-    printf("!!! Name2=[%s]\n", name2.GetName().c_str() );
-    printf("!!! oss=[%s]\n", oss.str().c_str() );
+    PRINTF("!!! Name=[%s]\n", variant.GetName().GetName().c_str() );
+    PRINTF("!!! Name2=[%s]\n", name2.GetName().c_str() );
+    PRINTF("!!! oss=[%s]\n", oss.str().c_str() );
 }
 
 void TokenizerTest::testNull()
Index: test/unit/main.cpp
===================================================================
--- test/unit/main.cpp	(revision 2033)
+++ test/unit/main.cpp	(working copy)
@@ -92,8 +92,8 @@
       runner.setOutputter(xmlOutputter);
   }
 
-  // Enable PoDoFo debugging and logging
-  PoDoFo::PdfError::EnableLogging( true );
+  // Enable PoDoFo debugging, disable logging logging
+  PoDoFo::PdfError::EnableLogging( false );
   PoDoFo::PdfError::EnableDebug( true );
 
   // Run the tests.
