Author: robbinspg
Date: Thu Sep 28 06:39:19 2006
New Revision: 450852
URL: http://svn.apache.org/viewvc?view=rev&rev=450852
Log:
TUSCANY-759 fix incorrect substring length
Modified:
incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp
incubator/tuscany/cpp/sdo/runtime/core/test/main.cpp
incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.h
incubator/tuscany/cpp/sdo/runtime/core/test/sdotest2.cpp
Modified:
incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp?view=diff&rev=450852&r1=450851&r2=450852
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp
(original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp
Thu Sep 28 06:39:19 2006
@@ -2628,7 +2628,7 @@
size_t ender = PropertyValue.find(searchchar, firstquote + 1);
if (ender != string::npos)
{
- if (!strcmp(PropertyValue.substr(firstquote + 1, ender -
firstquote).c_str(), list[li]->getCString(p)))
+ if (!strcmp(PropertyValue.substr(firstquote + 1, ender -
(firstquote+1)).c_str(), list[li]->getCString(p)))
ok = 1;
}
}
Modified: incubator/tuscany/cpp/sdo/runtime/core/test/main.cpp
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/main.cpp?view=diff&rev=450852&r1=450851&r2=450852
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/main.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/main.cpp Thu Sep 28 06:39:19
2006
@@ -169,12 +169,9 @@
TEST ( sdotest::b45933() );
TEST ( sdotest::jira490() );
TEST ( sdotest::jira705() );
+ TEST ( sdotest::testXPath() );
cout << "Total tests:" << totaltests << " Tests passed:" << testspassed <<
endl;
-
- if (totaltests == testspassed)
- return 0;
- else
- return -1;
+ return testspassed - totaltests;
}
}
Modified: incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.h
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.h?view=diff&rev=450852&r1=450851&r2=450852
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.h Thu Sep 28 06:39:19
2006
@@ -191,4 +191,5 @@
static int b46617();
static int b46617b();
static int b45933();
+ static int testXPath();
};
Modified: incubator/tuscany/cpp/sdo/runtime/core/test/sdotest2.cpp
URL:
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/sdotest2.cpp?view=diff&rev=450852&r1=450851&r2=450852
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/sdotest2.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/sdotest2.cpp Thu Sep 28
06:39:19 2006
@@ -1443,3 +1443,30 @@
return 0;
}
}
+
+int sdotest::testXPath()
+{
+
+
+ try {
+ DataFactoryPtr mdg = DataFactory::getDataFactory();
+
+ XSDHelperPtr xsh = HelperProvider::getXSDHelper(mdg);
+ xsh->defineFile("company.xsd");
+ XMLHelperPtr myXMLHelper = HelperProvider::getXMLHelper(mdg);
+ XMLDocumentPtr myXMLDocument = myXMLHelper->loadFile("b46617b.xml",
"companyNS");
+ DataObjectPtr newdob = myXMLDocument->getRootDataObject();
+
+ DataObjectPtr dop =
newdob->getDataObject("departments[name='Shoe']/employees[name='Sarah Jones']");
+ string x = "departments[name='Shoe']/employees[name='Sarah Jones']";
+ dop = newdob->getDataObject(x);
+
+ return 1;
+
+ }
+ catch (SDORuntimeException e)
+ {
+ cout << "Exception in testXPath" << e << endl;
+ return 0;
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]