Skip to content

Commit

Permalink
Add a test to reproduce the thread safe reference error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Frei committed Mar 5, 2021
1 parent 8b0fbf3 commit b64aa00
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/object-store/thread_safe_reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,20 @@ TEST_CASE("thread safe reference") {
}

SECTION("passing over") {

SECTION("read only") {
TestFile configuration;
SharedRealm realm = Realm::get_shared_realm(configuration);
realm->update_schema(schema);
realm->close();

configuration.schema_mode = SchemaMode::Immutable;
SharedRealm readOnlyRealm = Realm::get_shared_realm(configuration);
auto table = readOnlyRealm->read_group().get_table("class_int object");
Results results(readOnlyRealm, table);
auto threadSafeReference = ThreadSafeReference(results);
}

SECTION("objects") {
r->begin_transaction();
auto str = create_object(r, "string object", {});
Expand Down

0 comments on commit b64aa00

Please sign in to comment.