summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-03-18 09:44:21 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-03-18 09:45:42 +0000
commit2c53ce5af80ea29e78be59791aa61c5d5287e297 (patch)
tree9a147fe0731aeb9c80a02cc622437af45a32a2a4 /sal
parenta198775260b4949fcffb46e4e87df1bf61b02046 (diff)
quieten these tests
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/cipher/rtl_cipher.cxx72
-rw-r--r--sal/qa/rtl/doublelock/rtl_doublelocking.cxx19
-rw-r--r--sal/qa/rtl/locale/rtl_locale.cxx25
3 files changed, 13 insertions, 103 deletions
diff --git a/sal/qa/rtl/cipher/rtl_cipher.cxx b/sal/qa/rtl/cipher/rtl_cipher.cxx
index 27abd0a3755d..08343d1411ba 100644
--- a/sal/qa/rtl/cipher/rtl_cipher.cxx
+++ b/sal/qa/rtl/cipher/rtl_cipher.cxx
@@ -211,9 +211,6 @@ public:
memset(pArgBuffer, 0, nArgLen);
pArgBuffer[0] = _nArgValue;
- printf(" init Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf(" init Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
-
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
@@ -229,37 +226,12 @@ public:
/* rtlCipherError */ aError = rtl_cipher_encode(aCipher, pPlainTextBuffer, nPlainTextLen, pCipherBuffer, nCipherLen);
CPPUNIT_ASSERT_MESSAGE("wrong encode", aError == rtl_Cipher_E_None);
- printf(" Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf(" Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
- printf(" Plain: %s\n", createHex(pPlainTextBuffer, nPlainTextLen).getStr());
- printf( "Cipher Buf: %s\n", createHex(pCipherBuffer, nCipherLen).getStr());
-
sal_uInt32 nPlainText2Len = 16;
sal_uInt8 *pPlainText2Buffer = new sal_uInt8[ nPlainText2Len ];
memset(pPlainText2Buffer, 0, nPlainText2Len);
/* rtlCipherError */ aError = rtl_cipher_decode(aCipher, pCipherBuffer, nCipherLen, pPlainText2Buffer, nPlainText2Len);
CPPUNIT_ASSERT_MESSAGE("decode should not work", aError != rtl_Cipher_E_None);
-
- // rtl::OString sPlainText2Str((char*)pPlainText2Buffer, nPlainText2Len);
- // printf(" Plain: %s\n", createHex(pPlainText2Buffer, nPlainText2Len).getStr());
- // printf(" ascii: %s\n", sPlainText2Str.getStr());
- //
- // // printf(" Buf: %s\n", createHex(pCipherBuffer, nCipherLen).getStr());
- //
- // sal_Int32 nCompare = memcmp(pPlainTextBuffer, pPlainText2Buffer, 16);
- //
- // CPPUNIT_ASSERT_MESSAGE("compare between plain and decoded plain failed", nCompare == 0);
- //
- // delete [] pPlainText2Buffer;
- //
- // delete [] pCipherBuffer;
- // delete [] pPlainTextBuffer;
- //
- // delete [] pArgBuffer;
- // delete [] pKeyBuffer;
- //
- // rtl_cipher_destroy(aCipher);
}
void test_encode_and_decode(sal_uInt8 _nKeyValue, sal_uInt8 _nArgValue, rtl::OString const& _sPlainTextStr)
@@ -277,9 +249,6 @@ public:
memset(pArgBuffer, 0, nArgLen);
pArgBuffer[0] = _nArgValue;
- printf(" init Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf(" init Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
-
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionBoth, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
@@ -295,11 +264,6 @@ public:
/* rtlCipherError */ aError = rtl_cipher_encode(aCipher, pPlainTextBuffer, nPlainTextLen, pCipherBuffer, nCipherLen);
CPPUNIT_ASSERT_MESSAGE("wrong encode", aError == rtl_Cipher_E_None);
- printf(" Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf(" Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
- printf(" Plain: %s\n", createHex(pPlainTextBuffer, nPlainTextLen).getStr());
- printf( "Cipher Buf: %s\n", createHex(pCipherBuffer, nCipherLen).getStr());
-
sal_uInt32 nPlainText2Len = 16;
sal_uInt8 *pPlainText2Buffer = new sal_uInt8[ nPlainText2Len ];
memset(pPlainText2Buffer, 0, nPlainText2Len);
@@ -308,10 +272,6 @@ public:
CPPUNIT_ASSERT_MESSAGE("wrong decode", aError == rtl_Cipher_E_None);
rtl::OString sPlainText2Str((char*)pPlainText2Buffer, nPlainText2Len);
- printf(" Plain: %s\n", createHex(pPlainText2Buffer, nPlainText2Len).getStr());
- printf(" as ascii: %s\n", sPlainText2Str.getStr());
-
- // printf(" Buf: %s\n", createHex(pCipherBuffer, nCipherLen).getStr());
sal_Int32 nCompare = memcmp(pPlainTextBuffer, pPlainText2Buffer, 16);
@@ -460,9 +420,6 @@ public:
memset(pArgBuffer, 0, nArgLen);
pArgBuffer[0] = _nArgValue;
- printf("init Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf("init Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
-
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
@@ -478,11 +435,6 @@ public:
/* rtlCipherError */ aError = rtl_cipher_encode(aCipher, pDataBuffer, nDataLen, pBuffer, nLen);
CPPUNIT_ASSERT_MESSAGE("wrong encode", aError == rtl_Cipher_E_None);
- printf(" Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf(" Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
- printf("Data: %s\n", createHex(pDataBuffer, nDataLen).getStr());
- printf(" Buf: %s\n", createHex(pBuffer, nLen).getStr());
-
delete [] pBuffer;
delete [] pDataBuffer;
@@ -563,15 +515,9 @@ public:
sal_uInt8 *pArgBuffer = new sal_uInt8[ nArgLen ];
memset(pArgBuffer, 0, nArgLen);
- printf("Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf("Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
-
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
- printf("Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf("Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
-
delete [] pArgBuffer;
delete [] pKeyBuffer;
@@ -592,15 +538,9 @@ public:
sal_uInt8 *pArgBuffer = new sal_uInt8[ nArgLen ];
memset(pArgBuffer, 0, nArgLen);
- printf("Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf("Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
-
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
- printf("Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf("Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
-
delete [] pArgBuffer;
delete [] pKeyBuffer;
@@ -620,15 +560,9 @@ public:
memset(pArgBuffer, 0, nArgLen);
pArgBuffer[0] = 1;
- printf("Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf("Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
-
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
- printf("Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf("Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
-
delete [] pArgBuffer;
delete [] pKeyBuffer;
@@ -649,15 +583,9 @@ public:
memset(pArgBuffer, 0, nArgLen);
pArgBuffer[0] = 1;
- printf("Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf("Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
-
rtlCipherError aError = rtl_cipher_init(aCipher, rtl_Cipher_DirectionEncode, pKeyBuffer, nKeyLen, pArgBuffer, nArgLen);
CPPUNIT_ASSERT_MESSAGE("wrong init", aError == rtl_Cipher_E_None);
- printf("Key: %s\n", createHex(pKeyBuffer, nKeyLen).getStr());
- printf("Arg: %s\n", createHex(pArgBuffer, nArgLen).getStr());
-
delete [] pArgBuffer;
delete [] pKeyBuffer;
diff --git a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
index 20bef0d99049..5771563062b3 100644
--- a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
+++ b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
@@ -54,15 +54,6 @@ struct Gregorian : public ::rtl::StaticWithInit<const ::rtl::OUString, Gregorian
};
}
-inline void printOUString( ::rtl::OUString const & _suStr )
-{
- rtl::OString aString;
-
- printf( "OUString: " );
- aString = ::rtl::OUStringToOString( _suStr, RTL_TEXTENCODING_ASCII_US );
- printf( "'%s'\n", aString.getStr( ) );
-}
-
// -----------------------------------------------------------------------------
namespace ThreadHelper
{
@@ -127,8 +118,6 @@ protected:
while(schedule())
{
rtl::OUString aStr = Gregorian::get();
- printOUString(aStr);
- printOUString(m_sConstStr);
if (aStr.equals(m_sConstStr))
{
m_nOK++;
@@ -181,7 +170,6 @@ namespace rtl_DoubleLocking
void getValue_001()
{
rtl::OUString aStr = Gregorian::get();
- printOUString(aStr);
CPPUNIT_ASSERT_MESSAGE(
"Gregorian::get() failed, wrong value expected.",
@@ -208,7 +196,7 @@ namespace rtl_DoubleLocking
pThread->create();
p2Thread->create();
- ThreadHelper::thread_sleep_tenth_sec(50);
+ ThreadHelper::thread_sleep_tenth_sec(5);
pThread->terminate();
p2Thread->terminate();
@@ -219,8 +207,10 @@ namespace rtl_DoubleLocking
sal_Int32 nValueOK2 = 0;
nValueOK2 = p2Thread->getOK();
+#if OSL_DEBUG_LEVEL > 2
printf("Value in Thread #1 is %d\n", nValueOK);
printf("Value in Thread #2 is %d\n", nValueOK2);
+#endif
sal_Int32 nValueFails = 0;
nValueFails = pThread->getFails();
@@ -228,10 +218,11 @@ namespace rtl_DoubleLocking
sal_Int32 nValueFails2 = 0;
nValueFails2 = p2Thread->getFails();
+#if OSL_DEBUG_LEVEL > 2
printf("Fails in Thread #1 is %d\n", nValueFails);
printf("Fails in Thread #2 is %d\n", nValueFails2);
+#endif
- // ThreadHelper::thread_sleep_tenth_sec(1);
pThread->join();
p2Thread->join();
diff --git a/sal/qa/rtl/locale/rtl_locale.cxx b/sal/qa/rtl/locale/rtl_locale.cxx
index 004c640bb922..cda5b96c1cf0 100644
--- a/sal/qa/rtl/locale/rtl_locale.cxx
+++ b/sal/qa/rtl/locale/rtl_locale.cxx
@@ -142,16 +142,14 @@ public:
// insert your test code here.
void getLanguage_001()
{
- rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
+ rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
rtl::OUString suLanguage = aLocale.getLanguage();
- printf("Language: %s\n", rtl::OUStringToOString(suLanguage, osl_getThreadTextEncoding()).getStr());
CPPUNIT_ASSERT_MESSAGE("locale language must be 'de'", suLanguage.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("de"))));
}
void getLanguage_002()
{
- rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
+ rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
rtl::OUString suLanguage = rtl_locale_getLanguage(aLocale.getData());
- printf("Language: %s\n", rtl::OUStringToOString(suLanguage, osl_getThreadTextEncoding()).getStr());
CPPUNIT_ASSERT_MESSAGE("locale language must be 'de'", suLanguage.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("de"))));
}
@@ -183,16 +181,14 @@ public:
// insert your test code here.
void getCountry_001()
{
- rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
+ rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
rtl::OUString suCountry = aLocale.getCountry();
- printf("Country: %s\n", rtl::OUStringToOString(suCountry, osl_getThreadTextEncoding()).getStr());
CPPUNIT_ASSERT_MESSAGE("locale country must be 'DE'", suCountry.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DE"))));
}
void getCountry_002()
{
- rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
+ rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
rtl::OUString suCountry = rtl_locale_getCountry(aLocale.getData());
- printf("Country: %s\n", rtl::OUStringToOString(suCountry, osl_getThreadTextEncoding()).getStr());
CPPUNIT_ASSERT_MESSAGE("locale country must be 'DE'", suCountry.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DE"))));
}
@@ -224,16 +220,14 @@ public:
// insert your test code here.
void getVariant_001()
{
- rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
+ rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
rtl::OUString suVariant = aLocale.getVariant();
- printf("Variant: %s\n", rtl::OUStringToOString(suVariant, osl_getThreadTextEncoding()).getStr());
CPPUNIT_ASSERT_MESSAGE("locale variant must be 'hochdeutsch'", suVariant.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hochdeutsch"))));
}
void getVariant_002()
{
- rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
+ rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
rtl::OUString suVariant = rtl_locale_getVariant(aLocale.getData());
- printf("Variant: %s\n", rtl::OUStringToOString(suVariant, osl_getThreadTextEncoding()).getStr());
CPPUNIT_ASSERT_MESSAGE("locale variant must be 'hochdeutsch'", suVariant.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hochdeutsch"))));
}
@@ -265,16 +259,14 @@ public:
// insert your test code here.
void hashCode_001()
{
- rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
+ rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
sal_Int32 nHashCode = aLocale.hashCode();
- printf("Hashcode: %d\n", nHashCode);
CPPUNIT_ASSERT_MESSAGE("locale hashcode must be 3831", nHashCode != 0);
}
void hashCode_002()
{
- rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
+ rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
sal_Int32 nHashCode = rtl_locale_hashCode(aLocale.getData());
- printf("Hashcode: %d\n", nHashCode);
CPPUNIT_ASSERT_MESSAGE("locale hashcode must be 3831", nHashCode != 0);
}
@@ -321,7 +313,6 @@ public:
rtl::OLocale aLocale2 = rtl::OLocale::registerLocale(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US")));
sal_Int32 nEqual = rtl_locale_equals(aLocale1.getData(), aLocale2.getData());
- printf("rtl_locale_equals() result: %d\n", nEqual);
CPPUNIT_ASSERT(nEqual != 0);
}