Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
faff774b
Kaydet (Commit)
faff774b
authored
Eyl 20, 2015
tarafından
Damjan Jovanovic
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#i125003# migrate main/cppuhelper/qa/propertysetmixin from cppunit to Google Test
üst
201e6e9f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
164 additions
and
159 deletions
+164
-159
makefile.mk
cppuhelper/qa/propertysetmixin/makefile.mk
+29
-19
test_propertysetmixin.cxx
cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx
+135
-140
No files found.
cppuhelper/qa/propertysetmixin/makefile.mk
Dosyayı görüntüle @
faff774b
...
@@ -25,6 +25,12 @@
...
@@ -25,6 +25,12 @@
nothing .PHONY
:
nothing .PHONY
:
.ELSE
.ELSE
.IF
"$(ENABLE_UNIT_TESTS)"
!=
"YES"
all
:
@echo
unit
tests
are
disabled.
Nothing
to
do.
.ELSE
PRJ
:=
../..
PRJ
:=
../..
PRJNAME
:=
cppuhelper
PRJNAME
:=
cppuhelper
...
@@ -45,15 +51,13 @@ my_file = file://
...
@@ -45,15 +51,13 @@ my_file = file://
DLLPRE
=
# no leading "lib" on .so files
DLLPRE
=
# no leading "lib" on .so files
INCPRE
+=
-I
$(MISC)
/
$(TARGET)
/inc
INCPRE
+=
-I
$(MISC)
/
$(TARGET)
/inc
CFLAGSCXX
+=
$(CPPUNIT_CFLAGS)
SHL1TARGET
=
$(TARGET)
APP1TARGET
=
$(TARGET)
SHL1OBJS
=
$(SLO)
/test_propertysetmixin.obj
APP1OBJS
=
$(SLO)
/test_propertysetmixin.obj
SHL1VERSIONMAP
=
test.map
APP1STDLIBS
=
$(CPPULIB)
$(CPPUHELPERLIB)
$(GTESTLIB)
$(SALLIB)
SHL1STDLIBS
=
$(CPPULIB)
$(CPPUHELPERLIB)
$(CPPUNITLIB)
$(SALLIB)
APP1RPATH
=
NONE
SHL1IMPLIB
=
i
$(SHL1TARGET)
# this is a custom test, can't use APP1TARGET_run so disable it here:
SHL1RPATH
=
NONE
APP1TEST
=
disabled
DEF1NAME
=
$(SHL1TARGET)
SHL2TARGET
=
$(TARGET)
.uno
SHL2TARGET
=
$(TARGET)
.uno
SHL2OBJS
=
$(SLO)
/comp_propertysetmixin.obj
SHL2OBJS
=
$(SLO)
/comp_propertysetmixin.obj
...
@@ -63,15 +67,16 @@ SHL2IMPLIB = i$(SHL2TARGET)
...
@@ -63,15 +67,16 @@ SHL2IMPLIB = i$(SHL2TARGET)
SH21RPATH
=
NONE
SH21RPATH
=
NONE
DEF2NAME
=
$(SHL2TARGET)
DEF2NAME
=
$(SHL2TARGET)
SLOFILES
=
$(
SHL
1OBJS)
$(SHL2OBJS)
SLOFILES
=
$(
APP
1OBJS)
$(SHL2OBJS)
JAVAFILES
=
JavaSupplier.java
JAVAFILES
=
JavaSupplier.java
JARFILES
=
java_uno.jar juh.jar jurt.jar ridl.jar
JARFILES
=
java_uno.jar juh.jar jurt.jar ridl.jar
.INCLUDE
:
target.mk
ALLTAR
:
test
ALLTAR
:
test
.INCLUDE
:
target.mk
$(MISC)/$(TARGET)/types.urd
:
types.idl
$(MISC)/$(TARGET)/types.urd
:
types.idl
$(MKDIRHIER) $(@
:
d)
$(MKDIRHIER) $(@
:
d)
$(IDLC) -O$(@
:
d) -I$(SOLARIDLDIR) -cid -we $<
$(IDLC) -O$(@
:
d) -I$(SOLARIDLDIR) -cid -we $<
...
@@ -121,14 +126,19 @@ $(MISC)/$(TARGET)/$(TARGET).uno.jar: $(JAVATARGET) \
...
@@ -121,14 +126,19 @@ $(MISC)/$(TARGET)/$(TARGET).uno.jar: $(JAVATARGET) \
$(MISC)/$(TARGET)/javamaker.flag manifest
$(MISC)/$(TARGET)/javamaker.flag manifest
jar
cfm
$@
manifest
-C
$(CLASSDIR)
test/cppuhelper/propertysetmixin
jar
cfm
$@
manifest
-C
$(CLASSDIR)
test/cppuhelper/propertysetmixin
test .PHONY
:
$(SHL1TARGETN) $(SHL2TARGETN) $(MISC)/$(TARGET)/$(TARGET).uno.jar
\
test .PHONY
:
$(APP1TARGETN) $(SHL2TARGETN) $(MISC)/$(TARGET)/$(TARGET).uno.jar
\
$(MISC)/$(TARGET)/types.rdb $(MISC)/$(TARGET)/services.rdb
$(MISC)/$(TARGET)/types.rdb $(MISC)/$(TARGET)/services.rdb
$(CPPUNITTESTER)
$(SHL1TARGETN)
\
$(COMMAND_ECHO)
$(AUGMENT_LIBRARY_PATH_LOCAL)
\
'-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/udkapi.rdb $(my_file)$(PWD)/$(MISC)/$(TARGET)/types.rdb'
\
UNO_TYPES
=
'
$(my_file)$(SOLARBINDIR)
/udkapi.rdb
$(my_file)$(PWD)
/
$(MISC)
/
$(TARGET)
/types.rdb'
\
'-env:UNO_SERVICES=$(my_file)$(SOLARXMLDIR)/ure/services.rdb $(my_file)$(PWD)/$(MISC)/$(TARGET)/services.rdb'
\
UNO_SERVICES
=
'
$(my_file)$(SOLARXMLDIR)
/ure/services.rdb
$(my_file)$(PWD)
/
$(MISC)
/
$(TARGET)
/services.rdb'
\
-env
:
URE_INTERNAL_LIB_DIR=$(my_file)$(SOLARSHAREDBIN)
\
URE_INTERNAL_LIB_DIR
=
$(my_file)$(SOLARSHAREDBIN)
\
-env:URE_INTERNAL_JAVA_DIR=$(my_file)$(SOLARBINDIR)
\
URE_INTERNAL_JAVA_DIR
=
$(my_file)$(SOLARBINDIR)
\
-env:OOO_INBUILD_SHAREDLIB_DIR=$(my_file)$(PWD)/$(DLLDEST)
\
OOO_INBUILD_SHAREDLIB_DIR
=
$(my_file)$(PWD)
/
$(DLLDEST)
\
-env:OOO_INBUILD_JAR_DIR=$(my_file)$(PWD)/$(MISC)/$(TARGET)
OOO_INBUILD_JAR_DIR
=
$(my_file)$(PWD)
/
$(MISC)
/
$(TARGET)
\
$(APP1TARGETN)
--gtest_output
=
"xml:
$(BIN)
/
$(APP1TARGET)
_result.xml"
.END
.ENDIF
# "$(ENABLE_UNIT_TESTS)" != "YES"
.ENDIF
# "$(OOO_SUBSEQUENT_TESTS)" == ""
cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx
Dosyayı görüntüle @
faff774b
...
@@ -56,10 +56,7 @@
...
@@ -56,10 +56,7 @@
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "cppuhelper/bootstrap.hxx"
#include "cppuhelper/bootstrap.hxx"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/implbase1.hxx"
#include "cppunit/TestAssert.h"
#include "gtest/gtest.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
#include "cppunit/plugin/TestPlugIn.h"
#include "osl/mutex.hxx"
#include "osl/mutex.hxx"
#include "rtl/ref.hxx"
#include "rtl/ref.hxx"
#include "rtl/string.h"
#include "rtl/string.h"
...
@@ -67,6 +64,7 @@
...
@@ -67,6 +64,7 @@
#include "rtl/ustring.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "rtl/ustring.hxx"
#include "sal/types.h"
#include "sal/types.h"
#include "osl/process.h"
#include <limits>
#include <limits>
#include <ostream>
#include <ostream>
...
@@ -107,14 +105,14 @@ public:
...
@@ -107,14 +105,14 @@ public:
throw
(
css
::
uno
::
RuntimeException
)
throw
(
css
::
uno
::
RuntimeException
)
{
{
osl
::
MutexGuard
g
(
m_mutex
);
osl
::
MutexGuard
g
(
m_mutex
);
CPPUNIT_ASSERT
(
m_count
<
std
::
numeric_limits
<
int
>::
max
());
ASSERT_TRUE
(
m_count
<
std
::
numeric_limits
<
int
>::
max
());
++
m_count
;
++
m_count
;
}
}
virtual
void
SAL_CALL
propertyChange
(
virtual
void
SAL_CALL
propertyChange
(
css
::
beans
::
PropertyChangeEvent
const
&
)
css
::
beans
::
PropertyChangeEvent
const
&
)
throw
(
css
::
uno
::
RuntimeException
)
throw
(
css
::
uno
::
RuntimeException
)
{
CPPUNIT_FAIL
(
"BoundListener::propertyChange called"
)
;
}
{
FAIL
()
<<
"BoundListener::propertyChange called"
;
}
private
:
private
:
BoundListener
(
BoundListener
&
);
// not defined
BoundListener
(
BoundListener
&
);
// not defined
...
@@ -141,14 +139,14 @@ public:
...
@@ -141,14 +139,14 @@ public:
throw
(
css
::
uno
::
RuntimeException
)
throw
(
css
::
uno
::
RuntimeException
)
{
{
osl
::
MutexGuard
g
(
m_mutex
);
osl
::
MutexGuard
g
(
m_mutex
);
CPPUNIT_ASSERT
(
m_count
<
std
::
numeric_limits
<
int
>::
max
());
ASSERT_TRUE
(
m_count
<
std
::
numeric_limits
<
int
>::
max
());
++
m_count
;
++
m_count
;
}
}
virtual
void
SAL_CALL
vetoableChange
(
virtual
void
SAL_CALL
vetoableChange
(
css
::
beans
::
PropertyChangeEvent
const
&
)
css
::
beans
::
PropertyChangeEvent
const
&
)
throw
(
css
::
beans
::
PropertyVetoException
,
css
::
uno
::
RuntimeException
)
throw
(
css
::
beans
::
PropertyVetoException
,
css
::
uno
::
RuntimeException
)
{
CPPUNIT_FAIL
(
"VetoListener::vetoableChange called"
)
;
}
{
FAIL
()
<<
"VetoListener::vetoableChange called"
;
}
private
:
private
:
VetoListener
(
VetoListener
&
);
// not defined
VetoListener
(
VetoListener
&
);
// not defined
...
@@ -160,34 +158,13 @@ private:
...
@@ -160,34 +158,13 @@ private:
int
m_count
;
int
m_count
;
};
};
class
Test
:
public
CppUnit
::
TestFixture
{
class
Test
:
public
::
testing
::
Test
{
public
:
public
:
virtual
void
s
etUp
();
virtual
void
S
etUp
();
virtual
void
t
earDown
();
virtual
void
T
earDown
();
void
testCppEmpty1
()
{
testEmpty1
(
getCppSupplier
());
}
protected
:
void
testCppEmpty2
()
{
testEmpty2
(
getCppSupplier
());
}
void
testCppFull
()
{
testFull
(
getCppSupplier
());
}
void
testJavaEmpty1
()
{
testEmpty1
(
getJavaSupplier
());
}
void
testJavaEmpty2
()
{
testEmpty2
(
getJavaSupplier
());
}
void
testJavaFull
()
{
testFull
(
getJavaSupplier
());
}
CPPUNIT_TEST_SUITE
(
Test
);
CPPUNIT_TEST
(
testCppEmpty1
);
CPPUNIT_TEST
(
testCppEmpty2
);
CPPUNIT_TEST
(
testCppFull
);
CPPUNIT_TEST
(
testJavaEmpty1
);
CPPUNIT_TEST
(
testJavaEmpty2
);
CPPUNIT_TEST
(
testJavaFull
);
CPPUNIT_TEST_SUITE_END
();
private
:
css
::
uno
::
Reference
<
test
::
cppuhelper
::
propertysetmixin
::
XSupplier
>
css
::
uno
::
Reference
<
test
::
cppuhelper
::
propertysetmixin
::
XSupplier
>
getCppSupplier
()
const
;
getCppSupplier
()
const
;
...
@@ -209,12 +186,12 @@ private:
...
@@ -209,12 +186,12 @@ private:
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
m_context
;
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
m_context
;
};
};
void
Test
::
s
etUp
()
{
void
Test
::
S
etUp
()
{
m_context
=
cppu
::
defaultBootstrap_InitialComponentContext
();
m_context
=
cppu
::
defaultBootstrap_InitialComponentContext
();
CPPUNIT_ASSERT
(
m_context
.
is
());
ASSERT_TRUE
(
m_context
.
is
());
}
}
void
Test
::
t
earDown
()
{
void
Test
::
T
earDown
()
{
css
::
uno
::
Reference
<
css
::
lang
::
XComponent
>
(
css
::
uno
::
Reference
<
css
::
lang
::
XComponent
>
(
m_context
,
css
::
uno
::
UNO_QUERY_THROW
)
->
dispose
();
m_context
,
css
::
uno
::
UNO_QUERY_THROW
)
->
dispose
();
}
}
...
@@ -237,13 +214,13 @@ void Test::testEmpty1(
...
@@ -237,13 +214,13 @@ void Test::testEmpty1(
{
{
css
::
uno
::
Reference
<
css
::
lang
::
XComponent
>
empty1
(
css
::
uno
::
Reference
<
css
::
lang
::
XComponent
>
empty1
(
supplier
->
getEmpty1
(),
css
::
uno
::
UNO_QUERY_THROW
);
supplier
->
getEmpty1
(),
css
::
uno
::
UNO_QUERY_THROW
);
CPPUNIT_ASSERT
(
ASSERT_TRUE
(
!
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
(
!
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
(
empty1
,
css
::
uno
::
UNO_QUERY
).
is
());
empty1
,
css
::
uno
::
UNO_QUERY
).
is
());
CPPUNIT_ASSERT
(
ASSERT_TRUE
(
!
css
::
uno
::
Reference
<
css
::
beans
::
XFastPropertySet
>
(
!
css
::
uno
::
Reference
<
css
::
beans
::
XFastPropertySet
>
(
empty1
,
css
::
uno
::
UNO_QUERY
).
is
());
empty1
,
css
::
uno
::
UNO_QUERY
).
is
());
CPPUNIT_ASSERT
(
ASSERT_TRUE
(
!
css
::
uno
::
Reference
<
css
::
beans
::
XPropertyAccess
>
(
!
css
::
uno
::
Reference
<
css
::
beans
::
XPropertyAccess
>
(
empty1
,
css
::
uno
::
UNO_QUERY
).
is
());
empty1
,
css
::
uno
::
UNO_QUERY
).
is
());
empty1
->
dispose
();
empty1
->
dispose
();
...
@@ -257,29 +234,29 @@ void Test::testEmpty2(
...
@@ -257,29 +234,29 @@ void Test::testEmpty2(
supplier
->
getEmpty2
(),
css
::
uno
::
UNO_QUERY_THROW
);
supplier
->
getEmpty2
(),
css
::
uno
::
UNO_QUERY_THROW
);
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
empty2p
(
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
empty2p
(
empty2
,
css
::
uno
::
UNO_QUERY
);
empty2
,
css
::
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT
(
empty2p
.
is
());
ASSERT_TRUE
(
empty2p
.
is
());
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySetInfo
>
info
(
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySetInfo
>
info
(
empty2p
->
getPropertySetInfo
());
empty2p
->
getPropertySetInfo
());
CPPUNIT_ASSERT
(
info
.
is
());
ASSERT_TRUE
(
info
.
is
());
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
0
),
info
->
getProperties
().
getLength
());
static_cast
<
sal_Int32
>
(
0
),
info
->
getProperties
().
getLength
());
try
{
try
{
info
->
getPropertyByName
(
info
->
getPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"any"
)));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"any"
)));
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
CPPUNIT_ASSERT
(
ASSERT_TRUE
(
!
info
->
hasPropertyByName
(
!
info
->
hasPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"any"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"any"
))));
try
{
try
{
empty2p
->
setPropertyValue
(
empty2p
->
setPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"any"
)),
css
::
uno
::
Any
());
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"any"
)),
css
::
uno
::
Any
());
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
empty2p
->
getPropertyValue
(
empty2p
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"any"
)));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"any"
)));
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
rtl
::
Reference
<
BoundListener
>
boundListener1
(
new
BoundListener
);
rtl
::
Reference
<
BoundListener
>
boundListener1
(
new
BoundListener
);
empty2p
->
addPropertyChangeListener
(
rtl
::
OUString
(),
boundListener1
.
get
());
empty2p
->
addPropertyChangeListener
(
rtl
::
OUString
(),
boundListener1
.
get
());
...
@@ -295,27 +272,27 @@ void Test::testEmpty2(
...
@@ -295,27 +272,27 @@ void Test::testEmpty2(
empty2p
->
removeVetoableChangeListener
(
rtl
::
OUString
(),
vetoListener2
.
get
());
empty2p
->
removeVetoableChangeListener
(
rtl
::
OUString
(),
vetoListener2
.
get
());
css
::
uno
::
Reference
<
css
::
beans
::
XFastPropertySet
>
empty2f
(
css
::
uno
::
Reference
<
css
::
beans
::
XFastPropertySet
>
empty2f
(
empty2
,
css
::
uno
::
UNO_QUERY
);
empty2
,
css
::
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT
(
empty2f
.
is
());
ASSERT_TRUE
(
empty2f
.
is
());
try
{
try
{
empty2f
->
setFastPropertyValue
(
-
1
,
css
::
uno
::
Any
());
empty2f
->
setFastPropertyValue
(
-
1
,
css
::
uno
::
Any
());
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
empty2f
->
setFastPropertyValue
(
0
,
css
::
uno
::
Any
());
empty2f
->
setFastPropertyValue
(
0
,
css
::
uno
::
Any
());
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
empty2f
->
getFastPropertyValue
(
-
1
);
empty2f
->
getFastPropertyValue
(
-
1
);
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
empty2f
->
getFastPropertyValue
(
0
);
empty2f
->
getFastPropertyValue
(
0
);
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
css
::
uno
::
Reference
<
css
::
beans
::
XPropertyAccess
>
empty2a
(
css
::
uno
::
Reference
<
css
::
beans
::
XPropertyAccess
>
empty2a
(
empty2
,
css
::
uno
::
UNO_QUERY
);
empty2
,
css
::
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT
(
empty2a
.
is
());
ASSERT_TRUE
(
empty2a
.
is
());
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
0
),
empty2a
->
getPropertyValues
().
getLength
());
static_cast
<
sal_Int32
>
(
0
),
empty2a
->
getPropertyValues
().
getLength
());
empty2a
->
setPropertyValues
(
empty2a
->
setPropertyValues
(
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>
());
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>
());
...
@@ -328,17 +305,17 @@ void Test::testEmpty2(
...
@@ -328,17 +305,17 @@ void Test::testEmpty2(
vs
[
0
].
State
=
css
::
beans
::
PropertyState_DIRECT_VALUE
;
vs
[
0
].
State
=
css
::
beans
::
PropertyState_DIRECT_VALUE
;
try
{
try
{
empty2a
->
setPropertyValues
(
vs
);
empty2a
->
setPropertyValues
(
vs
);
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
CPPUNIT_ASSERT_EQUAL
(
0
,
boundListener1
->
count
());
ASSERT_EQ
(
0
,
boundListener1
->
count
());
CPPUNIT_ASSERT_EQUAL
(
0
,
boundListener2
->
count
());
ASSERT_EQ
(
0
,
boundListener2
->
count
());
CPPUNIT_ASSERT_EQUAL
(
0
,
vetoListener1
->
count
());
ASSERT_EQ
(
0
,
vetoListener1
->
count
());
CPPUNIT_ASSERT_EQUAL
(
0
,
vetoListener2
->
count
());
ASSERT_EQ
(
0
,
vetoListener2
->
count
());
empty2
->
dispose
();
empty2
->
dispose
();
CPPUNIT_ASSERT_EQUAL
(
2
,
boundListener1
->
count
());
ASSERT_EQ
(
2
,
boundListener1
->
count
());
CPPUNIT_ASSERT_EQUAL
(
0
,
boundListener2
->
count
());
ASSERT_EQ
(
0
,
boundListener2
->
count
());
CPPUNIT_ASSERT_EQUAL
(
2
,
vetoListener1
->
count
());
ASSERT_EQ
(
2
,
vetoListener1
->
count
());
CPPUNIT_ASSERT_EQUAL
(
0
,
vetoListener2
->
count
());
ASSERT_EQ
(
0
,
vetoListener2
->
count
());
empty2p
->
removePropertyChangeListener
(
empty2p
->
removePropertyChangeListener
(
rtl
::
OUString
(),
boundListener1
.
get
());
rtl
::
OUString
(),
boundListener1
.
get
());
empty2p
->
removePropertyChangeListener
(
empty2p
->
removePropertyChangeListener
(
...
@@ -359,10 +336,10 @@ void Test::testEmpty2(
...
@@ -359,10 +336,10 @@ void Test::testEmpty2(
rtl
::
OUString
(),
rtl
::
OUString
(),
css
::
uno
::
Reference
<
css
::
beans
::
XVetoableChangeListener
>
());
css
::
uno
::
Reference
<
css
::
beans
::
XVetoableChangeListener
>
());
}
catch
(
css
::
uno
::
RuntimeException
&
)
{}
}
catch
(
css
::
uno
::
RuntimeException
&
)
{}
CPPUNIT_ASSERT_EQUAL
(
3
,
boundListener1
->
count
());
ASSERT_EQ
(
3
,
boundListener1
->
count
());
CPPUNIT_ASSERT_EQUAL
(
1
,
boundListener2
->
count
());
ASSERT_EQ
(
1
,
boundListener2
->
count
());
CPPUNIT_ASSERT_EQUAL
(
3
,
vetoListener1
->
count
());
ASSERT_EQ
(
3
,
vetoListener1
->
count
());
CPPUNIT_ASSERT_EQUAL
(
1
,
vetoListener2
->
count
());
ASSERT_EQ
(
1
,
vetoListener2
->
count
());
}
}
void
Test
::
testFull
(
void
Test
::
testFull
(
...
@@ -373,27 +350,27 @@ void Test::testFull(
...
@@ -373,27 +350,27 @@ void Test::testFull(
supplier
->
getFull
(),
css
::
uno
::
UNO_QUERY_THROW
);
supplier
->
getFull
(),
css
::
uno
::
UNO_QUERY_THROW
);
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
fullp
(
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
fullp
(
full
,
css
::
uno
::
UNO_QUERY
);
full
,
css
::
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT
(
fullp
.
is
());
ASSERT_TRUE
(
fullp
.
is
());
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySetInfo
>
info
(
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySetInfo
>
info
(
fullp
->
getPropertySetInfo
());
fullp
->
getPropertySetInfo
());
CPPUNIT_ASSERT
(
info
.
is
());
ASSERT_TRUE
(
info
.
is
());
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
3
),
info
->
getProperties
().
getLength
());
static_cast
<
sal_Int32
>
(
3
),
info
->
getProperties
().
getLength
());
css
::
beans
::
Property
prop
(
css
::
beans
::
Property
prop
(
info
->
getPropertyByName
(
info
->
getPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
))));
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
)),
prop
.
Name
);
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
)),
prop
.
Name
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_Int32
>
(
0
),
prop
.
Handle
);
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
0
),
prop
.
Handle
);
CPPUNIT_ASSERT_EQUAL
(
getCppuType
(
static_cast
<
sal_Int32
*
>
(
0
)),
prop
.
Type
);
ASSERT_EQ
(
getCppuType
(
static_cast
<
sal_Int32
*
>
(
0
)),
prop
.
Type
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_Int16
>
(
0
),
prop
.
Attributes
);
ASSERT_EQ
(
static_cast
<
sal_Int16
>
(
0
),
prop
.
Attributes
);
prop
=
info
->
getPropertyByName
(
prop
=
info
->
getPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)));
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)),
prop
.
Name
);
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)),
prop
.
Name
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_Int32
>
(
1
),
prop
.
Handle
);
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
1
),
prop
.
Handle
);
CPPUNIT_ASSERT_EQUAL
(
getCppuType
(
static_cast
<
sal_Int32
*
>
(
0
)),
prop
.
Type
);
ASSERT_EQ
(
getCppuType
(
static_cast
<
sal_Int32
*
>
(
0
)),
prop
.
Type
);
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
static_cast
<
sal_Int16
>
(
static_cast
<
sal_Int16
>
(
css
::
beans
::
PropertyAttribute
::
MAYBEVOID
css
::
beans
::
PropertyAttribute
::
MAYBEVOID
|
css
::
beans
::
PropertyAttribute
::
BOUND
|
css
::
beans
::
PropertyAttribute
::
BOUND
...
@@ -405,117 +382,117 @@ void Test::testFull(
...
@@ -405,117 +382,117 @@ void Test::testFull(
try
{
try
{
info
->
getPropertyByName
(
info
->
getPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)));
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
prop
=
info
->
getPropertyByName
(
prop
=
info
->
getPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)));
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)),
prop
.
Name
);
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)),
prop
.
Name
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_Int32
>
(
3
),
prop
.
Handle
);
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
3
),
prop
.
Handle
);
CPPUNIT_ASSERT_EQUAL
(
getCppuType
(
static_cast
<
sal_Int32
*
>
(
0
)),
prop
.
Type
);
ASSERT_EQ
(
getCppuType
(
static_cast
<
sal_Int32
*
>
(
0
)),
prop
.
Type
);
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
static_cast
<
sal_Int16
>
(
css
::
beans
::
PropertyAttribute
::
OPTIONAL
),
static_cast
<
sal_Int16
>
(
css
::
beans
::
PropertyAttribute
::
OPTIONAL
),
prop
.
Attributes
);
prop
.
Attributes
);
try
{
try
{
info
->
getPropertyByName
(
info
->
getPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"first"
)));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"first"
)));
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
CPPUNIT_ASSERT
(
ASSERT_TRUE
(
info
->
hasPropertyByName
(
info
->
hasPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
))));
CPPUNIT_ASSERT
(
ASSERT_TRUE
(
info
->
hasPropertyByName
(
info
->
hasPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
))));
CPPUNIT_ASSERT
(
ASSERT_TRUE
(
!
info
->
hasPropertyByName
(
!
info
->
hasPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
))));
CPPUNIT_ASSERT
(
ASSERT_TRUE
(
info
->
hasPropertyByName
(
info
->
hasPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
))));
CPPUNIT_ASSERT
(
ASSERT_TRUE
(
!
info
->
hasPropertyByName
(
!
info
->
hasPropertyByName
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"first"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"first"
))));
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
0
)),
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
0
)),
fullp
->
getPropertyValue
(
fullp
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
))));
fullp
->
setPropertyValue
(
fullp
->
setPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
)),
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
-
100
)));
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
-
100
)));
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
-
100
)),
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
-
100
)),
fullp
->
getPropertyValue
(
fullp
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
))));
css
::
uno
::
Any
voidAny
;
css
::
uno
::
Any
voidAny
;
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
voidAny
,
voidAny
,
fullp
->
getPropertyValue
(
fullp
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
))));
fullp
->
setPropertyValue
(
fullp
->
setPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)),
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
100
)));
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
100
)));
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
100
)),
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
100
)),
fullp
->
getPropertyValue
(
fullp
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
))));
CPPUNIT_ASSERT
(
full
->
getSecond
().
Value
.
Value
.
IsPresent
);
ASSERT_TRUE
(
full
->
getSecond
().
Value
.
Value
.
IsPresent
);
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
100
),
full
->
getSecond
().
Value
.
Value
.
Value
);
static_cast
<
sal_Int32
>
(
100
),
full
->
getSecond
().
Value
.
Value
.
Value
);
CPPUNIT_ASSERT
(
!
full
->
getSecond
().
Value
.
IsDefaulted
);
ASSERT_TRUE
(
!
full
->
getSecond
().
Value
.
IsDefaulted
);
CPPUNIT_ASSERT
(
!
full
->
getSecond
().
IsAmbiguous
);
ASSERT_TRUE
(
!
full
->
getSecond
().
IsAmbiguous
);
fullp
->
setPropertyValue
(
fullp
->
setPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)),
css
::
uno
::
Any
());
css
::
uno
::
Any
());
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
voidAny
,
voidAny
,
fullp
->
getPropertyValue
(
fullp
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
))));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
))));
CPPUNIT_ASSERT
(
!
full
->
getSecond
().
Value
.
Value
.
IsPresent
);
ASSERT_TRUE
(
!
full
->
getSecond
().
Value
.
Value
.
IsPresent
);
CPPUNIT_ASSERT
(
!
full
->
getSecond
().
Value
.
IsDefaulted
);
ASSERT_TRUE
(
!
full
->
getSecond
().
Value
.
IsDefaulted
);
CPPUNIT_ASSERT
(
!
full
->
getSecond
().
IsAmbiguous
);
ASSERT_TRUE
(
!
full
->
getSecond
().
IsAmbiguous
);
try
{
try
{
fullp
->
setPropertyValue
(
fullp
->
setPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)),
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
100
)));
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
100
)));
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
fullp
->
getPropertyValue
(
fullp
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)));
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
fullp
->
setPropertyValue
(
fullp
->
setPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)),
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
100
)));
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
100
)));
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
fullp
->
getPropertyValue
(
fullp
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)));
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
fullp
->
setPropertyValue
(
fullp
->
setPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"first"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"first"
)),
css
::
uno
::
Any
());
css
::
uno
::
Any
());
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
fullp
->
getPropertyValue
(
fullp
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"first"
)));
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"first"
)));
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
css
::
uno
::
Reference
<
css
::
beans
::
XFastPropertySet
>
fullf
(
css
::
uno
::
Reference
<
css
::
beans
::
XFastPropertySet
>
fullf
(
full
,
css
::
uno
::
UNO_QUERY
);
full
,
css
::
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT
(
fullf
.
is
());
ASSERT_TRUE
(
fullf
.
is
());
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
-
100
)),
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
-
100
)),
fullf
->
getFastPropertyValue
(
0
));
fullf
->
getFastPropertyValue
(
0
));
fullf
->
setFastPropertyValue
(
fullf
->
setFastPropertyValue
(
0
,
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
0
)));
0
,
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
0
)));
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
0
)),
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
0
)),
fullf
->
getFastPropertyValue
(
0
));
fullf
->
getFastPropertyValue
(
0
));
try
{
try
{
...
@@ -526,43 +503,43 @@ void Test::testFull(
...
@@ -526,43 +503,43 @@ void Test::testFull(
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
css
::
uno
::
Reference
<
css
::
beans
::
XPropertyAccess
>
fulla
(
css
::
uno
::
Reference
<
css
::
beans
::
XPropertyAccess
>
fulla
(
full
,
css
::
uno
::
UNO_QUERY
);
full
,
css
::
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT
(
fulla
.
is
());
ASSERT_TRUE
(
fulla
.
is
());
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>
vs
(
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>
vs
(
fulla
->
getPropertyValues
());
fulla
->
getPropertyValues
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_Int32
>
(
2
),
vs
.
getLength
());
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
2
),
vs
.
getLength
());
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
)),
vs
[
0
].
Name
);
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
)),
vs
[
0
].
Name
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_Int32
>
(
0
),
vs
[
0
].
Handle
);
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
0
),
vs
[
0
].
Handle
);
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
0
)),
vs
[
0
].
Value
);
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
0
)),
vs
[
0
].
Value
);
CPPUNIT_ASSERT_EQUAL
(
css
::
beans
::
PropertyState_DIRECT_VALUE
,
vs
[
0
].
State
);
ASSERT_EQ
(
css
::
beans
::
PropertyState_DIRECT_VALUE
,
vs
[
0
].
State
);
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)),
vs
[
1
].
Name
);
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)),
vs
[
1
].
Name
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_Int32
>
(
1
),
vs
[
1
].
Handle
);
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
1
),
vs
[
1
].
Handle
);
CPPUNIT_ASSERT_EQUAL
(
voidAny
,
vs
[
1
].
Value
);
ASSERT_EQ
(
voidAny
,
vs
[
1
].
Value
);
CPPUNIT_ASSERT_EQUAL
(
css
::
beans
::
PropertyState_DIRECT_VALUE
,
vs
[
1
].
State
);
ASSERT_EQ
(
css
::
beans
::
PropertyState_DIRECT_VALUE
,
vs
[
1
].
State
);
vs
[
0
].
Value
<<=
static_cast
<
sal_Int32
>
(
-
100
);
vs
[
0
].
Value
<<=
static_cast
<
sal_Int32
>
(
-
100
);
vs
[
1
].
Value
<<=
static_cast
<
sal_Int32
>
(
100
);
vs
[
1
].
Value
<<=
static_cast
<
sal_Int32
>
(
100
);
vs
[
1
].
State
=
css
::
beans
::
PropertyState_AMBIGUOUS_VALUE
;
vs
[
1
].
State
=
css
::
beans
::
PropertyState_AMBIGUOUS_VALUE
;
fulla
->
setPropertyValues
(
vs
);
fulla
->
setPropertyValues
(
vs
);
vs
=
fulla
->
getPropertyValues
();
vs
=
fulla
->
getPropertyValues
();
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_Int32
>
(
2
),
vs
.
getLength
());
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
2
),
vs
.
getLength
());
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
)),
vs
[
0
].
Name
);
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"First"
)),
vs
[
0
].
Name
);
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
-
100
)),
vs
[
0
].
Value
);
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
-
100
)),
vs
[
0
].
Value
);
CPPUNIT_ASSERT_EQUAL
(
css
::
beans
::
PropertyState_DIRECT_VALUE
,
vs
[
0
].
State
);
ASSERT_EQ
(
css
::
beans
::
PropertyState_DIRECT_VALUE
,
vs
[
0
].
State
);
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)),
vs
[
1
].
Name
);
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Second"
)),
vs
[
1
].
Name
);
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
100
)),
vs
[
1
].
Value
);
css
::
uno
::
makeAny
(
static_cast
<
sal_Int32
>
(
100
)),
vs
[
1
].
Value
);
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
css
::
beans
::
PropertyState_AMBIGUOUS_VALUE
,
vs
[
1
].
State
);
css
::
beans
::
PropertyState_AMBIGUOUS_VALUE
,
vs
[
1
].
State
);
CPPUNIT_ASSERT
(
full
->
getSecond
().
Value
.
Value
.
IsPresent
);
ASSERT_TRUE
(
full
->
getSecond
().
Value
.
Value
.
IsPresent
);
CPPUNIT_ASSERT_EQUAL
(
ASSERT_EQ
(
static_cast
<
sal_Int32
>
(
100
),
full
->
getSecond
().
Value
.
Value
.
Value
);
static_cast
<
sal_Int32
>
(
100
),
full
->
getSecond
().
Value
.
Value
.
Value
);
CPPUNIT_ASSERT
(
!
full
->
getSecond
().
Value
.
IsDefaulted
);
ASSERT_TRUE
(
!
full
->
getSecond
().
Value
.
IsDefaulted
);
CPPUNIT_ASSERT
(
full
->
getSecond
().
IsAmbiguous
);
ASSERT_TRUE
(
full
->
getSecond
().
IsAmbiguous
);
css
::
uno
::
Reference
<
css
::
beans
::
XPropertyChangeListener
>
boundListener
(
css
::
uno
::
Reference
<
css
::
beans
::
XPropertyChangeListener
>
boundListener
(
new
BoundListener
);
new
BoundListener
);
fullp
->
addPropertyChangeListener
(
fullp
->
addPropertyChangeListener
(
...
@@ -577,13 +554,13 @@ void Test::testFull(
...
@@ -577,13 +554,13 @@ void Test::testFull(
fullp
->
addPropertyChangeListener
(
fullp
->
addPropertyChangeListener
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)),
boundListener
);
boundListener
);
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
fullp
->
removePropertyChangeListener
(
fullp
->
removePropertyChangeListener
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)),
boundListener
);
boundListener
);
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
fullp
->
addPropertyChangeListener
(
fullp
->
addPropertyChangeListener
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)),
boundListener
);
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)),
boundListener
);
...
@@ -593,13 +570,13 @@ void Test::testFull(
...
@@ -593,13 +570,13 @@ void Test::testFull(
fullp
->
addPropertyChangeListener
(
fullp
->
addPropertyChangeListener
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fifth"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fifth"
)),
boundListener
);
boundListener
);
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
fullp
->
removePropertyChangeListener
(
fullp
->
removePropertyChangeListener
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fifth"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fifth"
)),
boundListener
);
boundListener
);
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
css
::
uno
::
Reference
<
css
::
beans
::
XVetoableChangeListener
>
vetoListener
(
css
::
uno
::
Reference
<
css
::
beans
::
XVetoableChangeListener
>
vetoListener
(
new
VetoListener
);
new
VetoListener
);
...
@@ -615,13 +592,13 @@ void Test::testFull(
...
@@ -615,13 +592,13 @@ void Test::testFull(
fullp
->
addVetoableChangeListener
(
fullp
->
addVetoableChangeListener
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)),
vetoListener
);
vetoListener
);
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
fullp
->
removeVetoableChangeListener
(
fullp
->
removeVetoableChangeListener
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Third"
)),
vetoListener
);
vetoListener
);
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
fullp
->
addVetoableChangeListener
(
fullp
->
addVetoableChangeListener
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)),
vetoListener
);
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fourth"
)),
vetoListener
);
...
@@ -631,18 +608,36 @@ void Test::testFull(
...
@@ -631,18 +608,36 @@ void Test::testFull(
fullp
->
addVetoableChangeListener
(
fullp
->
addVetoableChangeListener
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fifth"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fifth"
)),
vetoListener
);
vetoListener
);
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
try
{
try
{
fullp
->
removeVetoableChangeListener
(
fullp
->
removeVetoableChangeListener
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fifth"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Fifth"
)),
vetoListener
);
vetoListener
);
CPPUNIT_FAIL
(
"exception expected"
)
;
FAIL
()
<<
"exception expected"
;
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
catch
(
css
::
beans
::
UnknownPropertyException
&
)
{}
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
TEST_F
(
Test
,
testCppEmpty1
)
{
testEmpty1
(
getCppSupplier
());
}
TEST_F
(
Test
,
testCppEmpty2
)
{
testEmpty2
(
getCppSupplier
());
}
TEST_F
(
Test
,
testCppFull
)
{
testFull
(
getCppSupplier
());
}
TEST_F
(
Test
,
testJavaEmpty1
)
{
testEmpty1
(
getJavaSupplier
());
}
TEST_F
(
Test
,
testJavaEmpty2
)
{
testEmpty2
(
getJavaSupplier
());
}
TEST_F
(
Test
,
testJavaFull
)
{
testFull
(
getJavaSupplier
());
}
}
int
main
(
int
argc
,
char
**
argv
)
{
osl_setCommandArgs
(
argc
,
argv
);
::
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
}
CPPUNIT_PLUGIN_IMPLEMENT
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment