Fix Windows UTF-8 build flag (#623)

Co-authored-by: Oleksandr Anyshchenko <oleksandr.anyshchenko@xdev.re>
master
Rajiv Shah 3 years ago committed by GitHub
parent cad6e50b2e
commit 59434f93ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      librocksdb-sys/build.rs
  2. 17
      tests/test_db.rs

@ -171,7 +171,7 @@ fn build_rocksdb() {
config.define("_MBCS", None);
config.define("WIN64", None);
config.define("NOMINMAX", None);
config.define("WITH_WINDOWS_UTF8_FILENAMES", "ON");
config.define("ROCKSDB_WINDOWS_UTF8_FILENAMES", None);
if &target == "x86_64-pc-windows-gnu" {
// Tell MinGW to create localtime_r wrapper of localtime_s function.

@ -618,6 +618,23 @@ fn test_open_with_multiple_refs_as_single_threaded() {
t.compile_fail("tests/fail/open_with_multiple_refs_as_single_threaded.rs");
}
#[test]
fn test_open_utf8_path() {
let path = DBPath::new("_rust_rocksdb_utf8_path_temporärer_Ordner");
{
let db = DB::open_default(&path).unwrap();
assert!(db.put(b"k1", b"v1111").is_ok());
let r: Result<Option<Vec<u8>>, Error> = db.get(b"k1");
assert_eq!(r.unwrap().unwrap(), b"v1111");
assert!(db.delete(b"k1").is_ok());
assert!(db.get(b"k1").unwrap().is_none());
}
}
#[test]
fn compact_range_test() {
let path = DBPath::new("_rust_rocksdb_compact_range_test");

Loading…
Cancel
Save