~xavi-garcia-mena/keeper/owncloud-test

« back to all changes in this revision

Viewing changes to tests/fakes/fake-restore-helper.cpp

  • Committer: Xavi Garcia Mena
  • Date: 2016-11-18 09:29:38 UTC
  • Revision ID: xavi.garcia.mena@canonical.com-20161118092938-1fn347kr9ezy440k
clean up the code a bit

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
 *
16
16
 * Authors:
17
 
 *     Charles Kerr <charles.kerr@canonical.com>
 
17
 *     Xavi Garcia <xavi.garcia.mena@canonical.com>
18
18
 */
19
19
 
20
20
#include "fake-restore-helper.h"
103
103
    int n_bytes_read = 0;
104
104
    QFile file(TEST_RESTORE_FILE_PATH);
105
105
    file.open(QIODevice::WriteOnly);
106
 
    while (1) {
 
106
    for(;;)
 
107
    {
107
108
        // Read data into buffer.  We may not have enough to fill up buffer, so we
108
109
        // store how many bytes were actually read in bytes_read.
109
110
        int bytes_read = read(fd, buffer, sizeof(buffer));
128
129
        }
129
130
    }
130
131
    file.close();
131
 
    // write the blob
132
 
//    const auto fd = ufd.fileDescriptor();
133
 
 
134
 
//    RestoreReader reader(fd, TEST_RESTORE_FILE_PATH, helper_iface);
135
 
 
136
132
    return 0;
137
 
//    return app.exec();
138
133
}