Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1031653 // test_PersistentManagedObjects_v1

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (5530L) is out of date.

svoid test_PersistentManagedObjects_v1() {
  PersistentManagedObjects_v1<ManagedString> pm = new((_mem, addr) -> ManagedString.load(_mem, addr));
  ManagedString s = pm.getUserData();
  assertNullVerbose("userData", s);
  pm.setUserData(ManagedString.create(pm.mem, "Hello world"));
  s = pm.getUserData();
  assertEqualsVerbose("Hello world", str(s));
  print("Mem size: " + pm.mem.size());
  pm.flush();
  
  ManagedIntObjects_v1 mem = new(pm.mem.mem);
  pm = new PersistentManagedObjects_v1<ManagedString>(mem, pm.makeUserObject);
  s = pm.getUserData();
  assertEqualsVerbose("Hello world", str(s));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031653
Snippet name: test_PersistentManagedObjects_v1
Eternal ID of this version: #1031653/11
Text MD5: e34ee525a6b7ab4d9af3dfbb9434ea66
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-25 09:46:49
Source code size: 619 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 173 / 289
Version history: 10 change(s)
Referenced in: [show references]