diff options
Diffstat (limited to 'tests/storagebenchmark.cpp')
-rw-r--r-- | tests/storagebenchmark.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp index 9cf9a71..0233466 100644 --- a/tests/storagebenchmark.cpp +++ b/tests/storagebenchmark.cpp | |||
@@ -15,7 +15,7 @@ | |||
15 | using namespace Calendar; | 15 | using namespace Calendar; |
16 | using namespace flatbuffers; | 16 | using namespace flatbuffers; |
17 | 17 | ||
18 | static std::string createEvent() | 18 | static QByteArray createEvent() |
19 | { | 19 | { |
20 | static const size_t attachmentSize = 1024*2; // 2KB | 20 | static const size_t attachmentSize = 1024*2; // 2KB |
21 | static uint8_t rawData[attachmentSize]; | 21 | static uint8_t rawData[attachmentSize]; |
@@ -33,7 +33,7 @@ static std::string createEvent() | |||
33 | memcpy((void*)Calendar::GetEvent(fbb.GetBufferPointer())->attachment()->Data(), rawData, attachmentSize); | 33 | memcpy((void*)Calendar::GetEvent(fbb.GetBufferPointer())->attachment()->Data(), rawData, attachmentSize); |
34 | } | 34 | } |
35 | 35 | ||
36 | return std::string(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); | 36 | return QByteArray::fromRawData(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); |
37 | } | 37 | } |
38 | 38 | ||
39 | // static void readEvent(const std::string &data) | 39 | // static void readEvent(const std::string &data) |
@@ -103,9 +103,9 @@ private Q_SLOTS: | |||
103 | store->startTransaction(); | 103 | store->startTransaction(); |
104 | } | 104 | } |
105 | 105 | ||
106 | store->write(keyPrefix + std::to_string(i), event); | 106 | store->write(keyPrefix + QByteArray::number(i), event); |
107 | } else { | 107 | } else { |
108 | myfile << event; | 108 | myfile << event.toStdString(); |
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
@@ -122,7 +122,7 @@ private Q_SLOTS: | |||
122 | { | 122 | { |
123 | for (int i = 0; i < count; i++) { | 123 | for (int i = 0; i < count; i++) { |
124 | if (store) { | 124 | if (store) { |
125 | store->read(keyPrefix + std::to_string(i), [](std::string value) -> bool { return true; }); | 125 | store->scan(keyPrefix + QByteArray::number(i), [](const QByteArray &value) -> bool { return true; }); |
126 | } | 126 | } |
127 | } | 127 | } |
128 | } | 128 | } |