make update() utility function a bit more flexible: the checking stage is optional now
git-svn-id: https://core.forge.funambol.org/svn/core/top-level/trunk/3x/client-api/native@17611 e8e8ed6c-164c-0410-afcf-9e9a7c7d8c10
This commit is contained in:
parent
5c94e26be3
commit
73eff8c05e
|
@ -228,7 +228,7 @@ void LocalTests::insert(CreateSource createSource, const char *data) {
|
|||
*
|
||||
* The type of the item is cleared, as in insert() above.
|
||||
*/
|
||||
void LocalTests::update(CreateSource createSource, const char *data) {
|
||||
void LocalTests::update(CreateSource createSource, const char *data, bool check) {
|
||||
CPPUNIT_ASSERT(createSource.createSource);
|
||||
CPPUNIT_ASSERT(data);
|
||||
|
||||
|
@ -248,6 +248,10 @@ void LocalTests::update(CreateSource createSource, const char *data) {
|
|||
SOURCE_ASSERT(source.get(), source->endSync() == 0);
|
||||
CPPUNIT_ASSERT_NO_THROW(source.reset());
|
||||
|
||||
if (!check) {
|
||||
return;
|
||||
}
|
||||
|
||||
// check that the right changes are reported when reopening the source
|
||||
SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(createSource()));
|
||||
SOURCE_ASSERT(source.get(), source->beginSync() == 0 );
|
||||
|
|
|
@ -523,8 +523,10 @@ public:
|
|||
* assumes that exactly one element is currently inserted and updates it with the given item
|
||||
*
|
||||
* The type of the item is cleared, as in insert() above.
|
||||
*
|
||||
* @param check if true, then reopen the source and verify that the reported items are as expected
|
||||
*/
|
||||
virtual void update(CreateSource createSource, const char *data);
|
||||
virtual void update(CreateSource createSource, const char *data, bool check = true);
|
||||
|
||||
/** deletes all items locally via sync source */
|
||||
virtual void deleteAll(CreateSource createSource);
|
||||
|
|
Loading…
Reference in New Issue