[Libreoffice-commits] core.git: 10 commits - idlc/CustomTarget_parser_test.mk idlc/test offapi/com offapi/type_reference solenv/bin solenv/gbuild unoidl/source
Stephan Bergmann
sbergman at redhat.com
Fri Nov 22 09:58:49 PST 2013
idlc/CustomTarget_parser_test.mk | 20
idlc/test/parser/attribute.tests | 6
idlc/test/parser/constant.tests | 14
idlc/test/parser/polystruct.tests | 5
idlc/test/parser/published.tests | 43 +
offapi/com/sun/star/form/FormController.idl | 7
offapi/com/sun/star/sheet/ExternalReference.idl | 24 -
offapi/com/sun/star/sheet/SpreadsheetDocument.idl | 13
offapi/type_reference/offapi.idl | 4
solenv/bin/exectest.pl | 11
solenv/gbuild/CppunitTest.mk | 9
unoidl/source/sourceprovider-parser.y | 483 +++++++++++++++++-----
unoidl/source/sourceprovider-scanner.hxx | 8
13 files changed, 497 insertions(+), 150 deletions(-)
New commits:
commit 35f0a01b5e320ef3a5f0c82e24ecf889d8f9d455
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Nov 22 18:57:52 2013 +0100
Further && vs. ; clean-up
Change-Id: Ie4cb4113e98661d5c4b31a60ce1826b273c3cbc0
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index f3c0847..993757d 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -91,11 +91,10 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS)
$(call gb_CppunitTest__make_args) \
$(if $(gb_CppunitTest__interactive),, \
> $@.log 2>&1 \
- || (RET=$$? \
- $(if $(value gb_CppunitTest_postprocess), \
- && $(call gb_CppunitTest_postprocess,$(gb_CppunitTest_CPPTESTCOMMAND),$@.core,$$RET) >> $@.log 2>&1) \
- ; cat $@.log && $(call gb_UNIT_FAILED_MSG,Cppunit,$*) \
- && false))))
+ || ($(if $(value gb_CppunitTest_postprocess), \
+ RET=$$?; \
+ $(call gb_CppunitTest_postprocess,$(gb_CppunitTest_CPPTESTCOMMAND),$@.core,$$RET) >> $@.log 2>&1;) \
+ cat $@.log; $(call gb_UNIT_FAILED_MSG,Cppunit,$*); false))))
define gb_CppunitTest_CppunitTest
$(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest_get_linktarget,$(1)))
commit bd21de41e30e47f7d1c2ff6d4bdcc4a7f0e72103
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Nov 22 18:27:43 2013 +0100
Fix unoidl sourceprovider polystruct argument checks
Change-Id: Ib7ee3188b87b9b4216214b65347e34970e1b92a5
diff --git a/idlc/test/parser/polystruct.tests b/idlc/test/parser/polystruct.tests
index 129f567..89b0817 100644
--- a/idlc/test/parser/polystruct.tests
+++ b/idlc/test/parser/polystruct.tests
@@ -133,6 +133,11 @@ struct Struct1<T> { long member; };
struct Struct2 { Struct1<Struct2> member; };
+EXPECT SUCCESS "polystruct.tests 25a":
+struct Struct<T> { long member; };
+interface X { [attribute] Struct<X> member; };
+
+
EXPECT FAILURE "polystruct.tests 26":
struct Struct1<T> { long member; };
struct Struct2<T> { long member; };
diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y
index ec81083..e377ac4 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -802,6 +802,7 @@ Found findEntity(
}
}
+
bool checkTypeArgument(
YYLTYPE location, yyscan_t yyscanner,
unoidl::detail::SourceProviderType const & type)
@@ -817,11 +818,33 @@ bool checkTypeArgument(
location, yyscanner,
"bad instantiated polymorphic struct type argument");
return false;
+ case unoidl::detail::SourceProviderType::TYPE_SEQUENCE:
+ return checkTypeArgument(location, yyscanner, type.subtypes.front());
default:
return true;
}
}
+bool checkInstantiatedPolymorphicStructTypeArgument(
+ unoidl::detail::SourceProviderType const & type, OUString const & name)
+{
+ if (type.type
+ == unoidl::detail::SourceProviderType::TYPE_INSTANTIATED_POLYMORPHIC_STRUCT)
+ {
+ for (std::vector<unoidl::detail::SourceProviderType>::const_iterator i(
+ type.subtypes.begin());
+ i != type.subtypes.end(); ++i)
+ {
+ if (checkInstantiatedPolymorphicStructTypeArgument(*i, name)
+ || i->getName() == name) // no need to worry about typedef
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
std::vector<OUString> annotations(bool deprecated) {
std::vector<OUString> ann;
if (deprecated) {
@@ -1161,16 +1184,7 @@ typeParameters:
pad(getCurrentPad<unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad>(
data));
OUString id(convertName($3));
- if (nameHasSameIdentifierAs(data->currentName, id)) {
- error(
- @3, yyscanner,
- ("polymorphic struct type template " + data->currentName
- + " type parameter " + id
- + " has same unqualified identifer as the type itself"));
- YYERROR;
- }
- if (std::find(
- pad->typeParameters.begin(), pad->typeParameters.end(), id)
+ if (std::find(pad->typeParameters.begin(), pad->typeParameters.end(), id)
!= pad->typeParameters.end())
{
error(
@@ -1189,14 +1203,6 @@ typeParameters:
pad(getCurrentPad<unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad>(
data));
OUString id(convertName($1));
- if (nameHasSameIdentifierAs(data->currentName, id)) {
- error(
- @1, yyscanner,
- ("polymorphic struct type template " + data->currentName
- + " type parameter " + id
- + " has same unqualified identifer as the type itself"));
- YYERROR;
- }
assert(pad->typeParameters.empty());
pad->typeParameters.push_back(id);
}
@@ -1288,13 +1294,25 @@ structMember:
default:
break;
}
- if (t.getName() == data->currentName) { // no need to worry about typedefs
+ if (t.type != unoidl::detail::SourceProviderType::TYPE_PARAMETER
+ && t.getName() == data->currentName) // no need to worry about typedef
+ {
error(
@2, yyscanner,
("struct/exception type " + data->currentName + " direct member "
+ id + " has same type as the type itself"));
YYERROR;
}
+ if (checkInstantiatedPolymorphicStructTypeArgument(t, data->currentName))
+ {
+ error(
+ @2, yyscanner,
+ ("struct/exception type " + data->currentName + " direct member "
+ + id
+ + (" has instantiated polymorphic struct type that uses the type"
+ " itself as an argument")));
+ YYERROR;
+ }
if (nameHasSameIdentifierAs(data->currentName, id)) {
error(
@3, yyscanner,
@@ -1382,17 +1400,6 @@ structMember:
p2 = dynamic_cast<unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *>(
ent->pad.get());
if (p2 != 0) {
- if (std::find(
- p2->typeParameters.begin(), p2->typeParameters.end(), id)
- != p2->typeParameters.end())
- {
- error(
- @3, yyscanner,
- ("polymorphic struct type template " + data->currentName
- + " direct member " + id
- + " has same identifier as a type parameter"));
- YYERROR;
- }
for (std::vector<unoidl::PolymorphicStructTypeTemplateEntity::Member>::iterator i(
p2->members.begin());
i != p2->members.end(); ++i)
commit add28638db1bf367751c98631624c6dd7adc6c22
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Nov 22 17:49:09 2013 +0100
Fix unoidl sourceprovider typedef check
Change-Id: I7faa689c803f83687cfcc39dc7c4fd145584e849
diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y
index 7b9e224..ec81083 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -1882,20 +1882,20 @@ typedefDefn:
unoidl::detail::SourceProviderType t(*$4);
delete $4;
OUString name(convertToFullName(data, $5));
- // There is no good reason to forbid typedefs to VOID and to instantiated
- // polymorphic struct types, but some old client code of registry data
- // expects this typedef restriction (like the assert(false) default in
- // handleTypedef in codemaker/source/javamaker/javatype.cxx), so forbid
- // them for now:
+ // There is no good reason to forbid typedefs to VOID, to instantiated
+ // polymorphic struct types, and to exception types, but some old client
+ // code of registry data expects this typedef restriction (like the
+ // assert(false) default in handleTypedef in
+ // codemaker/source/javamaker/javatype.cxx), so forbid them for now:
switch (t.type) {
case unoidl::detail::SourceProviderType::TYPE_VOID:
+ case unoidl::detail::SourceProviderType::TYPE_EXCEPTION:
case unoidl::detail::SourceProviderType::TYPE_INSTANTIATED_POLYMORPHIC_STRUCT:
error(@4, yyscanner, "bad typedef type");
YYERROR;
break;
case unoidl::detail::SourceProviderType::TYPE_ENUM:
case unoidl::detail::SourceProviderType::TYPE_PLAIN_STRUCT:
- case unoidl::detail::SourceProviderType::TYPE_EXCEPTION:
case unoidl::detail::SourceProviderType::TYPE_INTERFACE:
if ($2) {
bool unpub = false;
commit 39831b1d17abd360b1d50c8820f09cfd095be337
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Nov 22 17:28:08 2013 +0100
Fix unoidl sourceprovider recursive struct/exception member check
Change-Id: Icd156745da10011611590b6b62cd0ec2df2b1266
diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y
index 9d1c97a..7b9e224 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -1288,10 +1288,17 @@ structMember:
default:
break;
}
- if (nameHasSameIdentifierAs(data->currentName, id)) {
+ if (t.getName() == data->currentName) { // no need to worry about typedefs
error(
@2, yyscanner,
("struct/exception type " + data->currentName + " direct member "
+ + id + " has same type as the type itself"));
+ YYERROR;
+ }
+ if (nameHasSameIdentifierAs(data->currentName, id)) {
+ error(
+ @3, yyscanner,
+ ("struct/exception type " + data->currentName + " direct member "
+ id + " has same unqualified identifer as the type itself"));
YYERROR;
}
commit 87dc22287604a702b584cd8a9272870421b8b6d1
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Nov 22 17:06:18 2013 +0100
Fix unoidl sourceprovider "published" checks
Change-Id: I93b9fcc2b20ed7a7c160a9ef3294b6e578678f53
diff --git a/idlc/test/parser/published.tests b/idlc/test/parser/published.tests
index e19a0f0..f81ef6b 100644
--- a/idlc/test/parser/published.tests
+++ b/idlc/test/parser/published.tests
@@ -636,3 +636,46 @@ singleton S: I1;
EXPECT SUCCESS "published.tests 118":
published interface I1 {};
published singleton S: I1;
+
+
+EXPECT FAILURE "published.tests 119":
+interface I1 {};
+published interface I2 { [optional] interface I1; };
+
+
+EXPECT FAILURE "published.tests 120":
+service S1 {};
+published service S2 { [optional] service S1; };
+
+
+EXPECT SUCCESS "published.tests 121":
+interface I {};
+published service S { [optional] interface I; };
+
+
+EXPECT FAILURE "published.tests 122":
+interface I {};
+published service S { [optional, property] I p; };
+
+
+EXPECT FAILURE "published.tests 123":
+interface I {};
+published service S { [optional, property] sequence<I> p; };
+
+
+EXPECT FAILURE "published.tests 124":
+struct P<T> { T m; };
+interface I {};
+published service S { [optional, property] P<I> p; };
+
+
+EXPECT FAILURE "published.tests 125":
+published struct P<T> { T m; };
+interface I {};
+published service S { [optional, property] P<I> p; };
+
+
+EXPECT FAILURE "published.tests 126":
+struct P<T> { T m; };
+published interface I {};
+published service S { [optional, property] P<I> p; };
diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y
index 8f813c3..9d1c97a 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -134,10 +134,10 @@ void convertToCurrentName(
assert(!data->currentName.isEmpty());
}
-void clearCurrentName(unoidl::detail::SourceProviderScannerData * data) {
+void clearCurrentState(unoidl::detail::SourceProviderScannerData * data) {
assert(data != 0);
- assert(!data->currentName.isEmpty());
data->currentName = "";
+ data->publishedContext = false;
}
unoidl::detail::SourceProviderEntity * getCurrentEntity(
@@ -339,6 +339,16 @@ Found findEntity(
// fall through
case unoidl::detail::SourceProviderEntity::KIND_EXTERNAL:
if (e->entity->getSort() == unoidl::Entity::SORT_TYPEDEF) {
+ if (data->publishedContext
+ && !static_cast<unoidl::TypedefEntity *>(
+ e->entity.get())->isPublished())
+ {
+ error(
+ location, yyscanner,
+ ("type " + *name + " based on unpublished typedef "
+ + n + " used in published context"));
+ return FOUND_ERROR;
+ }
OUString t(
static_cast<unoidl::TypedefEntity *>(e->entity.get())
->getType());
@@ -461,6 +471,7 @@ Found findEntity(
}
break;
case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
argT = unoidl::detail::SourceProviderType::TYPE_INTERFACE;
break;
case unoidl::detail::SourceProviderEntity::KIND_MODULE:
@@ -532,6 +543,7 @@ Found findEntity(
}
break;
case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
if (resolveInterfaceDefinitions) {
rtl::Reference<unoidl::Entity> ent(
data->manager->findEntity(n));
@@ -702,6 +714,7 @@ Found findEntity(
}
break;
case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
t = unoidl::detail::SourceProviderType(
unoidl::detail::SourceProviderType::TYPE_INTERFACE,
n, e);
@@ -761,6 +774,7 @@ Found findEntity(
}
// fall through
case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
error(
location, yyscanner,
("bad type " + *name
@@ -941,6 +955,7 @@ enumDefn:
deprecated_opt published_opt TOK_ENUM identifier
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
convertToCurrentName(data, $4);
if (!data->entities.insert(
std::map<OUString, unoidl::detail::SourceProviderEntity>::value_type(
@@ -965,7 +980,7 @@ enumDefn:
ent->entity = new unoidl::EnumTypeEntity(
pad->isPublished(), pad->members, annotations($1));
ent->pad.clear();
- clearCurrentName(data);
+ clearCurrentState(data);
}
;
@@ -1043,6 +1058,7 @@ plainStructDefn:
deprecated_opt published_opt TOK_STRUCT identifier singleInheritance_opt
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
convertToCurrentName(data, $4);
OUString baseName;
rtl::Reference<unoidl::PlainStructTypeEntity> baseEnt;
@@ -1066,6 +1082,13 @@ plainStructDefn:
}
baseEnt = static_cast<unoidl::PlainStructTypeEntity *>(
p->entity.get());
+ if ($2 && !baseEnt->isPublished()) {
+ error(
+ @5, yyscanner,
+ ("published plain struct type " + data->currentName + " base "
+ + baseName + " is unpublished"));
+ YYERROR;
+ }
}
if (!data->entities.insert(
std::map<OUString, unoidl::detail::SourceProviderEntity>::value_type(
@@ -1091,7 +1114,7 @@ plainStructDefn:
ent->entity = new unoidl::PlainStructTypeEntity(
pad->isPublished(), pad->baseName, pad->members, annotations($1));
ent->pad.clear();
- clearCurrentName(data);
+ clearCurrentState(data);
}
;
@@ -1099,6 +1122,7 @@ polymorphicStructTemplateDefn:
deprecated_opt published_opt TOK_STRUCT identifier '<'
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
convertToCurrentName(data, $4);
if (!data->entities.insert(
std::map<OUString, unoidl::detail::SourceProviderEntity>::value_type(
@@ -1125,7 +1149,7 @@ polymorphicStructTemplateDefn:
pad->isPublished(), pad->typeParameters, pad->members,
annotations($1));
ent->pad.clear();
- clearCurrentName(data);
+ clearCurrentState(data);
}
;
@@ -1182,6 +1206,7 @@ exceptionDefn:
deprecated_opt published_opt TOK_EXCEPTION identifier singleInheritance_opt
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
convertToCurrentName(data, $4);
OUString baseName;
rtl::Reference<unoidl::ExceptionTypeEntity> baseEnt;
@@ -1204,6 +1229,13 @@ exceptionDefn:
}
baseEnt = static_cast<unoidl::ExceptionTypeEntity *>(
p->entity.get());
+ if ($2 && !baseEnt->isPublished()) {
+ error(
+ @5, yyscanner,
+ ("published exception type " + data->currentName + " base "
+ + baseName + " is unpublished"));
+ YYERROR;
+ }
}
if (!data->entities.insert(
std::map<OUString, unoidl::detail::SourceProviderEntity>::value_type(
@@ -1228,7 +1260,7 @@ exceptionDefn:
ent->entity = new unoidl::ExceptionTypeEntity(
pad->isPublished(), pad->baseName, pad->members, annotations($1));
ent->pad.clear();
- clearCurrentName(data);
+ clearCurrentState(data);
}
;
@@ -1458,6 +1490,7 @@ interfaceDefn:
deprecated_opt published_opt TOK_INTERFACE identifier singleInheritance_opt
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
convertToCurrentName(data, $4);
OUString baseName;
rtl::Reference<unoidl::InterfaceTypeEntity> baseEnt;
@@ -1480,15 +1513,36 @@ interfaceDefn:
YYERROR;
}
baseEnt = static_cast<unoidl::InterfaceTypeEntity *>(p->entity.get());
+ if ($2 && !baseEnt->isPublished()) {
+ error(
+ @5, yyscanner,
+ ("published interface type " + data->currentName
+ + " direct base " + baseName + " is unpublished"));
+ YYERROR;
+ }
}
std::map<OUString, unoidl::detail::SourceProviderEntity>::iterator i(
data->entities.find(data->currentName));
- if (i != data->entities.end()
- && (i->second.kind
- != unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL))
- {
- error(@4, yyscanner, "multiple entities named " + data->currentName);
- YYERROR;
+ if (i != data->entities.end()) {
+ switch (i->second.kind) {
+ case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ break;
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
+ if (!$2) {
+ error(
+ @4, yyscanner,
+ ("unpublished interface type " + data->currentName
+ + " has been declared published"));
+ YYERROR;
+ }
+ break;
+ default:
+ error(
+ @4, yyscanner,
+ "multiple entities named " + data->currentName);
+ YYERROR;
+ break;
+ }
}
data->entities[data->currentName] = unoidl::detail::SourceProviderEntity(
new unoidl::detail::SourceProviderInterfaceTypeEntityPad(
@@ -1547,7 +1601,7 @@ interfaceDefn:
pad->isPublished(), mbases, obases, pad->attributes, pad->methods,
annotations($1));
ent->pad.clear();
- clearCurrentName(data);
+ clearCurrentState(data);
}
;
@@ -1596,6 +1650,16 @@ interfaceBase:
+ " does not resolve to an existing interface type"));
YYERROR;
}
+ if (data->publishedContext
+ && !(static_cast<unoidl::InterfaceTypeEntity *>(p->entity.get())
+ ->isPublished()))
+ {
+ error(
+ @4, yyscanner,
+ ("published interface type " + data->currentName + " direct base "
+ + name + " is unpublished"));
+ YYERROR;
+ }
//TODO: check uniqueness (incl. that opt base != XInterface)
(opt ? pad->optionalBases : pad->mandatoryBases).push_back(
unoidl::detail::SourceProviderInterfaceTypeEntityPad::Base(
@@ -1807,8 +1871,10 @@ typedefDefn:
deprecated_opt published_opt TOK_TYPEDEF type identifier ';'
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
unoidl::detail::SourceProviderType t(*$4);
delete $4;
+ OUString name(convertToFullName(data, $5));
// There is no good reason to forbid typedefs to VOID and to instantiated
// polymorphic struct types, but some old client code of registry data
// expects this typedef restriction (like the assert(false) default in
@@ -1819,12 +1885,43 @@ typedefDefn:
case unoidl::detail::SourceProviderType::TYPE_INSTANTIATED_POLYMORPHIC_STRUCT:
error(@4, yyscanner, "bad typedef type");
YYERROR;
+ break;
+ case unoidl::detail::SourceProviderType::TYPE_ENUM:
+ case unoidl::detail::SourceProviderType::TYPE_PLAIN_STRUCT:
+ case unoidl::detail::SourceProviderType::TYPE_EXCEPTION:
+ case unoidl::detail::SourceProviderType::TYPE_INTERFACE:
+ if ($2) {
+ bool unpub = false;
+ switch (t.entity->kind) {
+ case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ unpub = true;
+ break;
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
+ break;
+ case unoidl::detail::SourceProviderEntity::KIND_MODULE:
+ assert(false); // this cannot happen
+ default:
+ assert(t.entity->entity.is() || t.entity->pad.is());
+ unpub
+ = !(t.entity->entity.is()
+ ? static_cast<unoidl::PublishableEntity *>(
+ t.entity->entity.get())->isPublished()
+ : t.entity->pad->isPublished());
+ break;
+ }
+ if (unpub) {
+ error(
+ @4, yyscanner,
+ "published typedef " + name + " type is unpublished");
+ YYERROR;
+ }
+ }
+ break;
case unoidl::detail::SourceProviderType::TYPE_PARAMETER:
assert(false); // this cannot happen
default:
break;
}
- OUString name(convertToFullName(data, $5));
if (!data->entities.insert(
std::map<OUString, unoidl::detail::SourceProviderEntity>::value_type(
name,
@@ -1837,6 +1934,7 @@ typedefDefn:
error(@5, yyscanner, "multiple entities named " + name);
YYERROR;
}
+ clearCurrentState(data);
}
;
@@ -1844,6 +1942,7 @@ constantGroupDefn:
deprecated_opt published_opt TOK_CONSTANTS identifier
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
convertToCurrentName(data, $4);
if (!data->entities.insert(
std::map<OUString, unoidl::detail::SourceProviderEntity>::value_type(
@@ -1868,7 +1967,7 @@ constantGroupDefn:
ent->entity = new unoidl::ConstantGroupEntity(
pad->isPublished(), pad->members, annotations($1));
ent->pad.clear();
- clearCurrentName(data);
+ clearCurrentState(data);
}
;
@@ -2163,25 +2262,51 @@ singleInterfaceBasedServiceDefn:
deprecated_opt published_opt TOK_SERVICE identifier singleInheritance
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
convertToCurrentName(data, $4);
OUString base(convertName($5));
unoidl::detail::SourceProviderEntity const * p;
if (findEntity(@5, yyscanner, data, false, &base, &p, 0) == FOUND_ERROR) {
YYERROR;
}
- if (p == 0
- || ((p->kind
- != unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL)
- && (!p->entity.is()
- || (p->entity->getSort()
- != unoidl::Entity::SORT_INTERFACE_TYPE))))
- {
+ bool ifcBase = false;
+ bool pubBase = false;
+ if (p != 0) {
+ switch (p->kind) {
+ case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ ifcBase = true;
+ pubBase = false;
+ break;
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
+ ifcBase = true;
+ pubBase = true;
+ break;
+ default:
+ if (p->entity.is()
+ && (p->entity->getSort()
+ == unoidl::Entity::SORT_INTERFACE_TYPE))
+ {
+ ifcBase = true;
+ pubBase = static_cast<unoidl::InterfaceTypeEntity *>(
+ p->entity.get())->isPublished();
+ }
+ break;
+ }
+ }
+ if (!ifcBase) {
error(
@5, yyscanner,
("single-interface--based service " + data->currentName + " base "
+ base + " does not resolve to an interface type"));
YYERROR;
}
+ if ($2 && !pubBase) {
+ error(
+ @5, yyscanner,
+ ("published single-interface--based service " + data->currentName
+ + " base " + base + " is unpublished"));
+ YYERROR;
+ }
if (!data->entities.insert(
std::map<OUString, unoidl::detail::SourceProviderEntity>::value_type(
data->currentName,
@@ -2229,7 +2354,7 @@ singleInterfaceBasedServiceDefn:
ent->entity = new unoidl::SingleInterfaceBasedServiceEntity(
pad->isPublished(), pad->base, ctors, annotations($1));
ent->pad.clear();
- clearCurrentName(data);
+ clearCurrentState(data);
}
;
@@ -2409,6 +2534,7 @@ accumulationBasedServiceDefn:
deprecated_opt published_opt TOK_SERVICE identifier
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
convertToCurrentName(data, $4);
if (!data->entities.insert(
std::map<OUString, unoidl::detail::SourceProviderEntity>::value_type(
@@ -2436,7 +2562,7 @@ accumulationBasedServiceDefn:
pad->directOptionalBaseInterfaces, pad->directProperties,
annotations($1));
ent->pad.clear();
- clearCurrentName(data);
+ clearCurrentState(data);
}
;
@@ -2481,6 +2607,16 @@ serviceBase:
+ " does not resolve to an accumulation-based service"));
YYERROR;
}
+ if (data->publishedContext
+ && !static_cast<unoidl::AccumulationBasedServiceEntity *>(
+ p->entity.get())->isPublished())
+ {
+ error(
+ @4, yyscanner,
+ ("published accumulation-based service " + data->currentName
+ + " direct base service " + name + " is unpublished"));
+ YYERROR;
+ }
//TODO: check uniqueness
(opt ? pad->directOptionalBaseServices : pad->directMandatoryBaseServices)
.push_back(unoidl::AnnotatedReference(name, annotations($1)));
@@ -2506,13 +2642,31 @@ serviceInterfaceBase:
if (findEntity(@4, yyscanner, data, false, &name, &p, 0) == FOUND_ERROR) {
YYERROR;
}
- if (p == 0
- || ((p->kind
- != unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL)
- && (!p->entity.is()
- || (p->entity->getSort()
- != unoidl::Entity::SORT_INTERFACE_TYPE))))
- {
+ bool ifcBase = false;
+ bool pubBase = false;
+ if (p != 0) {
+ switch (p->kind) {
+ case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ ifcBase = true;
+ pubBase = false;
+ break;
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
+ ifcBase = true;
+ pubBase = true;
+ break;
+ default:
+ if (p->entity.is()
+ && (p->entity->getSort()
+ == unoidl::Entity::SORT_INTERFACE_TYPE))
+ {
+ ifcBase = true;
+ pubBase = static_cast<unoidl::InterfaceTypeEntity *>(
+ p->entity.get())->isPublished();
+ }
+ break;
+ }
+ }
+ if (!ifcBase) {
error(
@4, yyscanner,
("accumulation-based service " + data->currentName
@@ -2520,6 +2674,13 @@ serviceInterfaceBase:
+ " does not resolve to an interface type"));
YYERROR;
}
+ if (data->publishedContext && !opt && !pubBase) {
+ error(
+ @5, yyscanner,
+ ("published accumulation-based service " + data->currentName
+ + " direct base interface " + name + " is unpublished"));
+ YYERROR;
+ }
//TODO: check uniqueness
(opt
? pad->directOptionalBaseInterfaces
@@ -2615,25 +2776,51 @@ interfaceBasedSingletonDefn:
deprecated_opt published_opt TOK_SINGLETON identifier singleInheritance ';'
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
OUString name(convertToFullName(data, $4));
OUString base(convertName($5));
unoidl::detail::SourceProviderEntity const * p;
if (findEntity(@5, yyscanner, data, false, &base, &p, 0) == FOUND_ERROR) {
YYERROR;
}
- if (p == 0
- || ((p->kind
- != unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL)
- && (!p->entity.is()
- || (p->entity->getSort()
- != unoidl::Entity::SORT_INTERFACE_TYPE))))
- {
+ bool ifcBase = false;
+ bool pubBase = false;
+ if (p != 0) {
+ switch (p->kind) {
+ case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ ifcBase = true;
+ pubBase = false;
+ break;
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
+ ifcBase = true;
+ pubBase = true;
+ break;
+ default:
+ if (p->entity.is()
+ && (p->entity->getSort()
+ == unoidl::Entity::SORT_INTERFACE_TYPE))
+ {
+ ifcBase = true;
+ pubBase = static_cast<unoidl::InterfaceTypeEntity *>(
+ p->entity.get())->isPublished();
+ }
+ break;
+ }
+ }
+ if (!ifcBase) {
error(
@5, yyscanner,
("interface-based singleton " + name + " base " + base
+ " does not resolve to an interface type"));
YYERROR;
}
+ if ($2 && !pubBase) {
+ error(
+ @5, yyscanner,
+ ("published interface-based singleton " + name + " base " + base
+ + " is unpublished"));
+ YYERROR;
+ }
if (!data->entities.insert(
std::map<OUString, unoidl::detail::SourceProviderEntity>::value_type(
name,
@@ -2646,6 +2833,7 @@ interfaceBasedSingletonDefn:
error(@4, yyscanner, "multiple entities named " + name);
YYERROR;
}
+ clearCurrentState(data);
}
;
@@ -2654,6 +2842,7 @@ serviceBasedSingletonDefn:
'}' ';'
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
OUString name(convertToFullName(data, $4));
OUString base(convertName($7));
unoidl::detail::SourceProviderEntity const * p;
@@ -2671,6 +2860,16 @@ serviceBasedSingletonDefn:
+ " does not resolve to an accumulation-based service"));
YYERROR;
}
+ if ($2
+ && !static_cast<unoidl::AccumulationBasedServiceEntity *>(
+ p->entity.get())->isPublished())
+ {
+ error(
+ @7, yyscanner,
+ ("published service-based singleton " + name + " base " + base
+ + " is unpublished"));
+ YYERROR;
+ }
if (!data->entities.insert(
std::map<OUString, unoidl::detail::SourceProviderEntity>::value_type(
name,
@@ -2683,6 +2882,7 @@ serviceBasedSingletonDefn:
error(@4, yyscanner, "multiple entities named " + name);
YYERROR;
}
+ clearCurrentState(data);
}
;
@@ -2722,6 +2922,16 @@ exceptions:
("exception " + name + " does not resolve to an exception type"));
YYERROR;
}
+ if (data->publishedContext
+ && !(static_cast<unoidl::ExceptionTypeEntity *>(p->entity.get())
+ ->isPublished()))
+ {
+ delete $1; /* see commented-out %destructor above */
+ error(
+ @3, yyscanner,
+ ("unpublished exception " + name + " used in published context"));
+ YYERROR;
+ }
if (std::find($1->begin(), $1->end(), name) != $1->end()) {
delete $1; /* see commented-out %destructor above */
error(
@@ -2748,6 +2958,15 @@ exceptions:
("exception " + name + " does not resolve to an exception type"));
YYERROR;
}
+ if (data->publishedContext
+ && !(static_cast<unoidl::ExceptionTypeEntity *>(p->entity.get())
+ ->isPublished()))
+ {
+ error(
+ @1, yyscanner,
+ ("unpublished exception " + name + " used in published context"));
+ YYERROR;
+ }
$$ = new std::vector<OUString>; $$->push_back(name);
}
;
@@ -2756,27 +2975,49 @@ interfaceDecl:
deprecated_opt/*ignored*/ published_opt TOK_INTERFACE identifier ';'
{
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
+ data->publishedContext = $2;
OUString name(convertToFullName(data, $4));
std::pair<std::map<OUString, unoidl::detail::SourceProviderEntity>::iterator, bool> p(
data->entities.insert(
std::map<OUString, unoidl::detail::SourceProviderEntity>::value_type(
name,
unoidl::detail::SourceProviderEntity(
- unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL))));
- if (!p.second
- && (p.first->second.kind
- != unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL))
- {
- assert(p.first->second.entity.is());
- if (p.first->second.entity->getSort()
- != unoidl::Entity::SORT_INTERFACE_TYPE)
- {
- error(
- @4, yyscanner,
- "multiple entities named " + data->currentName);
- YYERROR;
+ $2
+ ? unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL
+ : unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL))));
+ if (!p.second) {
+ switch (p.first->second.kind) {
+ case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ if ($2) {
+ p.first->second.kind
+ = unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL;
+ }
+ break;
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
+ break;
+ default:
+ assert(p.first->second.entity.is());
+ if (p.first->second.entity->getSort()
+ != unoidl::Entity::SORT_INTERFACE_TYPE)
+ {
+ error(
+ @4, yyscanner,
+ "multiple entities named " + data->currentName);
+ YYERROR;
+ }
+ if ($2
+ && !static_cast<unoidl::InterfaceTypeEntity *>(
+ p.first->second.entity.get())->isPublished())
+ {
+ error(
+ @4, yyscanner,
+ ("published interface type declaration "
+ + data->currentName + " has been defined unpublished"));
+ YYERROR;
+ }
}
}
+ clearCurrentState(data);
}
;
@@ -3185,6 +3426,7 @@ primaryExpr:
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
unoidl::ConstantValue v(false); // dummy value
bool found = false;
+ bool unpub = false;
sal_Int32 i = name.lastIndexOf('.');
if (i == -1) {
rtl::Reference<unoidl::detail::SourceProviderEntityPad> pad(
@@ -3248,6 +3490,9 @@ primaryExpr:
if (j->name == id) {
v = j->value;
found = true;
+ unpub
+ = !static_cast<unoidl::ConstantGroupEntity *>(
+ ent->entity.get())->isPublished();
break;
}
}
@@ -3265,6 +3510,7 @@ primaryExpr:
if (j->name == id) {
v = j->value;
found = true;
+ unpub = !ent->pad->isPublished();
break;
}
}
@@ -3280,6 +3526,12 @@ primaryExpr:
" enum member")));
YYERROR;
}
+ if (data->publishedContext && unpub) {
+ error(
+ @1, yyscanner,
+ "unpublished value " + name + " used in published context");
+ YYERROR;
+ }
switch (v.type) {
case unoidl::ConstantValue::TYPE_BOOLEAN:
$$ = unoidl::detail::SourceProviderExpr::Bool(v.booleanValue);
@@ -3470,6 +3722,13 @@ type:
switch (ent->kind) {
case unoidl::detail::SourceProviderEntity::KIND_LOCAL:
if (ent->pad.is()) {
+ if (data->publishedContext && !ent->pad->isPublished()) {
+ error(
+ @1, yyscanner,
+ ("unpublished entity " + name
+ + " used in published context"));
+ YYERROR;
+ }
if (dynamic_cast<unoidl::detail::SourceProviderEnumTypeEntityPad *>(
ent->pad.get())
!= 0)
@@ -3518,6 +3777,17 @@ type:
assert(ent->entity.is());
// fall through
case unoidl::detail::SourceProviderEntity::KIND_EXTERNAL:
+ if (data->publishedContext
+ && ent->entity->getSort() != unoidl::Entity::SORT_MODULE
+ && !static_cast<unoidl::PublishableEntity *>(
+ ent->entity.get())->isPublished())
+ {
+ error(
+ @1, yyscanner,
+ ("unpublished entity " + name
+ + " used in published context"));
+ YYERROR;
+ }
switch (ent->entity->getSort()) {
case unoidl::Entity::SORT_ENUM_TYPE:
$$ = new unoidl::detail::SourceProviderType(
@@ -3558,6 +3828,15 @@ type:
}
break;
case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ if (data->publishedContext) {
+ error(
+ @1, yyscanner,
+ ("unpublished entity " + name
+ + " used in published context"));
+ YYERROR;
+ }
+ // fall through
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
$$ = new unoidl::detail::SourceProviderType(
unoidl::detail::SourceProviderType::TYPE_INTERFACE, name,
ent);
@@ -3612,23 +3891,29 @@ type:
if (ent->entity->getSort()
== unoidl::Entity::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE)
{
- if (args.size()
- != (static_cast<
- unoidl::PolymorphicStructTypeTemplateEntity *>(
- ent->entity.get())->
- getTypeParameters().size()))
- {
+ rtl::Reference<unoidl::PolymorphicStructTypeTemplateEntity> e(
+ static_cast<unoidl::PolymorphicStructTypeTemplateEntity *>(
+ ent->entity.get()));
+ if (args.size() != e->getTypeParameters().size()) {
error(
@1, yyscanner,
("bad number of polymorphic struct type template " + name
+ " type arguments"));
YYERROR;
}
+ if (data->publishedContext && !e->isPublished()) {
+ error(
+ @1, yyscanner,
+ ("unpublished polymorphic struct type template " + name
+ + " used in published context"));
+ YYERROR;
+ }
$$ = new unoidl::detail::SourceProviderType(name, ent, args);
ok = true;
}
break;
case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
+ case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL:
break;
case unoidl::detail::SourceProviderEntity::KIND_MODULE:
assert(false); // this cannot happen
diff --git a/unoidl/source/sourceprovider-scanner.hxx b/unoidl/source/sourceprovider-scanner.hxx
index c1959a7..5edd984 100644
--- a/unoidl/source/sourceprovider-scanner.hxx
+++ b/unoidl/source/sourceprovider-scanner.hxx
@@ -218,7 +218,10 @@ private:
};
struct SourceProviderEntity {
- enum Kind { KIND_EXTERNAL, KIND_LOCAL, KIND_INTERFACE_DECL, KIND_MODULE };
+ enum Kind {
+ KIND_EXTERNAL, KIND_LOCAL, KIND_INTERFACE_DECL,
+ KIND_PUBLISHED_INTERFACE_DECL, KIND_MODULE
+ };
explicit SourceProviderEntity(
Kind theKind, rtl::Reference<unoidl::Entity> const & externalEntity):
@@ -248,7 +251,7 @@ struct SourceProviderScannerData {
manager(theManager),
sourcePosition(), sourceEnd(),
// avoid false warnings about uninitialized members
- errorLine(0)
+ errorLine(0), publishedContext(false)
{ assert(manager.is()); }
void setSource(void const * address, sal_uInt64 size) {
@@ -267,6 +270,7 @@ struct SourceProviderScannerData {
std::map<OUString, SourceProviderEntity> entities;
std::vector<OUString> modules;
OUString currentName;
+ bool publishedContext;
};
bool parse(OUString const & uri, SourceProviderScannerData * data);
commit 75144495ee77a41e5a94d9e21b7f6aaf16a80b4f
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Nov 22 16:57:31 2013 +0100
Published FormController cannot reference unpublished XFormOperations
...and the hack to locally introduce a bogus pupblished forward declaration of
XFormOperations with which this has been worked around in
cf5c36912390b2f6018f57f79085ab1fa88a08d6 "INTEGRATION: CWS dba23b: work around
idlc limitation, which does not allow to refer unpublished interfaces as
optional entities in published services" no longer works in
offapi/type_reference/offapi.idl.
So given FormController is a (deprecated, even) old-style service (i.e., little
more than glorified commentary), the best fix probably is to demote the
problematic optional property to a comment.
Change-Id: Ia38483c817dc1762ba73315abcd4f9f063db3093
diff --git a/offapi/com/sun/star/form/FormController.idl b/offapi/com/sun/star/form/FormController.idl
index 137bd6e..c49dc71 100644
--- a/offapi/com/sun/star/form/FormController.idl
+++ b/offapi/com/sun/star/form/FormController.idl
@@ -40,18 +40,13 @@
module com { module sun { module star { module form {
-module runtime {
- published interface XFormOperations;
-};
-
-
/** is superseded by com::sun::star::form::runtime::FormController.
@deprecated
*/
published service FormController
{
[optional] service FormControllerDispatcher;
- [optional, property] ::com::sun::star::form::runtime::XFormOperations FormOperations;
+ // [optional, property] ::com::sun::star::form::runtime::XFormOperations FormOperations; is not published
/** is used for notifying the (de)activation of the controller.
*/
diff --git a/offapi/type_reference/offapi.idl b/offapi/type_reference/offapi.idl
index 509fe6b..a474f59 100644
--- a/offapi/type_reference/offapi.idl
+++ b/offapi/type_reference/offapi.idl
@@ -6493,9 +6493,6 @@ module com {
};
};
module form {
- module runtime {
- interface XFormOperations;
- };
/** @deprecated */ published service FormController {
[optional] service ::com::sun::star::form::FormControllerDispatcher;
interface ::com::sun::star::form::XFormController;
@@ -6508,7 +6505,6 @@ module com {
interface ::com::sun::star::sdb::XSQLErrorBroadcaster;
interface ::com::sun::star::sdb::XRowSetApproveBroadcaster;
interface ::com::sun::star::form::XDatabaseParameterBroadcaster;
- [property, optional] ::com::sun::star::form::runtime::XFormOperations FormOperations;
};
published enum FormSubmitEncoding {
URL = 0,
commit 71af2d5885eba0b82e6e0f3938bf08a9346776ff
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Nov 22 15:55:17 2013 +0100
Modern UNOIDL parsers ignore preproc lines, so replace #if 0 with comment
Change-Id: If46e98f54b916c312193ef7d931e120c53d047c0
diff --git a/offapi/com/sun/star/sheet/ExternalReference.idl b/offapi/com/sun/star/sheet/ExternalReference.idl
index 17b7ded..ea22257 100644
--- a/offapi/com/sun/star/sheet/ExternalReference.idl
+++ b/offapi/com/sun/star/sheet/ExternalReference.idl
@@ -46,20 +46,16 @@ struct ExternalReference
*/
long Index;
-#if 0
-
- /** Name of the sheet that the external reference points to.
-
- <p>In case of a cell range reference that spans across multiple
- sheets, this is the name of the first sheet in that range.</p>
-
- <p>Note that an external range name ignores this value at the moment,
- but <i>it may make use of this data in the future when Calc supports a
- sheet-specific range name.</i></p>
- */
- string SheetName;
-#endif
-
+// /** Name of the sheet that the external reference points to.
+//
+// <p>In case of a cell range reference that spans across multiple
+// sheets, this is the name of the first sheet in that range.</p>
+//
+// <p>Note that an external range name ignores this value at the moment,
+// but <i>it may make use of this data in the future when Calc supports a
+// sheet-specific range name.</i></p>
+// */
+// string SheetName;
/** Reference data.
diff --git a/offapi/com/sun/star/sheet/SpreadsheetDocument.idl b/offapi/com/sun/star/sheet/SpreadsheetDocument.idl
index eb4581c..a72a127 100644
--- a/offapi/com/sun/star/sheet/SpreadsheetDocument.idl
+++ b/offapi/com/sun/star/sheet/SpreadsheetDocument.idl
@@ -177,14 +177,11 @@ published service SpreadsheetDocument
[readonly, property] com::sun::star::container::XNameAccess DDELinks;
-#if 0
- /** contains the collection of external document links in the document.
-
- @since OOo 3.1
- */
- [optional, readonly, property] com::sun::star::sheet::XExternalDocLinks ExternalDocLinks;
-#endif
-
+// /** contains the collection of external document links in the document.
+//
+// @since OOo 3.1
+// */
+// [optional, readonly, property] com::sun::star::sheet::XExternalDocLinks ExternalDocLinks;
};
commit 2abcff25137c7c9af007554c97a4512319ec2e4d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Nov 22 10:28:12 2013 +0100
constant.tests idlc/unoidl diffs:
* byte only accepts singed literal values < 128 now
Change-Id: If557b5212e349fe115948f72b5558fee338db659
diff --git a/idlc/test/parser/constant.tests b/idlc/test/parser/constant.tests
index 505a8c2..49183d4 100644
--- a/idlc/test/parser/constant.tests
+++ b/idlc/test/parser/constant.tests
@@ -79,9 +79,9 @@ constants C {
const byte C1 = -128;
const byte C2 = -0200;
const byte C3 = -0x80;
- const byte C4 = 255;
- const byte C5 = 0377;
- const byte C6 = 0xFF;
+ const byte C4 = 127;
+ const byte C5 = 0177;
+ const byte C6 = 0x7F;
const short C7 = -32768;
const short C8 = -0100000;
const short C9 = -0x8000;
@@ -118,6 +118,14 @@ constants C {
};
+EXPECT NEW-FAILURE "constant.tests 8a":
+constants C {
+ const byte C4 = 255;
+ const byte C5 = 0377;
+ const byte C6 = 0xFF;
+};
+
+
EXPECT FAILURE "constant.tests 9":
constants C { const byte C1 = -129; };
commit 61c092497ebbc22f1ce92e185f9fb66353bb9172
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Nov 22 10:26:19 2013 +0100
attributes.tests idlc/unoidl diffs:
* global exception names no longer clash with local names
* repeating the same exception in a raises spec is caught now
Change-Id: I388aae4de59bddc1c69bf4c263297d0b92b47106
diff --git a/idlc/test/parser/attribute.tests b/idlc/test/parser/attribute.tests
index bc6753f..46f9c1a 100644
--- a/idlc/test/parser/attribute.tests
+++ b/idlc/test/parser/attribute.tests
@@ -92,7 +92,7 @@ interface I1 {
};
-EXPECT FAILURE "attribute.tests 9":
+EXPECT OLD-FAILURE "attribute.tests 9":
exception E1 {};
interface I1 {
void E1();
@@ -102,7 +102,7 @@ interface I1 {
};
-EXPECT FAILURE "attribute.tests 10":
+EXPECT OLD-FAILURE "attribute.tests 10":
exception E1 {};
interface I1 {
[attribute] long E1 {
@@ -111,7 +111,7 @@ interface I1 {
};
-EXPECT SUCCESS "attribute.tests 11":
+EXPECT NEW-FAILURE "attribute.tests 11":
exception E1 {};
interface I1 {
[attribute] long a {
commit c5bb39d64d26398e9ebf8f973059a887c271052f
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Nov 22 10:23:33 2013 +0100
Add exectest.pl OLD-/NEW-FAILURE for deliberate idlc/unoidl diffs
Change-Id: I653522d8ebaac3329f368c102d14041c6b49d41d
diff --git a/idlc/CustomTarget_parser_test.mk b/idlc/CustomTarget_parser_test.mk
index acb3a8f..84b01d9 100644
--- a/idlc/CustomTarget_parser_test.mk
+++ b/idlc/CustomTarget_parser_test.mk
@@ -28,52 +28,52 @@ $(call gb_CustomTarget_get_target,idlc/parser_test) : \
$(call gb_Helper_abbreviate_dirs,( \
$(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
$(SRCDIR)/idlc/test/parser/attribute.tests \
- $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl \
+ $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \
$(call gb_Executable_get_command,idlc) \
-O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \
$(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
$(SRCDIR)/idlc/test/parser/constant.tests \
- $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl \
+ $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \
$(call gb_Executable_get_command,idlc) \
-O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \
$(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
$(SRCDIR)/idlc/test/parser/constructor.tests \
- $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl \
+ $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \
$(call gb_Executable_get_command,idlc) \
-O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \
$(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
$(SRCDIR)/idlc/test/parser/interfaceinheritance.tests \
- $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl \
+ $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \
$(call gb_Executable_get_command,idlc) \
-O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \
$(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
$(SRCDIR)/idlc/test/parser/methodoverload.tests \
- $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl \
+ $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \
$(call gb_Executable_get_command,idlc) \
-O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \
$(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
$(SRCDIR)/idlc/test/parser/oldstyle.tests \
- $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl \
+ $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \
$(call gb_Executable_get_command,idlc) \
-O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \
$(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
$(SRCDIR)/idlc/test/parser/polystruct.tests \
- $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl \
+ $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \
$(call gb_Executable_get_command,idlc) \
-O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \
$(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
$(SRCDIR)/idlc/test/parser/published.tests \
- $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl \
+ $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \
$(call gb_Executable_get_command,idlc) \
-O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \
$(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
$(SRCDIR)/idlc/test/parser/struct.tests \
- $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl \
+ $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \
$(call gb_Executable_get_command,idlc) \
-O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \
$(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
$(SRCDIR)/idlc/test/parser/typedef.tests \
- $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl \
+ $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \
$(call gb_Executable_get_command,idlc) \
-O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {}) \
> $@.log 2>&1 || (cat $@.log && false))
diff --git a/solenv/bin/exectest.pl b/solenv/bin/exectest.pl
index bd9b5f3..248cd7b 100644
--- a/solenv/bin/exectest.pl
+++ b/solenv/bin/exectest.pl
@@ -23,18 +23,21 @@ sub encode($)
return $arg
}
-$#ARGV >= 2
- or die "Usage: $0 <input file> <temp file> <command> <arguments...>";
+$#ARGV >= 3
+ or die "Usage: $0 <input file> <temp file> <new?> <command> <arguments...>";
open INPUT, '<', $ARGV[0] or die "cannot open $ARGV[0]: $!";
shift @ARGV;
$temp = $ARGV[0];
shift @ARGV;
+$new = $ARGV[0];
+shift @ARGV;
$failed = 0;
$open = 0;
while (1) {
$eof = eof INPUT;
$in = <INPUT> unless $eof;
- if ($eof || $in =~ /^EXPECT (SUCCESS|FAILURE) "([^"]*)"?:\n$/)
+ if ($eof
+ || $in =~ /^EXPECT (SUCCESS|FAILURE|NEW-FAILURE|OLD-FAILURE) "([^"]*)"?:\n$/)
{
if ($open)
{
@@ -86,6 +89,8 @@ while (1) {
}
last if $eof;
$expect = $1;
+ $expect = ($new ? 'FAILURE' : 'SUCCESS') if $expect eq 'NEW-FAILURE';
+ $expect = ($new ? 'SUCCESS' : 'FAILURE') if $expect eq 'OLD-FAILURE';
$title = $2;
open OUTPUT, '>', $temp or die "cannot open $temp: $!";
$open = 1;
More information about the Libreoffice-commits
mailing list