diff options
author | Joachim Lingner <jl@openoffice.org> | 2001-03-12 15:59:01 +0000 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2001-03-12 15:59:01 +0000 |
commit | 17aa5b1d27e9b575bb5958ddd7ab84dd5f6c9144 (patch) | |
tree | 075fac24fdbbf87e0e58c0f091a94e245197b51c /registry/test | |
parent | efbaef0388e7d412c7e97dbed54694f7d3aa098a (diff) |
vos/diagnose.h macros replaced by osl/diagnose.h macros
Diffstat (limited to 'registry/test')
-rw-r--r-- | registry/test/testmerge.cxx | 432 | ||||
-rw-r--r-- | registry/test/testregcpp.cxx | 365 |
2 files changed, 395 insertions, 402 deletions
diff --git a/registry/test/testmerge.cxx b/registry/test/testmerge.cxx index f277535890e0..1410e9206246 100644 --- a/registry/test/testmerge.cxx +++ b/registry/test/testmerge.cxx @@ -2,9 +2,9 @@ * * $RCSfile: testmerge.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 15:18:43 $ + * last change: $Author: jl $ $Date: 2001-03-12 16:59:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,12 +67,8 @@ #include "registry/reflread.hxx" #include "registry/reflwrit.hxx" -#ifndef _VOS_MODULE_HXX -#include <vos/module.hxx> -#endif - -#ifndef _VOS_DIAGNOSE_HXX -#include <vos/diagnose.hxx> +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> #endif #ifndef _RTL_ALLOC_H_ @@ -109,25 +105,25 @@ void test_generateMerge1() RegistryKey rootKey, key1, key2, key3, key4, key5, key6, key7, key8, key9; - VOS_ENSHURE(!myRegistry->create(OUString::createFromAscii("merge1.rdb")), "testGenerateMerge1 error 1"); - VOS_ENSHURE(!myRegistry->openRootKey(rootKey), "testGenerateMerge1 error 2"); - - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("MergeKey1"), key1), "testGenerateMerge1 error 3"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey1"), key2), "testGenerateMerge1 error 4"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey1/KeyWithLongValue"), key3), "testGenerateMerge1 error 5"); - VOS_ENSHURE(!key3.setValue(OUString(), RG_VALUETYPE_LONG, &lValue1, sizeof(sal_Int32)), "testGenerateMerge1 error 5a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey2"), key4), "testGenerateMerge1 error 6"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey2/KeyWithStringValue"), key5), "testGenerateMerge1 error 7"); - VOS_ENSHURE(!key5.setValue(OUString(), RG_VALUETYPE_STRING, sValue, strlen(sValue)+1), "testGenerateMerge1 error 7a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey3"), key6), "testGenerateMerge1 error 8"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), key7), "testGenerateMerge1 error 9"); - VOS_ENSHURE(!key7.setValue(OUString(), RG_VALUETYPE_UNICODE, (void*)wValue.getStr(), ((wValue.getLength()+1)*sizeof(sal_Unicode))), "testGenerateMerge1 error 9a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey4"), key8), "testGenerateMerge1 error 10"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), key9), "testGenerateMerge1 error 11"); - VOS_ENSHURE(!key9.setValue(OUString(), RG_VALUETYPE_BINARY, "abcdefghijklmnopqrstuvwxyz", 27), "testGenerateMerge1 error 11a"); - - - VOS_ENSHURE(!key1.closeKey() && + OSL_ENSURE(!myRegistry->create(OUString::createFromAscii("merge1.rdb")), "testGenerateMerge1 error 1"); + OSL_ENSURE(!myRegistry->openRootKey(rootKey), "testGenerateMerge1 error 2"); + + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("MergeKey1"), key1), "testGenerateMerge1 error 3"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey1"), key2), "testGenerateMerge1 error 4"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey1/KeyWithLongValue"), key3), "testGenerateMerge1 error 5"); + OSL_ENSURE(!key3.setValue(OUString(), RG_VALUETYPE_LONG, &lValue1, sizeof(sal_Int32)), "testGenerateMerge1 error 5a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey2"), key4), "testGenerateMerge1 error 6"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey2/KeyWithStringValue"), key5), "testGenerateMerge1 error 7"); + OSL_ENSURE(!key5.setValue(OUString(), RG_VALUETYPE_STRING, sValue, strlen(sValue)+1), "testGenerateMerge1 error 7a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey3"), key6), "testGenerateMerge1 error 8"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), key7), "testGenerateMerge1 error 9"); + OSL_ENSURE(!key7.setValue(OUString(), RG_VALUETYPE_UNICODE, (void*)wValue.getStr(), ((wValue.getLength()+1)*sizeof(sal_Unicode))), "testGenerateMerge1 error 9a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey4"), key8), "testGenerateMerge1 error 10"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), key9), "testGenerateMerge1 error 11"); + OSL_ENSURE(!key9.setValue(OUString(), RG_VALUETYPE_BINARY, "abcdefghijklmnopqrstuvwxyz", 27), "testGenerateMerge1 error 11a"); + + + OSL_ENSURE(!key1.closeKey() && !key2.closeKey() && !key3.closeKey() && !key4.closeKey() && @@ -137,21 +133,21 @@ void test_generateMerge1() !key8.closeKey() && !key9.closeKey(), "testGenerateMerge1 error 12"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("MergeKey1u2"), key1), "testGenerateMerge1 error 13"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11"), key2), "testGenerateMerge1 error 14"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11/KeyWithLongValue"), key3), "testGenerateMerge1 error 15"); - VOS_ENSHURE(!key3.setValue(OUString(), RG_VALUETYPE_LONG, &lValue2, sizeof(sal_Int32)), "testGenerateMerge1 error 15a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12"), key4), "testGenerateMerge1 error 16"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12/KeyWithStringValue"), key5), "testGenerateMerge1 error 17"); - VOS_ENSHURE(!key5.setValue(OUString(), RG_VALUETYPE_STRING, sValue, strlen(sValue)+1), "testGenerateMerge1 error 17a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13"), key6), "testGenerateMerge1 error 18"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), key7), "testGenerateMerge1 error 19"); - VOS_ENSHURE(!key7.setValue(OUString(), RG_VALUETYPE_UNICODE, (void*)wValue.getStr(), ((wValue.getLength()+1)*sizeof(sal_Unicode))), "testGenerateMerge1 error 19a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2"), key8), "testGenerateMerge1 error 20"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), key9), "testGenerateMerge1 error 21"); - VOS_ENSHURE(!key9.setValue(OUString(), RG_VALUETYPE_LONG, &lValue3, sizeof(sal_Int32)), "testGenerateMerge1 error 21a"); - - VOS_ENSHURE(!rootKey.closeKey() && + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("MergeKey1u2"), key1), "testGenerateMerge1 error 13"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11"), key2), "testGenerateMerge1 error 14"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11/KeyWithLongValue"), key3), "testGenerateMerge1 error 15"); + OSL_ENSURE(!key3.setValue(OUString(), RG_VALUETYPE_LONG, &lValue2, sizeof(sal_Int32)), "testGenerateMerge1 error 15a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12"), key4), "testGenerateMerge1 error 16"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12/KeyWithStringValue"), key5), "testGenerateMerge1 error 17"); + OSL_ENSURE(!key5.setValue(OUString(), RG_VALUETYPE_STRING, sValue, strlen(sValue)+1), "testGenerateMerge1 error 17a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13"), key6), "testGenerateMerge1 error 18"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), key7), "testGenerateMerge1 error 19"); + OSL_ENSURE(!key7.setValue(OUString(), RG_VALUETYPE_UNICODE, (void*)wValue.getStr(), ((wValue.getLength()+1)*sizeof(sal_Unicode))), "testGenerateMerge1 error 19a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2"), key8), "testGenerateMerge1 error 20"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), key9), "testGenerateMerge1 error 21"); + OSL_ENSURE(!key9.setValue(OUString(), RG_VALUETYPE_LONG, &lValue3, sizeof(sal_Int32)), "testGenerateMerge1 error 21a"); + + OSL_ENSURE(!rootKey.closeKey() && !key1.closeKey() && !key2.closeKey() && !key3.closeKey() && @@ -184,24 +180,24 @@ void test_generateMerge2() RegistryKey rootKey, key1, key2, key3, key4, key5, key6, key7, key8, key9; - VOS_ENSHURE(!myRegistry->create(OUString::createFromAscii("merge2.rdb")), "testGenerateMerge2 error 1"); - VOS_ENSHURE(!myRegistry->openRootKey(rootKey), "testGenerateMerge2 error 2"); - - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("MergeKey2"), key1), "testGenerateMerge2 error 3"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey1"), key2), "testGenerateMerge2 error 4"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), key3), "testGenerateMerge2 error 5"); - VOS_ENSHURE(!key3.setValue(OUString(), RG_VALUETYPE_BINARY, "1234567890", 11), "testGenerateMerge1 error 5a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey2"), key4), "testGenerateMerge2 error 6"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), key5), "testGenerateMerge2 error 7"); - VOS_ENSHURE(!key5.setValue(OUString(), RG_VALUETYPE_UNICODE, (void*)wValue.getStr(), ((wValue.getLength()+1)*sizeof(sal_Unicode))), "testGenerateMerge1 error 7a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey3"), key6), "testGenerateMerge2 error 8"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), key7), "testGenerateMerge2 error 9"); - VOS_ENSHURE(!key7.setValue(OUString(), RG_VALUETYPE_STRING, sValue, strlen(sValue)+1), "testGenerateMerge1 error 9a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey4"), key8), "testGenerateMerge2 error 10"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey4/KeyWithLongValue"), key9), "testGenerateMerge2 error 11"); - VOS_ENSHURE(!key9.setValue(OUString(), RG_VALUETYPE_LONG, &lValue1, sizeof(sal_Int32)), "testGenerateMerge1 error 11a"); - - VOS_ENSHURE(!key1.closeKey() && + OSL_ENSURE(!myRegistry->create(OUString::createFromAscii("merge2.rdb")), "testGenerateMerge2 error 1"); + OSL_ENSURE(!myRegistry->openRootKey(rootKey), "testGenerateMerge2 error 2"); + + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("MergeKey2"), key1), "testGenerateMerge2 error 3"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey1"), key2), "testGenerateMerge2 error 4"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), key3), "testGenerateMerge2 error 5"); + OSL_ENSURE(!key3.setValue(OUString(), RG_VALUETYPE_BINARY, "1234567890", 11), "testGenerateMerge1 error 5a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey2"), key4), "testGenerateMerge2 error 6"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), key5), "testGenerateMerge2 error 7"); + OSL_ENSURE(!key5.setValue(OUString(), RG_VALUETYPE_UNICODE, (void*)wValue.getStr(), ((wValue.getLength()+1)*sizeof(sal_Unicode))), "testGenerateMerge1 error 7a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey3"), key6), "testGenerateMerge2 error 8"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), key7), "testGenerateMerge2 error 9"); + OSL_ENSURE(!key7.setValue(OUString(), RG_VALUETYPE_STRING, sValue, strlen(sValue)+1), "testGenerateMerge1 error 9a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey4"), key8), "testGenerateMerge2 error 10"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey2/MK2SubKey4/KeyWithLongValue"), key9), "testGenerateMerge2 error 11"); + OSL_ENSURE(!key9.setValue(OUString(), RG_VALUETYPE_LONG, &lValue1, sizeof(sal_Int32)), "testGenerateMerge1 error 11a"); + + OSL_ENSURE(!key1.closeKey() && !key2.closeKey() && !key3.closeKey() && !key4.closeKey() && @@ -211,21 +207,21 @@ void test_generateMerge2() !key8.closeKey() && !key9.closeKey(), "testGenerateMerge2 error 12"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("MergeKey1u2"), key1), "testGenerateMerge2 error 13"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21"), key2), "testGenerateMerge2 error 14"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), key3), "testGenerateMerge2 error 15"); - VOS_ENSHURE(!key3.setValue(OUString(), RG_VALUETYPE_BINARY, "a1b2c3d4e5f6g7h8i9", 19), "testGenerateMerge1 error 15a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22"), key4), "testGenerateMerge2 error 16"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22/KeyWithLongValue"), key5), "testGenerateMerge2 error 17"); - VOS_ENSHURE(!key5.setValue(OUString(), RG_VALUETYPE_LONG, &lValue2, sizeof(sal_Int32)), "testGenerateMerge1 error 17a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23"), key6), "testGenerateMerge2 error 18"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23/KeyWithStringValue"), key7), "testGenerateMerge2 error 19"); - VOS_ENSHURE(!key7.setValue(OUString(), RG_VALUETYPE_STRING, sValue, strlen(sValue)+1), "testGenerateMerge1 error 19a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2"), key8), "testGenerateMerge2 error 20"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), key9), "testGenerateMerge2 error 21"); - VOS_ENSHURE(!key9.setValue(OUString(), RG_VALUETYPE_LONG, &lValue4, sizeof(sal_Int32)), "testGenerateMerge1 error 21a"); - - VOS_ENSHURE(!rootKey.closeKey() && + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("MergeKey1u2"), key1), "testGenerateMerge2 error 13"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21"), key2), "testGenerateMerge2 error 14"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), key3), "testGenerateMerge2 error 15"); + OSL_ENSURE(!key3.setValue(OUString(), RG_VALUETYPE_BINARY, "a1b2c3d4e5f6g7h8i9", 19), "testGenerateMerge1 error 15a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22"), key4), "testGenerateMerge2 error 16"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22/KeyWithLongValue"), key5), "testGenerateMerge2 error 17"); + OSL_ENSURE(!key5.setValue(OUString(), RG_VALUETYPE_LONG, &lValue2, sizeof(sal_Int32)), "testGenerateMerge1 error 17a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23"), key6), "testGenerateMerge2 error 18"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23/KeyWithStringValue"), key7), "testGenerateMerge2 error 19"); + OSL_ENSURE(!key7.setValue(OUString(), RG_VALUETYPE_STRING, sValue, strlen(sValue)+1), "testGenerateMerge1 error 19a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2"), key8), "testGenerateMerge2 error 20"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), key9), "testGenerateMerge2 error 21"); + OSL_ENSURE(!key9.setValue(OUString(), RG_VALUETYPE_LONG, &lValue4, sizeof(sal_Int32)), "testGenerateMerge1 error 21a"); + + OSL_ENSURE(!rootKey.closeKey() && !key1.closeKey() && !key2.closeKey() && !key3.closeKey() && @@ -258,115 +254,115 @@ void test_merge() RegistryKey rootKey, key1, mkey1, key2, mkey2, key1u2, mkey1u2; - VOS_ENSHURE(!myRegistry->create(OUString::createFromAscii("mergetest.rdb")), "testMerge error 1"); - VOS_ENSHURE(myRegistry->getName().equals(OUString::createFromAscii("mergetest.rdb")), "testMerge error 1.a)"); - VOS_ENSHURE(!myRegistry->openRootKey(rootKey), "testMerge error 2"); - VOS_ENSHURE(!myRegistry->loadKey(rootKey, OUString::createFromAscii("/stardiv/IchbineinMergeKey"), + OSL_ENSURE(!myRegistry->create(OUString::createFromAscii("mergetest.rdb")), "testMerge error 1"); + OSL_ENSURE(myRegistry->getName().equals(OUString::createFromAscii("mergetest.rdb")), "testMerge error 1.a)"); + OSL_ENSURE(!myRegistry->openRootKey(rootKey), "testMerge error 2"); + OSL_ENSURE(!myRegistry->loadKey(rootKey, OUString::createFromAscii("/stardiv/IchbineinMergeKey"), OUString::createFromAscii("merge1.rdb")), "testMerge error 3"); - VOS_ENSHURE(!myRegistry->mergeKey(rootKey, OUString::createFromAscii("/stardiv/IchbineinMergeKey"), + OSL_ENSURE(!myRegistry->mergeKey(rootKey, OUString::createFromAscii("/stardiv/IchbineinMergeKey"), OUString::createFromAscii("merge2.rdb")), "testMerge error 4"); /////////////////////////////////////////////////////////////////////////// - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("/stardiv/IchbineinMergeKey"), key1), "testMerge error 5"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("/stardiv/IchbineinMergeKey"), key1), "testMerge error 5"); - VOS_ENSHURE(!key1.openKey(OUString::createFromAscii("MergeKey1"), mkey1), "testMerge error 6"); - VOS_ENSHURE(!mkey1.closeKey(), "testMerge error 7"); + OSL_ENSURE(!key1.openKey(OUString::createFromAscii("MergeKey1"), mkey1), "testMerge error 6"); + OSL_ENSURE(!mkey1.closeKey(), "testMerge error 7"); - VOS_ENSHURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey1"), mkey1), "testMerge error 8"); - VOS_ENSHURE(!mkey1.closeKey(), "testMerge error 9"); - VOS_ENSHURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey1/KeyWithLongValue"), mkey1), "testMerge error 10"); - VOS_ENSHURE(!mkey1.closeKey(), "testMerge error 11"); + OSL_ENSURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey1"), mkey1), "testMerge error 8"); + OSL_ENSURE(!mkey1.closeKey(), "testMerge error 9"); + OSL_ENSURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey1/KeyWithLongValue"), mkey1), "testMerge error 10"); + OSL_ENSURE(!mkey1.closeKey(), "testMerge error 11"); - VOS_ENSHURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey2"), mkey1), "testMerge error 12"); - VOS_ENSHURE(!mkey1.closeKey(), "testMerge error 13"); - VOS_ENSHURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey2/KeyWithStringValue"), mkey1), "testMerge error 14"); - VOS_ENSHURE(!mkey1.closeKey(), "testMerge error 15"); + OSL_ENSURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey2"), mkey1), "testMerge error 12"); + OSL_ENSURE(!mkey1.closeKey(), "testMerge error 13"); + OSL_ENSURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey2/KeyWithStringValue"), mkey1), "testMerge error 14"); + OSL_ENSURE(!mkey1.closeKey(), "testMerge error 15"); - VOS_ENSHURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey3"), mkey1), "testMerge error 16"); - VOS_ENSHURE(!mkey1.closeKey(), "testMerge error 17"); - VOS_ENSHURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), mkey1), "testMerge error 18"); - VOS_ENSHURE(!mkey1.closeKey(), "testMerge error 19"); + OSL_ENSURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey3"), mkey1), "testMerge error 16"); + OSL_ENSURE(!mkey1.closeKey(), "testMerge error 17"); + OSL_ENSURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), mkey1), "testMerge error 18"); + OSL_ENSURE(!mkey1.closeKey(), "testMerge error 19"); - VOS_ENSHURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey4"), mkey1), "testMerge error 20"); - VOS_ENSHURE(!mkey1.closeKey(), "testMerge error 21"); - VOS_ENSHURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), mkey1), "testMerge error 22"); - VOS_ENSHURE(!mkey1.closeKey(), "testMerge error 23"); + OSL_ENSURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey4"), mkey1), "testMerge error 20"); + OSL_ENSURE(!mkey1.closeKey(), "testMerge error 21"); + OSL_ENSURE(!key1.openKey(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), mkey1), "testMerge error 22"); + OSL_ENSURE(!mkey1.closeKey(), "testMerge error 23"); - VOS_ENSHURE(!key1.closeKey(), "testMerge error 24"); + OSL_ENSURE(!key1.closeKey(), "testMerge error 24"); /////////////////////////////////////////////////////////////////////////// - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("/stardiv/IchbineinMergeKey"), key2), "testMerge error 25"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("/stardiv/IchbineinMergeKey"), key2), "testMerge error 25"); - VOS_ENSHURE(!key2.openKey(OUString::createFromAscii("MergeKey2"), mkey2), "testMerge error 26"); - VOS_ENSHURE(!mkey2.closeKey(), "testMerge error 27"); + OSL_ENSURE(!key2.openKey(OUString::createFromAscii("MergeKey2"), mkey2), "testMerge error 26"); + OSL_ENSURE(!mkey2.closeKey(), "testMerge error 27"); - VOS_ENSHURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey1"), mkey2), "testMerge error 28"); - VOS_ENSHURE(!mkey2.closeKey(), "testMerge error 29"); - VOS_ENSHURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), mkey2), "testMerge error 30"); - VOS_ENSHURE(!mkey2.closeKey(), "testMerge error 31"); + OSL_ENSURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey1"), mkey2), "testMerge error 28"); + OSL_ENSURE(!mkey2.closeKey(), "testMerge error 29"); + OSL_ENSURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), mkey2), "testMerge error 30"); + OSL_ENSURE(!mkey2.closeKey(), "testMerge error 31"); - VOS_ENSHURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey2"), mkey2), "testMerge error 31"); - VOS_ENSHURE(!mkey2.closeKey(), "testMerge error 33"); - VOS_ENSHURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), mkey2), "testMerge error 34"); - VOS_ENSHURE(!mkey2.closeKey(), "testMerge error 35"); + OSL_ENSURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey2"), mkey2), "testMerge error 31"); + OSL_ENSURE(!mkey2.closeKey(), "testMerge error 33"); + OSL_ENSURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), mkey2), "testMerge error 34"); + OSL_ENSURE(!mkey2.closeKey(), "testMerge error 35"); - VOS_ENSHURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey3"), mkey2), "testMerge error 36"); - VOS_ENSHURE(!mkey2.closeKey(), "testMerge error 37"); - VOS_ENSHURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), mkey2), "testMerge error 38"); - VOS_ENSHURE(!mkey2.closeKey(), "testMerge error 39"); + OSL_ENSURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey3"), mkey2), "testMerge error 36"); + OSL_ENSURE(!mkey2.closeKey(), "testMerge error 37"); + OSL_ENSURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), mkey2), "testMerge error 38"); + OSL_ENSURE(!mkey2.closeKey(), "testMerge error 39"); - VOS_ENSHURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey4"), mkey2), "testMerge error 40"); - VOS_ENSHURE(!mkey2.closeKey(), "testMerge error 41"); - VOS_ENSHURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey4/KeyWithLongValue"), mkey2), "testMerge error 42"); - VOS_ENSHURE(!mkey2.closeKey(), "testMerge error 43"); + OSL_ENSURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey4"), mkey2), "testMerge error 40"); + OSL_ENSURE(!mkey2.closeKey(), "testMerge error 41"); + OSL_ENSURE(!key2.openKey(OUString::createFromAscii("/MergeKey2/MK2SubKey4/KeyWithLongValue"), mkey2), "testMerge error 42"); + OSL_ENSURE(!mkey2.closeKey(), "testMerge error 43"); - VOS_ENSHURE(!key2.closeKey(), "testMerge error 44"); + OSL_ENSURE(!key2.closeKey(), "testMerge error 44"); /////////////////////////////////////////////////////////////////////////// - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("/stardiv/IchbineinMergeKey"), key1u2), "testMerge error 40"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("/stardiv/IchbineinMergeKey"), key1u2), "testMerge error 40"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("MergeKey1u2"), mkey1u2), "testMerge error 41"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 42"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("MergeKey1u2"), mkey1u2), "testMerge error 41"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 42"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11"), mkey1u2), "testMerge error 43"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 44"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11/KeyWithLongValue"), mkey1u2), "testMerge error 45"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 46"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11"), mkey1u2), "testMerge error 43"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 44"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11/KeyWithLongValue"), mkey1u2), "testMerge error 45"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 46"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12"), mkey1u2), "testMerge error 47"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 48"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12/KeyWithStringValue"), mkey1u2), "testMerge error 49"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 50"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12"), mkey1u2), "testMerge error 47"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 48"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12/KeyWithStringValue"), mkey1u2), "testMerge error 49"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 50"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13"), mkey1u2), "testMerge error 51"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 52"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), mkey1u2), "testMerge error 53"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 54"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13"), mkey1u2), "testMerge error 51"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 52"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), mkey1u2), "testMerge error 53"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 54"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21"), mkey1u2), "testMerge error 55"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 56"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), mkey1u2), "testMerge error 57"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 58"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21"), mkey1u2), "testMerge error 55"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 56"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), mkey1u2), "testMerge error 57"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 58"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22"), mkey1u2), "testMerge error 59"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 60"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22/KeyWithLongValue"), mkey1u2), "testMerge error 61"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 62"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22"), mkey1u2), "testMerge error 59"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 60"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22/KeyWithLongValue"), mkey1u2), "testMerge error 61"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 62"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23"), mkey1u2), "testMerge error 63"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 64"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23/KeyWithStringValue"), mkey1u2), "testMerge error 65"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 66"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23"), mkey1u2), "testMerge error 63"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 64"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23/KeyWithStringValue"), mkey1u2), "testMerge error 65"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 66"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2"), mkey1u2), "testMerge error 67"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 68"); - VOS_ENSHURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), mkey1u2), "testMerge error 69"); - VOS_ENSHURE(!mkey1u2.closeKey(), "testMerge error 70"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2"), mkey1u2), "testMerge error 67"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 68"); + OSL_ENSURE(!key1u2.openKey(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), mkey1u2), "testMerge error 69"); + OSL_ENSURE(!mkey1u2.closeKey(), "testMerge error 70"); - VOS_ENSHURE(!key1u2.closeKey(), "testMerge error 71"); + OSL_ENSURE(!key1u2.closeKey(), "testMerge error 71"); /////////////////////////////////////////////////////////////////////////// @@ -375,113 +371,113 @@ void test_merge() sal_Int32 int32Value; sal_uInt8 *Value; - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("/stardiv/IchbineinMergeKey"), key1), "testMerge error 72"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("/stardiv/IchbineinMergeKey"), key1), "testMerge error 72"); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey1/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 73"); - VOS_ENSHURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 74"); - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey1/KeyWithLongValue"), (RegValue)&int32Value), "testMerge error 74.a)"); - VOS_ENSHURE(int32Value == lValue1, "testMerge error 74.b)"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey1/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 73"); + OSL_ENSURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 74"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey1/KeyWithLongValue"), (RegValue)&int32Value), "testMerge error 74.a)"); + OSL_ENSURE(int32Value == lValue1, "testMerge error 74.b)"); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey2/KeyWithStringValue"), &valueType, &valueSize), "testMerge error 75"); - VOS_ENSHURE(valueType == RG_VALUETYPE_STRING && valueSize == strlen(sValue)+1, "testMerge error 76"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey2/KeyWithStringValue"), &valueType, &valueSize), "testMerge error 75"); + OSL_ENSURE(valueType == RG_VALUETYPE_STRING && valueSize == strlen(sValue)+1, "testMerge error 76"); Value = new sal_uInt8[valueSize]; - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey2/KeyWithStringValue"), (RegValue)Value), "testMerge error 76.a)"); - VOS_ENSHURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 76.b)"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey2/KeyWithStringValue"), (RegValue)Value), "testMerge error 76.a)"); + OSL_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 76.b)"); delete(Value); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 77"); - VOS_ENSHURE(valueType == RG_VALUETYPE_UNICODE && valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 78"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 77"); + OSL_ENSURE(valueType == RG_VALUETYPE_UNICODE && valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 78"); Value = new sal_uInt8[valueSize]; - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 78.a)"); - VOS_ENSHURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 78.b)"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 78.a)"); + OSL_ENSURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 78.b)"); delete(Value); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 79"); - VOS_ENSHURE(valueType == RG_VALUETYPE_BINARY && valueSize == 27, "testMerge error 80"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 79"); + OSL_ENSURE(valueType == RG_VALUETYPE_BINARY && valueSize == 27, "testMerge error 80"); Value = new sal_uInt8[valueSize]; - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 80.a)"); - VOS_ENSHURE(strcmp((const sal_Char*)Value, "abcdefghijklmnopqrstuvwxyz") == 0, "testMerge error 80.b)"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 80.a)"); + OSL_ENSURE(strcmp((const sal_Char*)Value, "abcdefghijklmnopqrstuvwxyz") == 0, "testMerge error 80.b)"); delete(Value); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 81"); - VOS_ENSHURE(valueType == RG_VALUETYPE_BINARY && valueSize == 11, "testMerge error 82"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 81"); + OSL_ENSURE(valueType == RG_VALUETYPE_BINARY && valueSize == 11, "testMerge error 82"); Value = new sal_uInt8[valueSize]; - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 82.a)"); - VOS_ENSHURE(strcmp((const sal_Char*)Value, "1234567890") == 0, "testMerge error 82.b)"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 82.a)"); + OSL_ENSURE(strcmp((const sal_Char*)Value, "1234567890") == 0, "testMerge error 82.b)"); delete(Value); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 83"); - VOS_ENSHURE(valueType == RG_VALUETYPE_UNICODE&& valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 84"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 83"); + OSL_ENSURE(valueType == RG_VALUETYPE_UNICODE&& valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 84"); Value = new sal_uInt8[valueSize]; - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 84.a)"); - VOS_ENSHURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 84.b)"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 84.a)"); + OSL_ENSURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 84.b)"); delete(Value); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), &valueType, &valueSize), "testMerge error 85"); - VOS_ENSHURE(valueType == RG_VALUETYPE_STRING && valueSize == strlen(sValue)+1, "testMerge error 86"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), &valueType, &valueSize), "testMerge error 85"); + OSL_ENSURE(valueType == RG_VALUETYPE_STRING && valueSize == strlen(sValue)+1, "testMerge error 86"); Value = new sal_uInt8[valueSize]; - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), (RegValue)Value), "testMerge error 86.a)"); - VOS_ENSHURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 86.b)"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), (RegValue)Value), "testMerge error 86.a)"); + OSL_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 86.b)"); delete(Value); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey4/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 87"); - VOS_ENSHURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 88"); - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey4/KeyWithLongValue"), (RegValue)&int32Value), "testMerge error 88.a)"); - VOS_ENSHURE(int32Value == lValue1, "testMerge error 88.b)"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey4/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 87"); + OSL_ENSURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 88"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey4/KeyWithLongValue"), (RegValue)&int32Value), "testMerge error 88.a)"); + OSL_ENSURE(int32Value == lValue1, "testMerge error 88.b)"); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 89"); - VOS_ENSHURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 90"); - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11/KeyWithLongValue"), (RegValue)&int32Value), "testMerge error 90.a)"); - VOS_ENSHURE(int32Value == lValue2, "testMerge error 90.b)"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 89"); + OSL_ENSURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 90"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK1SubKey11/KeyWithLongValue"), (RegValue)&int32Value), "testMerge error 90.a)"); + OSL_ENSURE(int32Value == lValue2, "testMerge error 90.b)"); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12/KeyWithStringValue"), &valueType, &valueSize), "testMerge error 91"); - VOS_ENSHURE(valueType == RG_VALUETYPE_STRING && valueSize == strlen(sValue)+1, "testMerge error 92"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12/KeyWithStringValue"), &valueType, &valueSize), "testMerge error 91"); + OSL_ENSURE(valueType == RG_VALUETYPE_STRING && valueSize == strlen(sValue)+1, "testMerge error 92"); Value = new sal_uInt8[valueSize]; - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12/KeyWithStringValue"), (RegValue)Value), "testMerge error 92.a)"); - VOS_ENSHURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 92.b)"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12/KeyWithStringValue"), (RegValue)Value), "testMerge error 92.a)"); + OSL_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 92.b)"); delete(Value); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 93"); - VOS_ENSHURE(valueType == RG_VALUETYPE_UNICODE && valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 94"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 93"); + OSL_ENSURE(valueType == RG_VALUETYPE_UNICODE && valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 94"); Value = new sal_uInt8[valueSize]; - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 94.a)"); - VOS_ENSHURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 94.b)"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 94.a)"); + OSL_ENSURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 94.b)"); delete(Value); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 95"); - VOS_ENSHURE(valueType == RG_VALUETYPE_BINARY && valueSize == 19, "testMerge error 96"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 95"); + OSL_ENSURE(valueType == RG_VALUETYPE_BINARY && valueSize == 19, "testMerge error 96"); Value = new sal_uInt8[valueSize]; - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 96.a)"); - VOS_ENSHURE(strcmp((const sal_Char*)Value, "a1b2c3d4e5f6g7h8i9") == 0, "testMerge error 96.b)"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 96.a)"); + OSL_ENSURE(strcmp((const sal_Char*)Value, "a1b2c3d4e5f6g7h8i9") == 0, "testMerge error 96.b)"); delete(Value); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 97"); - VOS_ENSHURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 98"); - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22/KeyWithLongValue"), (RegValue)&int32Value), "testMerge error 98.a)"); - VOS_ENSHURE(int32Value == lValue2, "testMerge error 98.b)"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 97"); + OSL_ENSURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 98"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22/KeyWithLongValue"), (RegValue)&int32Value), "testMerge error 98.a)"); + OSL_ENSURE(int32Value == lValue2, "testMerge error 98.b)"); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23/KeyWithStringValue"), &valueType, &valueSize), "testMerge error 99"); - VOS_ENSHURE(valueType == RG_VALUETYPE_STRING && valueSize == strlen(sValue)+1, "testMerge error 100"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23/KeyWithStringValue"), &valueType, &valueSize), "testMerge error 99"); + OSL_ENSURE(valueType == RG_VALUETYPE_STRING && valueSize == strlen(sValue)+1, "testMerge error 100"); Value = new sal_uInt8[valueSize]; - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23/KeyWithStringValue"), (RegValue)Value), "testMerge error 100.a)"); - VOS_ENSHURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 100.b)"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23/KeyWithStringValue"), (RegValue)Value), "testMerge error 100.a)"); + OSL_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 100.b)"); delete(Value); - VOS_ENSHURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 101"); - VOS_ENSHURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 102"); - VOS_ENSHURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), (RegValue)&int32Value), "testMerge error 102.a)"); - VOS_ENSHURE(int32Value == lValue4, "testMerge error 102.b)"); + OSL_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 101"); + OSL_ENSURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 102"); + OSL_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), (RegValue)&int32Value), "testMerge error 102.a)"); + OSL_ENSURE(int32Value == lValue4, "testMerge error 102.b)"); - VOS_ENSHURE(!key1.closeKey(), "testMerge error 24"); + OSL_ENSURE(!key1.closeKey(), "testMerge error 24"); /////////////////////////////////////////////////////////////////////////// - VOS_ENSHURE(!rootKey.closeKey(), "testMerge error 10"); + OSL_ENSURE(!rootKey.closeKey(), "testMerge error 10"); - VOS_ENSHURE(!myRegistry->destroy( OUString::createFromAscii("merge1.rdb") ), "test_registry_CppApi error 11"); - VOS_ENSHURE(!myRegistry->destroy( OUString::createFromAscii("merge2.rdb") ), "test_registry_CppApi error 12"); - VOS_ENSHURE(!myRegistry->destroy( OUString() ), "test_registry_CppApi error 13"); + OSL_ENSURE(!myRegistry->destroy( OUString::createFromAscii("merge1.rdb") ), "test_registry_CppApi error 11"); + OSL_ENSURE(!myRegistry->destroy( OUString::createFromAscii("merge2.rdb") ), "test_registry_CppApi error 12"); + OSL_ENSURE(!myRegistry->destroy( OUString() ), "test_registry_CppApi error 13"); delete(myRegistry); diff --git a/registry/test/testregcpp.cxx b/registry/test/testregcpp.cxx index dd77fdfc464a..0a92d8e54e81 100644 --- a/registry/test/testregcpp.cxx +++ b/registry/test/testregcpp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: testregcpp.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: jsc $ $Date: 2000-10-12 08:14:28 $ + * last change: $Author: jl $ $Date: 2001-03-12 16:59:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,12 +68,9 @@ #include "registry/reflwrit.hxx" -#ifndef _VOS_MODULE_HXX -#include <vos/module.hxx> -#endif -#ifndef _VOS_DIAGNOSE_HXX -#include <vos/diagnose.hxx> +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> #endif #ifndef _RTL_ALLOC_H_ @@ -117,17 +114,17 @@ void test_coreReflection() RegistryKey rootKey, key1, key2, key3, key4 ,key5, key6, key7, key8; - VOS_ENSHURE(!myRegistry->create(OUString::createFromAscii("ucrtest.rdb")), "testCoreReflection error 1"); - VOS_ENSHURE(!myRegistry->openRootKey(rootKey), "testCoreReflection error 2"); + OSL_ENSURE(!myRegistry->create(OUString::createFromAscii("ucrtest.rdb")), "testCoreReflection error 1"); + OSL_ENSURE(!myRegistry->openRootKey(rootKey), "testCoreReflection error 2"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("UCR"), key1), "testCoreReflection error 3"); - VOS_ENSHURE(!key1.createKey(OUString::createFromAscii("ModuleA"), key2), "testCoreReflection error 4"); - VOS_ENSHURE(!key2.createKey(OUString::createFromAscii("StructA"), key3), "testCoreReflection error 5"); - VOS_ENSHURE(!key2.createKey(OUString::createFromAscii("EnumA"), key4), "testCoreReflection error 6"); - VOS_ENSHURE(!key2.createKey(OUString::createFromAscii("XInterfaceA"), key5), "testCoreReflection error 7"); - VOS_ENSHURE(!key2.createKey(OUString::createFromAscii("ExceptionA"), key6), "testCoreReflection error 8"); - VOS_ENSHURE(!key2.createKey(OUString::createFromAscii("ServiceA"), key7), "testCoreReflection error 8a"); - VOS_ENSHURE(!key2.createKey(OUString::createFromAscii("ConstantsA"), key8), "testCoreReflection error 8b"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("UCR"), key1), "testCoreReflection error 3"); + OSL_ENSURE(!key1.createKey(OUString::createFromAscii("ModuleA"), key2), "testCoreReflection error 4"); + OSL_ENSURE(!key2.createKey(OUString::createFromAscii("StructA"), key3), "testCoreReflection error 5"); + OSL_ENSURE(!key2.createKey(OUString::createFromAscii("EnumA"), key4), "testCoreReflection error 6"); + OSL_ENSURE(!key2.createKey(OUString::createFromAscii("XInterfaceA"), key5), "testCoreReflection error 7"); + OSL_ENSURE(!key2.createKey(OUString::createFromAscii("ExceptionA"), key6), "testCoreReflection error 8"); + OSL_ENSURE(!key2.createKey(OUString::createFromAscii("ServiceA"), key7), "testCoreReflection error 8a"); + OSL_ENSURE(!key2.createKey(OUString::createFromAscii("ConstantsA"), key8), "testCoreReflection error 8b"); { RegistryTypeWriter writer(*pWriterLoader, @@ -199,20 +196,20 @@ void test_coreReflection() const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); - VOS_ENSHURE(!key2.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9"); + OSL_ENSURE(!key2.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9"); sal_uInt8* readBlop = (sal_uInt8*)rtl_allocateMemory(aBlopSize); - VOS_ENSHURE(!key2.getValue(OUString(), (void*)readBlop) , "testCoreReflection error 9a"); + OSL_ENSURE(!key2.getValue(OUString(), (void*)readBlop) , "testCoreReflection error 9a"); RegistryTypeReader reader(*pReaderLoader, readBlop, aBlopSize, sal_True); if (reader.isValid()) { - VOS_ENSHURE(reader.getTypeName().equals(OUString::createFromAscii("ModuleA")), "testCoreReflection error 9a2"); + OSL_ENSURE(reader.getTypeName().equals(OUString::createFromAscii("ModuleA")), "testCoreReflection error 9a2"); RTConstValue aReadConst = reader.getFieldConstValue(8); OString aConstStr = OUStringToOString(aConst.m_value.aString, RTL_TEXTENCODING_ASCII_US); - VOS_ENSHURE(aConstStr.equals("dies ist ein unicode string"), "testCoreReflection error 9b"); + OSL_ENSURE(aConstStr.equals("dies ist ein unicode string"), "testCoreReflection error 9b"); } } @@ -239,7 +236,7 @@ void test_coreReflection() const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); - VOS_ENSHURE(!key3.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9a"); + OSL_ENSURE(!key3.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9a"); } { @@ -267,7 +264,7 @@ void test_coreReflection() const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); - VOS_ENSHURE(!key4.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9b"); + OSL_ENSURE(!key4.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9b"); } { @@ -309,24 +306,24 @@ void test_coreReflection() const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); - VOS_ENSHURE(!key5.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9c"); + OSL_ENSURE(!key5.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9c"); sal_uInt8* readBlop = (sal_uInt8*)rtl_allocateMemory(aBlopSize); - VOS_ENSHURE(!key5.getValue(OUString(), (void*)readBlop) , "testCoreReflection error 9c1"); + OSL_ENSURE(!key5.getValue(OUString(), (void*)readBlop) , "testCoreReflection error 9c1"); RegistryTypeReader reader(*pReaderLoader, readBlop, aBlopSize, sal_True); if (reader.isValid()) { - VOS_ENSHURE(reader.getTypeName().equals(OUString::createFromAscii("ModuleA/XInterfaceA")), "testCoreReflection error 9c2"); + OSL_ENSURE(reader.getTypeName().equals(OUString::createFromAscii("ModuleA/XInterfaceA")), "testCoreReflection error 9c2"); RTUik retUik; reader.getUik(retUik); - VOS_ENSHURE(retUik.m_Data1 = 1, "testCoreReflection error 9c3"); - VOS_ENSHURE(retUik.m_Data2 = 2, "testCoreReflection error 9c4"); - VOS_ENSHURE(retUik.m_Data3 = 3, "testCoreReflection error 9c5"); - VOS_ENSHURE(retUik.m_Data4 = 4, "testCoreReflection error 9c6"); - VOS_ENSHURE(retUik.m_Data5 = 5, "testCoreReflection error 9c7"); + OSL_ENSURE(retUik.m_Data1 = 1, "testCoreReflection error 9c3"); + OSL_ENSURE(retUik.m_Data2 = 2, "testCoreReflection error 9c4"); + OSL_ENSURE(retUik.m_Data3 = 3, "testCoreReflection error 9c5"); + OSL_ENSURE(retUik.m_Data4 = 4, "testCoreReflection error 9c6"); + OSL_ENSURE(retUik.m_Data5 = 5, "testCoreReflection error 9c7"); } } @@ -347,7 +344,7 @@ void test_coreReflection() const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); - VOS_ENSHURE(!key6.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9d"); + OSL_ENSURE(!key6.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9d"); } { @@ -377,21 +374,21 @@ void test_coreReflection() const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); - VOS_ENSHURE(!key7.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9e"); + OSL_ENSURE(!key7.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9e"); sal_uInt8* readBlop = (sal_uInt8*)rtl_allocateMemory(aBlopSize); - VOS_ENSHURE(!key7.getValue(OUString(), (void*)readBlop) , "testCoreReflection error 9e2"); + OSL_ENSURE(!key7.getValue(OUString(), (void*)readBlop) , "testCoreReflection error 9e2"); RegistryTypeReader reader(*pReaderLoader, readBlop, aBlopSize, sal_True); if (reader.isValid()) { - VOS_ENSHURE(reader.getTypeName().equals(OUString::createFromAscii("ModuleA/ServiceA")), "testCoreReflection error 9e3"); + OSL_ENSURE(reader.getTypeName().equals(OUString::createFromAscii("ModuleA/ServiceA")), "testCoreReflection error 9e3"); sal_uInt32 referenceCount = reader.getReferenceCount(); - VOS_ENSHURE( referenceCount == 4, "testCoreReflection error 9e4"); + OSL_ENSURE( referenceCount == 4, "testCoreReflection error 9e4"); OUString refName = reader.getReferenceName(0); - VOS_ENSHURE(refName.equals(OUString::createFromAscii("ModuleA/XInterfaceA")), "testCoreReflection error 9e5"); + OSL_ENSURE(refName.equals(OUString::createFromAscii("ModuleA/XInterfaceA")), "testCoreReflection error 9e5"); } } @@ -428,12 +425,12 @@ void test_coreReflection() const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); - VOS_ENSHURE(!key8.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9f"); + OSL_ENSURE(!key8.setValue(OUString(), RG_VALUETYPE_BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9f"); } delete pWriterLoader; -// VOS_ENSHURE(!myRegistry->destroy(NULL), "testCoreReflection error 10"); +// OSL_ENSURE(!myRegistry->destroy(NULL), "testCoreReflection error 10"); delete myRegistry; cout << "test_coreReflection() Ok!\n"; @@ -454,134 +451,134 @@ void test_registry_CppApi() RegistryKey rootKey, key1, key2, key3, key4 ,key5, key6, key7, key8, key9; - VOS_ENSHURE(!myRegistry->create(OUString::createFromAscii("test.rdb")), "test_registry_CppApi error 1"); - VOS_ENSHURE(!myRegistry->openRootKey(rootKey), "test_registry_CppApi error 2"); + OSL_ENSURE(!myRegistry->create(OUString::createFromAscii("test.rdb")), "test_registry_CppApi error 1"); + OSL_ENSURE(!myRegistry->openRootKey(rootKey), "test_registry_CppApi error 2"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("myFirstKey"), key1), "test_registry_CppApi error 3"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("mySecondKey"), key2), "test_registry_CppApi error 4"); - VOS_ENSHURE(!key1.createKey(OUString::createFromAscii("X"), key3), "test_registry_CppApi error 5"); - VOS_ENSHURE(!key1.createKey(OUString::createFromAscii("mySecondSubKey"), key4), "test_registry_CppApi error 6"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("myThirdKey"), key5), "test_registry_CppApi error 6a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("myFirstKey"), key1), "test_registry_CppApi error 3"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("mySecondKey"), key2), "test_registry_CppApi error 4"); + OSL_ENSURE(!key1.createKey(OUString::createFromAscii("X"), key3), "test_registry_CppApi error 5"); + OSL_ENSURE(!key1.createKey(OUString::createFromAscii("mySecondSubKey"), key4), "test_registry_CppApi error 6"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("myThirdKey"), key5), "test_registry_CppApi error 6a"); - VOS_ENSHURE(!key5.createKey(OUString::createFromAscii("1"), key4), "test_registry_CppApi error 6b"); - VOS_ENSHURE(!key4.createKey(OUString::createFromAscii("2"), key3), "test_registry_CppApi error 6c"); - VOS_ENSHURE(!key5.openKey(OUString::createFromAscii("1"), key4), "test_registry_CppApi error 6d"); - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("/myThirdKey/1"), key4), "test_registry_CppApi error 6e"); - VOS_ENSHURE(key4.getName().equals(OUString::createFromAscii("/myThirdKey/1")), "test_registry_CppApi error 6f"); + OSL_ENSURE(!key5.createKey(OUString::createFromAscii("1"), key4), "test_registry_CppApi error 6b"); + OSL_ENSURE(!key4.createKey(OUString::createFromAscii("2"), key3), "test_registry_CppApi error 6c"); + OSL_ENSURE(!key5.openKey(OUString::createFromAscii("1"), key4), "test_registry_CppApi error 6d"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("/myThirdKey/1"), key4), "test_registry_CppApi error 6e"); + OSL_ENSURE(key4.getName().equals(OUString::createFromAscii("/myThirdKey/1")), "test_registry_CppApi error 6f"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("myFourthKey"), key6), "test_registry_CppApi error 7"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("myFifthKey"), key6), "test_registry_CppApi error 7a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("mySixthKey"), key6), "test_registry_CppApi error 7b"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("myFourthKey"), key6), "test_registry_CppApi error 7"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("myFifthKey"), key6), "test_registry_CppApi error 7a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("mySixthKey"), key6), "test_registry_CppApi error 7b"); // Link Test // - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/myFourthKey/X"), key7), "test_registry_CppApi error 7c)");; - VOS_ENSHURE(!key6.createLink(OUString::createFromAscii("myFirstLink"), OUString::createFromAscii("/myFourthKey/X")), "test_registry_CppApi error 7d"); - VOS_ENSHURE(!key6.createKey(OUString::createFromAscii("mySixthSubKey"), key7), "test_registry_CppApi error 7e"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/myFourthKey/X"), key7), "test_registry_CppApi error 7c)");; + OSL_ENSURE(!key6.createLink(OUString::createFromAscii("myFirstLink"), OUString::createFromAscii("/myFourthKey/X")), "test_registry_CppApi error 7d"); + OSL_ENSURE(!key6.createKey(OUString::createFromAscii("mySixthSubKey"), key7), "test_registry_CppApi error 7e"); OUString linkTarget; - VOS_ENSHURE(!key6.getLinkTarget(OUString::createFromAscii("myFirstLink"), linkTarget), "test_registry_CppApi error 7f"); - VOS_ENSHURE(linkTarget.equals(OUString::createFromAscii("/myFourthKey/X")), "test_registry_CppApi error 7g"); + OSL_ENSURE(!key6.getLinkTarget(OUString::createFromAscii("myFirstLink"), linkTarget), "test_registry_CppApi error 7f"); + OSL_ENSURE(linkTarget.equals(OUString::createFromAscii("/myFourthKey/X")), "test_registry_CppApi error 7g"); RegistryKeyNames* pSubKeyNames = new RegistryKeyNames(); sal_uInt32 nSubKeys=0; - VOS_ENSHURE(!rootKey.getKeyNames(OUString::createFromAscii("mySixthKey"), *pSubKeyNames), "test_registry_CppApi error 7h)"); - VOS_ENSHURE(pSubKeyNames->getLength() == 2, "test_registry_CppApi error 7i)"); + OSL_ENSURE(!rootKey.getKeyNames(OUString::createFromAscii("mySixthKey"), *pSubKeyNames), "test_registry_CppApi error 7h)"); + OSL_ENSURE(pSubKeyNames->getLength() == 2, "test_registry_CppApi error 7i)"); for (sal_uInt32 i=0; i < pSubKeyNames->getLength(); i++) { if (pSubKeyNames->getElement(i).equals(OUString::createFromAscii("/mySixthKey/myFirstLink"))) { RegKeyType keyType; - VOS_ENSHURE(!rootKey.getKeyType(pSubKeyNames->getElement(i), &keyType), "test_registry_CppApi error 7j"); - VOS_ENSHURE(keyType == RG_LINKTYPE, "test_registry_CppApi error 7k"); + OSL_ENSURE(!rootKey.getKeyType(pSubKeyNames->getElement(i), &keyType), "test_registry_CppApi error 7j"); + OSL_ENSURE(keyType == RG_LINKTYPE, "test_registry_CppApi error 7k"); } } - VOS_ENSHURE(!key7.closeKey(), "test_registry_CppApi error 7k1"); + OSL_ENSURE(!key7.closeKey(), "test_registry_CppApi error 7k1"); delete pSubKeyNames; - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("/mySixthKey/myFirstLink"), key6), "test_registry_CppApi error 7l"); - VOS_ENSHURE(key6.getName().equals(OUString::createFromAscii("/myFourthKey/X")), "test_registry_CppApi error 7m"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("/mySixthKey/myFirstLink"), key6), "test_registry_CppApi error 7l"); + OSL_ENSURE(key6.getName().equals(OUString::createFromAscii("/myFourthKey/X")), "test_registry_CppApi error 7m"); - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("myFifthKey"), key6), "test_registry_CppApi error 7m1"); - VOS_ENSHURE(!key6.createLink(OUString::createFromAscii("mySecondLink"), + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("myFifthKey"), key6), "test_registry_CppApi error 7m1"); + OSL_ENSURE(!key6.createLink(OUString::createFromAscii("mySecondLink"), OUString::createFromAscii("/mySixthKey/myFirstLink")), "test_registry_CppApi error 7m2"); - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("/myFifthKey/mySecondLink"), key6), "test_registry_CppApi error 7m3"); - VOS_ENSHURE(key6.getName().equals(OUString::createFromAscii("/myFourthKey/X")), "test_registry_CppApi error 7m4"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("/myFifthKey/mySecondLink"), key6), "test_registry_CppApi error 7m3"); + OSL_ENSURE(key6.getName().equals(OUString::createFromAscii("/myFourthKey/X")), "test_registry_CppApi error 7m4"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/myFifthKey/mySecondLink/myFirstLinkSubKey"), key7), "test_registry_CppApi error 7m5"); - VOS_ENSHURE(key7.getName().equals(OUString::createFromAscii("/myFourthKey/X/myFirstLinkSubKey")), "test_registry_CppApi error 7m6"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/myFifthKey/mySecondLink/myFirstLinkSubKey"), key7), "test_registry_CppApi error 7m5"); + OSL_ENSURE(key7.getName().equals(OUString::createFromAscii("/myFourthKey/X/myFirstLinkSubKey")), "test_registry_CppApi error 7m6"); - VOS_ENSHURE(!key7.createLink(OUString::createFromAscii("myThirdLink"), OUString::createFromAscii("/myFifthKey/mySecondLink")), "test_registry_CppApi error 7m7"); - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("/myFourthKey/X/myFirstLinkSubKey/myThirdLink"), key7), "test_registry_CppApi error 7m8"); - VOS_ENSHURE(!key7.openKey(OUString::createFromAscii("/myFirstLinkSubKey/myThirdLink/myFirstLinkSubKey/myThirdLink"), key6), "test_registry_CppApi error 7m9"); - VOS_ENSHURE(key7.getName().equals(OUString::createFromAscii("/myFourthKey/X")), "test_registry_CppApi error 7m10"); - VOS_ENSHURE(!key7.closeKey(), "test_registry_CppApi error 7m11"); + OSL_ENSURE(!key7.createLink(OUString::createFromAscii("myThirdLink"), OUString::createFromAscii("/myFifthKey/mySecondLink")), "test_registry_CppApi error 7m7"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("/myFourthKey/X/myFirstLinkSubKey/myThirdLink"), key7), "test_registry_CppApi error 7m8"); + OSL_ENSURE(!key7.openKey(OUString::createFromAscii("/myFirstLinkSubKey/myThirdLink/myFirstLinkSubKey/myThirdLink"), key6), "test_registry_CppApi error 7m9"); + OSL_ENSURE(key7.getName().equals(OUString::createFromAscii("/myFourthKey/X")), "test_registry_CppApi error 7m10"); + OSL_ENSURE(!key7.closeKey(), "test_registry_CppApi error 7m11"); - VOS_ENSHURE(!rootKey.deleteLink(OUString::createFromAscii("/myFifthKey/mySecondLink")), "test_registry_CppApi error 7m12"); + OSL_ENSURE(!rootKey.deleteLink(OUString::createFromAscii("/myFifthKey/mySecondLink")), "test_registry_CppApi error 7m12"); - VOS_ENSHURE(!rootKey.createLink(OUString::createFromAscii("/myFifthKey/mySecondLink"), + OSL_ENSURE(!rootKey.createLink(OUString::createFromAscii("/myFifthKey/mySecondLink"), OUString::createFromAscii("/myFourthKey/X/myFirstLinkSubKey/myThirdLink")), "test_registry_CppApi error 7m13"); - VOS_ENSHURE(rootKey.openKey(OUString::createFromAscii("/myFourthKey/X/myFirstLinkSubKey/myThirdLink"), key7) == REG_DETECT_RECURSION, + OSL_ENSURE(rootKey.openKey(OUString::createFromAscii("/myFourthKey/X/myFirstLinkSubKey/myThirdLink"), key7) == REG_DETECT_RECURSION, "test_registry_CppApi error 7m14"); - VOS_ENSHURE(key7.closeKey() == REG_INVALID_KEY, "test_registry_CppApi error 7m11"); + OSL_ENSURE(key7.closeKey() == REG_INVALID_KEY, "test_registry_CppApi error 7m11"); RegistryKeyNames subKeyNames; nSubKeys=0; - VOS_ENSHURE(!rootKey.getKeyNames(OUString::createFromAscii("mySixthKey"), subKeyNames), "test_registry_CppApi error 7n"); + OSL_ENSURE(!rootKey.getKeyNames(OUString::createFromAscii("mySixthKey"), subKeyNames), "test_registry_CppApi error 7n"); nSubKeys = subKeyNames.getLength(); - VOS_ENSHURE(nSubKeys == 2, "test_registry_CppApi error 7n1"); - VOS_ENSHURE(subKeyNames.getElement(0).equals(OUString::createFromAscii("/mySixthKey/myFirstLink")), "test_registry_CppApi error 7p1)"); - VOS_ENSHURE(subKeyNames.getElement(1).equals(OUString::createFromAscii("/mySixthKey/mySixthSubKey")), "test_registry_CppApi error 7p2"); + OSL_ENSURE(nSubKeys == 2, "test_registry_CppApi error 7n1"); + OSL_ENSURE(subKeyNames.getElement(0).equals(OUString::createFromAscii("/mySixthKey/myFirstLink")), "test_registry_CppApi error 7p1)"); + OSL_ENSURE(subKeyNames.getElement(1).equals(OUString::createFromAscii("/mySixthKey/mySixthSubKey")), "test_registry_CppApi error 7p2"); RegistryKeyArray subKeys; nSubKeys=0; - VOS_ENSHURE(!rootKey.openSubKeys(OUString::createFromAscii("myFirstKey"), subKeys), "test_registry_CppApi error 7o"); + OSL_ENSURE(!rootKey.openSubKeys(OUString::createFromAscii("myFirstKey"), subKeys), "test_registry_CppApi error 7o"); nSubKeys = subKeys.getLength(); - VOS_ENSHURE(nSubKeys == 2, "test_registry_CppApi error 7o1"); - VOS_ENSHURE(subKeys.getElement(0).getName().equals(OUString::createFromAscii("/myFirstKey/mySecondSubKey")), "test_registry_CppApi error 7p1)"); - VOS_ENSHURE(subKeys.getElement(1).getName().equals(OUString::createFromAscii("/myFirstKey/X")), "test_registry_CppApi error 7p2"); + OSL_ENSURE(nSubKeys == 2, "test_registry_CppApi error 7o1"); + OSL_ENSURE(subKeys.getElement(0).getName().equals(OUString::createFromAscii("/myFirstKey/mySecondSubKey")), "test_registry_CppApi error 7p1)"); + OSL_ENSURE(subKeys.getElement(1).getName().equals(OUString::createFromAscii("/myFirstKey/X")), "test_registry_CppApi error 7p2"); - VOS_ENSHURE(!rootKey.closeSubKeys(subKeys), "test_registry_CppApi error 7q)"); + OSL_ENSURE(!rootKey.closeSubKeys(subKeys), "test_registry_CppApi error 7q)"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/TEST"), key8), "test_registry_CppApi error 8"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/TEST/Child1"), key8), "test_registry_CppApi error 8a"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("/TEST/Child2"), key8), "test_registry_CppApi error 8a1"); - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("/TEST"), key9), "test_registry_CppApi error 8b"); - VOS_ENSHURE(!key8.closeKey() && !key9.closeKey(), "test_registry_CppApi error 8b1"); - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("/TEST"), key8), "test_registry_CppApi error 8b"); - VOS_ENSHURE(!key8.closeKey(), "test_registry_CppApi error 8c"); - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("TEST"), key8), "test_registry_CppApi error 8c"); - VOS_ENSHURE(!key8.closeKey(), "test_registry_CppApi error 8d"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/TEST"), key8), "test_registry_CppApi error 8"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/TEST/Child1"), key8), "test_registry_CppApi error 8a"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("/TEST/Child2"), key8), "test_registry_CppApi error 8a1"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("/TEST"), key9), "test_registry_CppApi error 8b"); + OSL_ENSURE(!key8.closeKey() && !key9.closeKey(), "test_registry_CppApi error 8b1"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("/TEST"), key8), "test_registry_CppApi error 8b"); + OSL_ENSURE(!key8.closeKey(), "test_registry_CppApi error 8c"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("TEST"), key8), "test_registry_CppApi error 8c"); + OSL_ENSURE(!key8.closeKey(), "test_registry_CppApi error 8d"); sal_Char* Value="Mein erster Value"; - VOS_ENSHURE(!rootKey.setValue(OUString::createFromAscii("mySecondKey"), RG_VALUETYPE_STRING, Value, 18), "test_registry_CppApi error 9"); + OSL_ENSURE(!rootKey.setValue(OUString::createFromAscii("mySecondKey"), RG_VALUETYPE_STRING, Value, 18), "test_registry_CppApi error 9"); RegValueType valueType; sal_uInt32 valueSize; sal_Char* readValue; - VOS_ENSHURE(!rootKey.getValueInfo(OUString::createFromAscii("mySecondKey"), &valueType, &valueSize), "test_registry_CppApi error 9a"); + OSL_ENSURE(!rootKey.getValueInfo(OUString::createFromAscii("mySecondKey"), &valueType, &valueSize), "test_registry_CppApi error 9a"); readValue = (sal_Char*)rtl_allocateMemory(valueSize); - VOS_ENSHURE(!key2.getValue(OUString(), readValue), "test_registry_CppApi error 10"); + OSL_ENSURE(!key2.getValue(OUString(), readValue), "test_registry_CppApi error 10"); - VOS_ENSHURE(valueType == RG_VALUETYPE_STRING, "test_registry_CppApi error 11"); - VOS_ENSHURE(valueSize == 18, "test_registry_CppApi error 12"); - VOS_ENSHURE(strcmp(readValue, Value) == 0, "test_registry_CppApi error 13"); + OSL_ENSURE(valueType == RG_VALUETYPE_STRING, "test_registry_CppApi error 11"); + OSL_ENSURE(valueSize == 18, "test_registry_CppApi error 12"); + OSL_ENSURE(strcmp(readValue, Value) == 0, "test_registry_CppApi error 13"); rtl_freeMemory(readValue); const sal_Char* pList[3]; @@ -593,44 +590,44 @@ void test_registry_CppApi() pList[1]=n2; pList[2]=n3; - VOS_ENSHURE(!rootKey.setStringListValue(OUString::createFromAscii("myFourthKey"), (sal_Char**)pList, 3), "test_registry_CppApi error 13a"); + OSL_ENSURE(!rootKey.setStringListValue(OUString::createFromAscii("myFourthKey"), (sal_Char**)pList, 3), "test_registry_CppApi error 13a"); RegistryValueList<sal_Char*> valueList; - VOS_ENSHURE(!rootKey.getStringListValue(OUString::createFromAscii("myFourthKey"), valueList), "test_registry_CppApi error 13b"); + OSL_ENSURE(!rootKey.getStringListValue(OUString::createFromAscii("myFourthKey"), valueList), "test_registry_CppApi error 13b"); - VOS_ENSHURE(strcmp(n1, valueList.getElement(0)) == 0, "test_registry_CppApi error 13c"); - VOS_ENSHURE(strcmp(n2, valueList.getElement(1)) == 0, "test_registry_CppApi error 13d"); - VOS_ENSHURE(strcmp(n3, valueList.getElement(2)) == 0, "test_registry_CppApi error 13e"); + OSL_ENSURE(strcmp(n1, valueList.getElement(0)) == 0, "test_registry_CppApi error 13c"); + OSL_ENSURE(strcmp(n2, valueList.getElement(1)) == 0, "test_registry_CppApi error 13d"); + OSL_ENSURE(strcmp(n3, valueList.getElement(2)) == 0, "test_registry_CppApi error 13e"); - VOS_ENSHURE(!rootKey.getValueInfo(OUString::createFromAscii("myFourthKey"), &valueType, &valueSize), "test_registry_CppApi error 13e1"); - VOS_ENSHURE(valueType == RG_VALUETYPE_STRINGLIST, "test_registry_CppApi error 13e2"); - VOS_ENSHURE(valueSize == 3, "test_registry_CppApi error 13e3"); + OSL_ENSURE(!rootKey.getValueInfo(OUString::createFromAscii("myFourthKey"), &valueType, &valueSize), "test_registry_CppApi error 13e1"); + OSL_ENSURE(valueType == RG_VALUETYPE_STRINGLIST, "test_registry_CppApi error 13e2"); + OSL_ENSURE(valueSize == 3, "test_registry_CppApi error 13e3"); sal_Int32 pLong[3]; pLong[0] = 123; pLong[1] = 456; pLong[2] = 789; - VOS_ENSHURE(!rootKey.setLongListValue(OUString::createFromAscii("myFifthKey"), pLong, 3), "test_registry_CppApi error 13f"); + OSL_ENSURE(!rootKey.setLongListValue(OUString::createFromAscii("myFifthKey"), pLong, 3), "test_registry_CppApi error 13f"); RegistryValueList<sal_Int32> longList; - VOS_ENSHURE(!rootKey.getLongListValue(OUString::createFromAscii("myFifthKey"), longList), "test_registry_CppApi error 13g"); + OSL_ENSURE(!rootKey.getLongListValue(OUString::createFromAscii("myFifthKey"), longList), "test_registry_CppApi error 13g"); - VOS_ENSHURE(pLong[0] == longList.getElement(0), "test_registry_CppApi error 13h"); - VOS_ENSHURE(pLong[1] == longList.getElement(1), "test_registry_CppApi error 13i"); - VOS_ENSHURE(pLong[2] == longList.getElement(2), "test_registry_CppApi error 13j"); + OSL_ENSURE(pLong[0] == longList.getElement(0), "test_registry_CppApi error 13h"); + OSL_ENSURE(pLong[1] == longList.getElement(1), "test_registry_CppApi error 13i"); + OSL_ENSURE(pLong[2] == longList.getElement(2), "test_registry_CppApi error 13j"); OUString sWTestValue(OUString::createFromAscii( "Mein erster Unicode Value" )); const sal_Unicode* wTestValue= sWTestValue.getStr(); - VOS_ENSHURE(!rootKey.setValue(OUString::createFromAscii("mySixthKey"), RG_VALUETYPE_UNICODE, (void*)wTestValue, + OSL_ENSURE(!rootKey.setValue(OUString::createFromAscii("mySixthKey"), RG_VALUETYPE_UNICODE, (void*)wTestValue, (rtl_ustr_getLength(wTestValue)+1)*sizeof(sal_Unicode)), "test_registry_CppApi error 13j1"); - VOS_ENSHURE(!rootKey.getValueInfo(OUString::createFromAscii("mySixthKey"), &valueType, &valueSize), "test_registry_CppApi error 13j2"); + OSL_ENSURE(!rootKey.getValueInfo(OUString::createFromAscii("mySixthKey"), &valueType, &valueSize), "test_registry_CppApi error 13j2"); sal_Unicode* pTmpValue = (sal_Unicode*)rtl_allocateMemory(valueSize); - VOS_ENSHURE(!rootKey.getValue(OUString::createFromAscii("mySixthKey"), pTmpValue), "test_registry_CppApi error 13j3"); - VOS_ENSHURE(rtl_ustr_getLength(wTestValue) == rtl_ustr_getLength(pTmpValue), "test_registry_CppApi error 13j4"); - VOS_ENSHURE(rtl_ustr_compare(wTestValue, pTmpValue) == 0, "test_registry_CppApi error 13j4"); + OSL_ENSURE(!rootKey.getValue(OUString::createFromAscii("mySixthKey"), pTmpValue), "test_registry_CppApi error 13j3"); + OSL_ENSURE(rtl_ustr_getLength(wTestValue) == rtl_ustr_getLength(pTmpValue), "test_registry_CppApi error 13j4"); + OSL_ENSURE(rtl_ustr_compare(wTestValue, pTmpValue) == 0, "test_registry_CppApi error 13j4"); const sal_Unicode* pUnicode[3]; OUString w1(OUString::createFromAscii( "Hallo" )); @@ -641,129 +638,129 @@ void test_registry_CppApi() pUnicode[1]=w2.getStr(); pUnicode[2]=w3.getStr(); - VOS_ENSHURE(!rootKey.setUnicodeListValue(OUString::createFromAscii("mySixthKey"), (sal_Unicode**)pUnicode, 3), "test_registry_CppApi error 13k"); + OSL_ENSURE(!rootKey.setUnicodeListValue(OUString::createFromAscii("mySixthKey"), (sal_Unicode**)pUnicode, 3), "test_registry_CppApi error 13k"); RegistryValueList<sal_Unicode*> unicodeList; - VOS_ENSHURE(!rootKey.getUnicodeListValue(OUString::createFromAscii("mySixthKey"), unicodeList), "test_registry_CppApi error 13l"); + OSL_ENSURE(!rootKey.getUnicodeListValue(OUString::createFromAscii("mySixthKey"), unicodeList), "test_registry_CppApi error 13l"); - VOS_ENSHURE(rtl_ustr_compare(w1, unicodeList.getElement(0)) == 0, "test_registry_CppApi error 13m"); - VOS_ENSHURE(rtl_ustr_compare(w2, unicodeList.getElement(1)) == 0, "test_registry_CppApi error 13n"); - VOS_ENSHURE(rtl_ustr_compare(w3, unicodeList.getElement(2)) == 0, "test_registry_CppApi error 13o"); + OSL_ENSURE(rtl_ustr_compare(w1, unicodeList.getElement(0)) == 0, "test_registry_CppApi error 13m"); + OSL_ENSURE(rtl_ustr_compare(w2, unicodeList.getElement(1)) == 0, "test_registry_CppApi error 13n"); + OSL_ENSURE(rtl_ustr_compare(w3, unicodeList.getElement(2)) == 0, "test_registry_CppApi error 13o"); - VOS_ENSHURE(!key6.closeKey(), "test_registry_CppApi error 14"); + OSL_ENSURE(!key6.closeKey(), "test_registry_CppApi error 14"); - VOS_ENSHURE(!key1.closeKey() && + OSL_ENSURE(!key1.closeKey() && !key3.closeKey() && !key4.closeKey(), "test_registry_CppApi error 14"); - VOS_ENSHURE(!rootKey.deleteKey(OUString::createFromAscii("myFirstKey")), "test_registry_CppApi error 15"); + OSL_ENSURE(!rootKey.deleteKey(OUString::createFromAscii("myFirstKey")), "test_registry_CppApi error 15"); - VOS_ENSHURE(!key2.closeKey(), "test_registry_CppApi error 16"); - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("mySecondKey"), key2), "test_registry_CppApi error 17"); + OSL_ENSURE(!key2.closeKey(), "test_registry_CppApi error 16"); + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("mySecondKey"), key2), "test_registry_CppApi error 17"); - VOS_ENSHURE(!key5.closeKey(), "test_registry_CppApi error 18"); + OSL_ENSURE(!key5.closeKey(), "test_registry_CppApi error 18"); - VOS_ENSHURE(!rootKey.deleteKey(OUString::createFromAscii("myThirdKey")), "test_registry_CppApi error 19"); + OSL_ENSURE(!rootKey.deleteKey(OUString::createFromAscii("myThirdKey")), "test_registry_CppApi error 19"); - VOS_ENSHURE(rootKey.openKey(OUString::createFromAscii("myThirdKey"), key5), "test_registry_CppApi error 20"); + OSL_ENSURE(rootKey.openKey(OUString::createFromAscii("myThirdKey"), key5), "test_registry_CppApi error 20"); - VOS_ENSHURE(!key2.closeKey() && + OSL_ENSURE(!key2.closeKey() && !rootKey.closeKey(), "test_registry_CppApi error 21"); - VOS_ENSHURE(!myRegistry->close(), "test_registry_CppApi error 22"); + OSL_ENSURE(!myRegistry->close(), "test_registry_CppApi error 22"); // Test loadkey RegistryKey rootKey2, key21, key22, key23, key24 , key25; - VOS_ENSHURE(!myRegistry->create(OUString::createFromAscii("test2.rdb")), "test_registry_CppApi error 23"); - VOS_ENSHURE(!myRegistry->openRootKey(rootKey2), "test_registry_CppApi error 24"); + OSL_ENSURE(!myRegistry->create(OUString::createFromAscii("test2.rdb")), "test_registry_CppApi error 23"); + OSL_ENSURE(!myRegistry->openRootKey(rootKey2), "test_registry_CppApi error 24"); - VOS_ENSHURE(!rootKey2.createKey(OUString::createFromAscii("reg2FirstKey"), key21), "test_registry_CppApi error 25"); - VOS_ENSHURE(!rootKey2.createKey(OUString::createFromAscii("reg2SecondKey"), key22), "test_registry_CppApi error 26"); - VOS_ENSHURE(!key21.createKey(OUString::createFromAscii("reg2FirstSubKey"), key23), "test_registry_CppApi error 27"); - VOS_ENSHURE(!key21.createKey(OUString::createFromAscii("reg2SecondSubKey"), key24), "test_registry_CppApi error 28"); - VOS_ENSHURE(!rootKey2.createKey(OUString::createFromAscii("reg2ThirdKey"), key25), "test_registry_CppApi error 29"); + OSL_ENSURE(!rootKey2.createKey(OUString::createFromAscii("reg2FirstKey"), key21), "test_registry_CppApi error 25"); + OSL_ENSURE(!rootKey2.createKey(OUString::createFromAscii("reg2SecondKey"), key22), "test_registry_CppApi error 26"); + OSL_ENSURE(!key21.createKey(OUString::createFromAscii("reg2FirstSubKey"), key23), "test_registry_CppApi error 27"); + OSL_ENSURE(!key21.createKey(OUString::createFromAscii("reg2SecondSubKey"), key24), "test_registry_CppApi error 28"); + OSL_ENSURE(!rootKey2.createKey(OUString::createFromAscii("reg2ThirdKey"), key25), "test_registry_CppApi error 29"); sal_uInt32 nValue= 123456789; - VOS_ENSHURE(!key23.setValue(OUString(), RG_VALUETYPE_LONG, &nValue, sizeof(sal_uInt32)), "test_registry_CppApi error 30"); + OSL_ENSURE(!key23.setValue(OUString(), RG_VALUETYPE_LONG, &nValue, sizeof(sal_uInt32)), "test_registry_CppApi error 30"); - VOS_ENSHURE(!key21.closeKey() && + OSL_ENSURE(!key21.closeKey() && !key22.closeKey() && !key23.closeKey() && !key24.closeKey() && !key25.closeKey() && !rootKey2.closeKey(), "test_registry_CppApi error 31"); - VOS_ENSHURE(!myRegistry->close(), "test_registry_CppApi error 32"); + OSL_ENSURE(!myRegistry->close(), "test_registry_CppApi error 32"); - VOS_ENSHURE(!myRegistry->open(OUString::createFromAscii("test.rdb"), REG_READWRITE), "test_registry_CppApi error 33"); - VOS_ENSHURE(!myRegistry->openRootKey(rootKey), "test_registry_CppApi error 34"); + OSL_ENSURE(!myRegistry->open(OUString::createFromAscii("test.rdb"), REG_READWRITE), "test_registry_CppApi error 33"); + OSL_ENSURE(!myRegistry->openRootKey(rootKey), "test_registry_CppApi error 34"); - VOS_ENSHURE(!myRegistry->loadKey(rootKey, OUString::createFromAscii("allFromTest2"), + OSL_ENSURE(!myRegistry->loadKey(rootKey, OUString::createFromAscii("allFromTest2"), OUString::createFromAscii("test2.rdb")), "test_registry_CppApi error 35"); - VOS_ENSHURE(!myRegistry->saveKey(rootKey, OUString::createFromAscii("allFromTest2"), + OSL_ENSURE(!myRegistry->saveKey(rootKey, OUString::createFromAscii("allFromTest2"), OUString::createFromAscii("test3.rdb")), "test_registry_CppApi error 36"); - VOS_ENSHURE(!rootKey.createKey(OUString::createFromAscii("allFromTest3"), key1), "test_registry_CppApi error 37"); - VOS_ENSHURE(!key1.createKey(OUString::createFromAscii("myFirstKey2"), key2), "test_registry_CppApi error 38"); - VOS_ENSHURE(!key1.createKey(OUString::createFromAscii("mySecondKey2"), key3), "test_registry_CppApi error 39"); + OSL_ENSURE(!rootKey.createKey(OUString::createFromAscii("allFromTest3"), key1), "test_registry_CppApi error 37"); + OSL_ENSURE(!key1.createKey(OUString::createFromAscii("myFirstKey2"), key2), "test_registry_CppApi error 38"); + OSL_ENSURE(!key1.createKey(OUString::createFromAscii("mySecondKey2"), key3), "test_registry_CppApi error 39"); - VOS_ENSHURE(!myRegistry->mergeKey(rootKey, OUString::createFromAscii("allFromTest3"), + OSL_ENSURE(!myRegistry->mergeKey(rootKey, OUString::createFromAscii("allFromTest3"), OUString::createFromAscii("test3.rdb")), "test_registry_CppApi error 40"); - VOS_ENSHURE(!myRegistry->mergeKey(rootKey, OUString::createFromAscii("allFromTest3"), + OSL_ENSURE(!myRegistry->mergeKey(rootKey, OUString::createFromAscii("allFromTest3"), OUString::createFromAscii("ucrtest.rdb"), sal_True), "test_registry_CppApi error 40.a)"); - VOS_ENSHURE(myRegistry->mergeKey(rootKey, OUString::createFromAscii("allFromTest3"), OUString::createFromAscii("ucrtest.rdb"), sal_True) + OSL_ENSURE(myRegistry->mergeKey(rootKey, OUString::createFromAscii("allFromTest3"), OUString::createFromAscii("ucrtest.rdb"), sal_True) == REG_NO_ERROR/*REG_MERGE_CONFLICT*/, "test_registry_CppApi error 40.b)"); - VOS_ENSHURE(!key1.closeKey() && + OSL_ENSURE(!key1.closeKey() && !key2.closeKey(), "test_registry_CppApi error 41"); const sal_Unicode* wValue= OUString::createFromAscii( "Mein erster Unicode Value" ).getStr(); - VOS_ENSHURE(!key3.setValue(OUString(), RG_VALUETYPE_UNICODE, (void*)wValue, + OSL_ENSURE(!key3.setValue(OUString(), RG_VALUETYPE_UNICODE, (void*)wValue, (rtl_ustr_getLength(wValue)+1)*sizeof(sal_Unicode)), "test_registry_CppApi error 42"); - VOS_ENSHURE(!key3.closeKey(), "test_registry_CppApi error 43"); + OSL_ENSURE(!key3.closeKey(), "test_registry_CppApi error 43"); - VOS_ENSHURE(!rootKey.openKey(OUString::createFromAscii("/allFromTest3/reg2FirstKey/reg2FirstSubKey"), key1), + OSL_ENSURE(!rootKey.openKey(OUString::createFromAscii("/allFromTest3/reg2FirstKey/reg2FirstSubKey"), key1), "test_registry_CppApi error 43.a)"); - VOS_ENSHURE(!rootKey.deleteKey(OUString::createFromAscii("/allFromTest3/reg2FirstKey/reg2FirstSubKey")), "test_registry_CppApi error 44"); - VOS_ENSHURE(key1.getValueInfo(OUString(), &valueType, &valueSize) == REG_INVALID_KEY, + OSL_ENSURE(!rootKey.deleteKey(OUString::createFromAscii("/allFromTest3/reg2FirstKey/reg2FirstSubKey")), "test_registry_CppApi error 44"); + OSL_ENSURE(key1.getValueInfo(OUString(), &valueType, &valueSize) == REG_INVALID_KEY, "test_registry_CppApi error 44.a)"); - VOS_ENSHURE(!key1.closeKey(), "test_registry_CppApi error 44.b)"); + OSL_ENSURE(!key1.closeKey(), "test_registry_CppApi error 44.b)"); - VOS_ENSHURE(!rootKey.closeKey(), "test_registry_CppApi error 45"); + OSL_ENSURE(!rootKey.closeKey(), "test_registry_CppApi error 45"); - VOS_ENSHURE(!myRegistry->close(), "test_registry_CppApi error 46"); + OSL_ENSURE(!myRegistry->close(), "test_registry_CppApi error 46"); - VOS_ENSHURE(!myRegistry->open(OUString::createFromAscii("test.rdb"), REG_READWRITE), "test_registry_CppApi error 47"); + OSL_ENSURE(!myRegistry->open(OUString::createFromAscii("test.rdb"), REG_READWRITE), "test_registry_CppApi error 47"); - VOS_ENSHURE(!myRegistry->destroy(OUString::createFromAscii("test2.rdb")), "test_registry_CppApi error 48"); -// VOS_ENSHURE(!myRegistry->destroy("test3.rdb"), "test_registry_CppApi error 49"); + OSL_ENSURE(!myRegistry->destroy(OUString::createFromAscii("test2.rdb")), "test_registry_CppApi error 48"); +// OSL_ENSURE(!myRegistry->destroy("test3.rdb"), "test_registry_CppApi error 49"); Registry *myRegistry2 = new Registry(*myRegistry); - VOS_ENSHURE(myRegistry->destroy(OUString()), "test_registry_CppApi error 50"); + OSL_ENSURE(myRegistry->destroy(OUString()), "test_registry_CppApi error 50"); delete(myRegistry2); - VOS_ENSHURE(!myRegistry->create(OUString::createFromAscii("destroytest.rdb")), "test_registry_CppApi error 51"); - VOS_ENSHURE(!myRegistry->close(), "test_registry_CppApi error 52"); - VOS_ENSHURE(!myRegistry->open(OUString::createFromAscii("destroytest.rdb"), REG_READONLY), "test_registry_CppApi error 53"); - VOS_ENSHURE(!myRegistry->openRootKey(rootKey), "test_registry_CppApi error 54"); + OSL_ENSURE(!myRegistry->create(OUString::createFromAscii("destroytest.rdb")), "test_registry_CppApi error 51"); + OSL_ENSURE(!myRegistry->close(), "test_registry_CppApi error 52"); + OSL_ENSURE(!myRegistry->open(OUString::createFromAscii("destroytest.rdb"), REG_READONLY), "test_registry_CppApi error 53"); + OSL_ENSURE(!myRegistry->openRootKey(rootKey), "test_registry_CppApi error 54"); - VOS_ENSHURE(myRegistry->mergeKey(rootKey, OUString::createFromAscii("allFromTest3"), + OSL_ENSURE(myRegistry->mergeKey(rootKey, OUString::createFromAscii("allFromTest3"), OUString::createFromAscii("test3.rdb")), "test_registry_CppApi error 55"); - VOS_ENSHURE(!myRegistry->destroy(OUString::createFromAscii("test3.rdb")), "test_registry_CppApi error 56"); + OSL_ENSURE(!myRegistry->destroy(OUString::createFromAscii("test3.rdb")), "test_registry_CppApi error 56"); - VOS_ENSHURE(!rootKey.closeKey(), "test_registry_CppApi error 57"); - VOS_ENSHURE(!myRegistry->close(), "test_registry_CppApi error 58"); - VOS_ENSHURE(!myRegistry->open(OUString::createFromAscii("destroytest.rdb"), REG_READWRITE), "test_registry_CppApi error 59"); - VOS_ENSHURE(!myRegistry->destroy(OUString()), "test_registry_CppApi error 60"); + OSL_ENSURE(!rootKey.closeKey(), "test_registry_CppApi error 57"); + OSL_ENSURE(!myRegistry->close(), "test_registry_CppApi error 58"); + OSL_ENSURE(!myRegistry->open(OUString::createFromAscii("destroytest.rdb"), REG_READWRITE), "test_registry_CppApi error 59"); + OSL_ENSURE(!myRegistry->destroy(OUString()), "test_registry_CppApi error 60"); - VOS_ENSHURE(!myRegistry->open(OUString::createFromAscii("test.rdb"), REG_READWRITE), "test_registry_CppApi error 61"); - VOS_ENSHURE(!myRegistry->destroy(OUString::createFromAscii("ucrtest.rdb")), "test_registry_CppApi error 62"); - VOS_ENSHURE(!myRegistry->destroy(OUString()), "test_registry_CppApi error 63"); + OSL_ENSURE(!myRegistry->open(OUString::createFromAscii("test.rdb"), REG_READWRITE), "test_registry_CppApi error 61"); + OSL_ENSURE(!myRegistry->destroy(OUString::createFromAscii("ucrtest.rdb")), "test_registry_CppApi error 62"); + OSL_ENSURE(!myRegistry->destroy(OUString()), "test_registry_CppApi error 63"); delete(myRegistry); cout << "test_registry_CppApi() Ok!\n"; |