diff options
author | Alexander Tkachev | 2016-07-18 15:50:41 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | dcf904192630d1c180d60ff7989e3629ca5fc1b7 (patch) | |
tree | ea5c4480904e829ab942dc7aa240bb0cc3c5ec55 /engines/testbed | |
parent | 18fc113aa91d0563940b3de807576f7879e9ebea (diff) | |
download | scummvm-rg350-dcf904192630d1c180d60ff7989e3629ca5fc1b7.tar.gz scummvm-rg350-dcf904192630d1c180d60ff7989e3629ca5fc1b7.tar.bz2 scummvm-rg350-dcf904192630d1c180d60ff7989e3629ca5fc1b7.zip |
TESTBED: Fix CloudTests
Now work with all available Storages.
Diffstat (limited to 'engines/testbed')
-rw-r--r-- | engines/testbed/cloud.cpp | 28 | ||||
-rw-r--r-- | engines/testbed/cloud.h | 1 |
2 files changed, 18 insertions, 11 deletions
diff --git a/engines/testbed/cloud.cpp b/engines/testbed/cloud.cpp index 9d10d7d051..775ae1037c 100644 --- a/engines/testbed/cloud.cpp +++ b/engines/testbed/cloud.cpp @@ -81,6 +81,12 @@ bool CloudTests::waitForCallbackMore() { return true; } +const char *CloudTests::getRemoteTestPath() { + if (CloudMan.getStorageIndex() == Cloud::kStorageDropboxId) + return "/testbed"; + return "testbed"; +} + void CloudTests::infoCallback(Cloud::Storage::StorageInfoResponse response) { ConfParams.setCloudTestCallbackCalled(true); Testsuite::logPrintf("Info! User's ID: %s\n", response.value.uid().c_str()); @@ -286,7 +292,7 @@ TestExitStatus CloudTests::testDirectoryCreating() { // create 'testbed' if (CloudMan.getCurrentStorage()->createDirectory( - "/testbed", + getRemoteTestPath(), new Common::GlobalFunctionCallback<Cloud::Storage::BoolResponse>(&directoryCreatedCallback), new Common::GlobalFunctionCallback<Networking::ErrorResponse>(&errorCallback) ) == nullptr) { @@ -359,7 +365,7 @@ TestExitStatus CloudTests::testUploading() { if (CloudMan.getCurrentStorage()->uploadStreamSupported()) { if (CloudMan.getCurrentStorage()->upload( - "/testbed/testfile.txt", + Common::String(getRemoteTestPath()) + "/testfile.txt", node.createReadStream(), new Common::GlobalFunctionCallback<Cloud::Storage::UploadResponse>(&fileUploadedCallback), new Common::GlobalFunctionCallback<Networking::ErrorResponse>(&errorCallback) @@ -369,10 +375,10 @@ TestExitStatus CloudTests::testUploading() { } else { Common::String filepath = node.getPath(); if (CloudMan.getCurrentStorage()->upload( - "/testbed/testfile.txt", - filepath.c_str(), - new Common::GlobalFunctionCallback<Cloud::Storage::UploadResponse>(&fileUploadedCallback), - new Common::GlobalFunctionCallback<Networking::ErrorResponse>(&errorCallback) + Common::String(getRemoteTestPath()) + "/testfile.txt", + filepath.c_str(), + new Common::GlobalFunctionCallback<Cloud::Storage::UploadResponse>(&fileUploadedCallback), + new Common::GlobalFunctionCallback<Networking::ErrorResponse>(&errorCallback) ) == nullptr) { Testsuite::logPrintf("Warning! No Request is returned!\n"); } @@ -392,9 +398,9 @@ TestExitStatus CloudTests::testUploading() { ConfParams.setCloudTestCallbackCalled(false); if (CloudMan.listDirectory( - "/testbed/", - new Common::GlobalFunctionCallback<Cloud::Storage::FileArrayResponse>(&directoryListedCallback), - new Common::GlobalFunctionCallback<Networking::ErrorResponse>(&errorCallback) + getRemoteTestPath(), + new Common::GlobalFunctionCallback<Cloud::Storage::FileArrayResponse>(&directoryListedCallback), + new Common::GlobalFunctionCallback<Networking::ErrorResponse>(&errorCallback) ) == nullptr) { Testsuite::logPrintf("Warning! No Request is returned!\n"); } @@ -439,7 +445,7 @@ TestExitStatus CloudTests::testDownloading() { Common::FSNode node = gameRoot.getFSNode().getChild("downloaded_file.txt"); Common::String filepath = node.getPath(); if (CloudMan.getCurrentStorage()->download( - "/testbed/testfile.txt", + Common::String(getRemoteTestPath()) + "/testfile.txt", filepath.c_str(), new Common::GlobalFunctionCallback<Cloud::Storage::BoolResponse>(&fileDownloadedCallback), new Common::GlobalFunctionCallback<Networking::ErrorResponse>(&errorCallback) @@ -486,7 +492,7 @@ TestExitStatus CloudTests::testFolderDownloading() { Common::FSNode node = gameRoot.getFSNode().getChild("downloaded_directory"); Common::String filepath = node.getPath(); if (CloudMan.downloadFolder( - "/testbed/", + getRemoteTestPath(), filepath.c_str(), new Common::GlobalFunctionCallback<Cloud::Storage::FileArrayResponse>(&directoryDownloadedCallback), new Common::GlobalFunctionCallback<Networking::ErrorResponse>(&errorCallback) diff --git a/engines/testbed/cloud.h b/engines/testbed/cloud.h index aa6ed8706e..ed27d7da82 100644 --- a/engines/testbed/cloud.h +++ b/engines/testbed/cloud.h @@ -36,6 +36,7 @@ namespace CloudTests { bool waitForCallback(); bool waitForCallbackMore(); +const char *getRemoteTestPath(); void infoCallback(Cloud::Storage::StorageInfoResponse response); void directoryListedCallback(Cloud::Storage::FileArrayResponse response); void directoryCreatedCallback(Cloud::Storage::BoolResponse response); |