summaryrefslogtreecommitdiff
path: root/test/src/mbgl/test/sqlite3_test_fs.hpp
diff options
context:
space:
mode:
authorWilhelm Berg <wb@BergWerk-GIS.at>2018-08-22 16:56:32 +0200
committerWilhelm Berg <wb@BergWerk-GIS.at>2018-08-22 16:56:32 +0200
commit797f622a26b34db5a30e7f1728d87c6700a2ec1e (patch)
tree75ea93979db2baf3eb2234c6fbb3d1a9c5b70329 /test/src/mbgl/test/sqlite3_test_fs.hpp
parent86fc3f525e42d042f239876b93525ff411ad7182 (diff)
parent520df7f02049cdbbb9e68041e755d6c3a8d5b21f (diff)
downloadqtlocation-mapboxgl-797f622a26b34db5a30e7f1728d87c6700a2ec1e.tar.gz
Merge branch 'master' of github.com:mapbox/mapbox-gl-native into bwg-vs2017
Diffstat (limited to 'test/src/mbgl/test/sqlite3_test_fs.hpp')
-rw-r--r--test/src/mbgl/test/sqlite3_test_fs.hpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/src/mbgl/test/sqlite3_test_fs.hpp b/test/src/mbgl/test/sqlite3_test_fs.hpp
new file mode 100644
index 0000000000..00351f49ac
--- /dev/null
+++ b/test/src/mbgl/test/sqlite3_test_fs.hpp
@@ -0,0 +1,39 @@
+#pragma once
+
+#include <cstdint>
+
+namespace mbgl {
+namespace test {
+
+class SQLite3TestFS {
+public:
+ SQLite3TestFS();
+ ~SQLite3TestFS();
+
+ // When enabled, the VFS will log all I/O operations to stdout.
+ void setDebug(bool);
+
+ // Allow any type of I/O. Will fail with SQLITE_AUTH if set to false. This is useful to simulate
+ // scenarios where the OS blocks an entire app's I/O, e.g. when it's in the background.
+ void allowIO(bool);
+
+ // Allow files to be opened. Will fail with SQLITE_CANTOPEN if set to false.
+ void allowFileOpen(bool);
+
+ // Allow files to be created. Will fail with SQLITE_CANTOPEN if set to false.
+ void allowFileCreate(bool);
+
+ // Allow N bytes to be read, then fail reads with SQLITE_IOERR. -1 == unlimited
+ // This limit is global, not per file.
+ void setReadLimit(int64_t);
+
+ // Allow N bytes to be written, then fail writes with SQLITE_FULL. -1 == unlimited
+ // This limit is global, not per file.
+ void setWriteLimit(int64_t);
+
+ // Reset all restrictions.
+ void reset();
+};
+
+} // namespace test
+} // namespace mbgl