RegressionTests__Win32OperatingSystemTest.st
author Patrik Svestka <patrik.svestka@gmail.com>
Fri, 01 Feb 2019 16:12:13 +0100
branchjv
changeset 2086 677b483367cf
parent 2085 823598772842
child 2087 43b964e25f8a
permissions -rwxr-xr-x
Issue #250: and #252: complete list of regression tests for Reading, Writing, Creating, Opeing, Deleting windows registry

"{ Encoding: utf8 }"

"
 COPYRIGHT (c) Claus Gittinger / eXept Software AG
 COPYRIGHT (c) 2016 Jan Vrany
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:goodies/regression' }"

"{ NameSpace: RegressionTests }"

TestCase subclass:#Win32OperatingSystemTest
	instanceVariableNames:'registryPath'
	classVariableNames:''
	poolDictionaries:''
	category:'tests-Regression-RuntimeSystem'
!

!Win32OperatingSystemTest class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) Claus Gittinger / eXept Software AG
 COPYRIGHT (c) 2016 Jan Vrany
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
! !

!Win32OperatingSystemTest methodsFor:'file templates'!

unicodeRegistryExample

^  'Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\SmalltalkX-tests]
@="しか OMG"
"emptyToTest"=""
"testEmptyMultiSZ"=hex(7):00,00
"bledesu"="''Testing Unicode chars ř ž č ルすしかき'').          "
"しかき    "="Testus gradus"
" ř ž č ル.          "="Testing Unicode chars ř ž č ルすしかき"
"zero"=hex:
"non-zero"=hex:11,10
"す    "=hex:10
"dword_value"=dword:000023af
"11"="A number name"
"き"=dword:234234af
"qwordvalue"=hex(b):ad,61,28,a3,95,0e,74,79
"qword_max"=hex(b):ff,ff,ff,ff,ff,ff,ff,ff
"すし"=hex(b):ef,ad,00,00,00,00,00,00
"Font_Leelawadee UI Bold"=hex(7):53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,\
  00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,\
  49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,\
  00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,\
  46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,\
  00,6c,00,64,00,00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,\
  54,00,43,00,2c,00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,\
  00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,\
  4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,\
  00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,\
  64,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,\
  65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,\
  00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,\
  48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,\
  00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,\
  69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,\
  00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,\
  6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,\
  36,00,00,00,4d,00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,\
  48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,\
  4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,\
  00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,\
  00,00,4d,00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,\
  00,2c,00,4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,\
  69,00,63,00,20,00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,\
  00,48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,\
  74,00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,\
  00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,\
  48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,\
  00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,\
  53,00,45,00,47,00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,\
  00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,\
  62,00,6f,00,6c,00,00,00,00,00
"ř ž č ルすしか"=hex(7):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,\
  00,6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,\
  20,00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,\
  00,29,00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,\
  54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,\
  00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,00,00,00,53,00,\
  45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,46,00,2c,00,53,\
  00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,\
  00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,\
  6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,45,00,49,\
  00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,65,00,69,00,\
  72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,\
  00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,\
  31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,\
  00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,\
  66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,00,48,00,42,00,\
  44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,\
  00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,\
  42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,4d,\
  00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,\
  00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,41,00,4c,00,\
  47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,61,00,6c,\
  00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,00,42,00,\
  6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,00,00,4d,00,41,\
  00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,\
  61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,\
  00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,\
  2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,\
  00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,\
  38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,2e,\
  00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,\
  63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,53,00,45,00,47,\
  00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,\
  67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,62,00,6f,00,6c,\
  00,00,00,00,00
"Ugh"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,6e,00,\
  69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,00,59,\
  01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,29,00,\
  2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,00
" č ルすしか"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,\
  6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,\
  00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,\
  29,00,2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,\
  00
[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_empty]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか]
"bledesu"="''Testing Unicode chars ř ž č ルすしかき'').          "
"しかき    "="Testus gradus"
" ř ž č ル.          "="Testing Unicode chars ř ž č ルすしかき"
"zero"=hex:
"non-zero"=hex:11,10
"す    "=hex:10
"dword_value"=dword:000023af
"き"=dword:234234af
"qwordvalue"=hex(b):ad,61,28,a3,95,0e,74,79
"qword_max"=hex(b):ff,ff,ff,ff,ff,ff,ff,ff
"すし"=hex(b):ef,ad,00,00,00,00,00,00
"Font_Leelawadee UI Bold"=hex(7):53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,\
  00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,\
  49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,\
  00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,\
  46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,\
  00,6c,00,64,00,00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,\
  54,00,43,00,2c,00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,\
  00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,\
  4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,\
  00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,\
  64,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,\
  65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,\
  00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,\
  48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,\
  00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,\
  69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,\
  00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,\
  6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,\
  36,00,00,00,4d,00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,\
  48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,\
  4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,\
  00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,\
  00,00,4d,00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,\
  00,2c,00,4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,\
  69,00,63,00,20,00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,\
  00,48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,\
  74,00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,\
  00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,\
  48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,\
  00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,\
  53,00,45,00,47,00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,\
  00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,\
  62,00,6f,00,6c,00,00,00,00,00
"ř ž č ルすしか"=hex(7):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,\
  00,6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,\
  20,00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,\
  00,29,00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,\
  54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,\
  00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,00,00,00,53,00,\
  45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,46,00,2c,00,53,\
  00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,\
  00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,\
  6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,45,00,49,\
  00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,65,00,69,00,\
  72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,\
  00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,\
  31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,\
  00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,\
  66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,00,48,00,42,00,\
  44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,\
  00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,\
  42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,4d,\
  00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,\
  00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,41,00,4c,00,\
  47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,61,00,6c,\
  00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,00,42,00,\
  6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,00,00,4d,00,41,\
  00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,\
  61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,\
  00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,\
  2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,\
  00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,\
  38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,2e,\
  00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,\
  63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,53,00,45,00,47,\
  00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,\
  67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,62,00,6f,00,6c,\
  00,00,00,00,00
"Ugh"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,6e,00,\
  69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,00,59,\
  01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,29,00,\
  2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,00
" č ルすしか"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,\
  6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,\
  00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,\
  29,00,2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,\
  00

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end]
"testing"=" ルすしか"
"か"=dword:00000002
"256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end"="Longer_than_256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|endsdfsdfasdfasdfasdfjlkasdjflkasjdflkjasdlfjaslkdfjlkasdjflkasdflksadlkjsadlfalsdfůlasdjflkasdjflkasjdflkůjasdflůkjasdlůfjalsůkdjflůksd"

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end\unreachable]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end\reachable]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\ughu]
"bledesu"="''Testing Unicode chars ř ž č ルすしかき'').          "
"しかき    "="Testus gradus"
" ř ž č ル.          "="Testing Unicode chars ř ž č ルすしかき"
"zero"=hex:
"non-zero"=hex:11,10
"す    "=hex:10
"dword_value"=dword:000023af
"き"=dword:234234af
"qwordvalue"=hex(b):ad,61,28,a3,95,0e,74,79
"qword_max"=hex(b):ff,ff,ff,ff,ff,ff,ff,ff
"すし"=hex(b):ef,ad,00,00,00,00,00,00
"Font_Leelawadee UI Bold"=hex(7):53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,\
  00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,\
  49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,\
  00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,\
  46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,\
  00,6c,00,64,00,00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,\
  54,00,43,00,2c,00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,\
  00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,\
  4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,\
  00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,\
  64,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,\
  65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,\
  00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,\
  48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,\
  00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,\
  69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,\
  00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,\
  6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,\
  36,00,00,00,4d,00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,\
  48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,\
  4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,\
  00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,\
  00,00,4d,00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,\
  00,2c,00,4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,\
  69,00,63,00,20,00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,\
  00,48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,\
  74,00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,\
  00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,\
  48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,\
  00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,\
  53,00,45,00,47,00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,\
  00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,\
  62,00,6f,00,6c,00,00,00,00,00
"ř ž č ルすしか"=hex(7):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,\
  00,6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,\
  20,00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,\
  00,29,00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,\
  54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,\
  00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,00,00,00,53,00,\
  45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,46,00,2c,00,53,\
  00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,\
  00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,\
  6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,45,00,49,\
  00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,65,00,69,00,\
  72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,\
  00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,\
  31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,\
  00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,\
  66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,00,48,00,42,00,\
  44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,\
  00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,\
  42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,4d,\
  00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,\
  00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,41,00,4c,00,\
  47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,61,00,6c,\
  00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,00,42,00,\
  6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,00,00,4d,00,41,\
  00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,\
  61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,\
  00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,\
  2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,\
  00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,\
  38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,2e,\
  00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,\
  63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,53,00,45,00,47,\
  00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,\
  67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,62,00,6f,00,6c,\
  00,00,00,00,00
"Ugh"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,6e,00,\
  69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,00,59,\
  01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,29,00,\
  2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,00
" č ルすしか"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,\
  6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,\
  00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,\
  29,00,2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,\
  00
[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\zubr]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\reg-none]
@=hex(0):

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\bobr]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\bobr\boříččátka]
'

    "Created: / 16-11-2018 / 11:24:57 / svestkap"
    "Modified: / 01-02-2019 / 13:08:58 / svestkap"
!

unicodeRegistryExample32bit

^  'Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\SmalltalkX-tests]
@="しか OMG"
"emptyToTest"=""
"testEmptyMultiSZ"=hex(7):00,00
"bledesu"="''Testing Unicode chars ř ž č ルすしかき'').          "
"しかき    "="Testus gradus"
" ř ž č ル.          "="Testing Unicode chars ř ž č ルすしかき"
"zero"=hex:
"non-zero"=hex:11,10
"す    "=hex:10
"dword_value"=dword:000023af
"11"="A number name"
"き"=dword:234234af
"Font_Leelawadee UI Bold"=hex(7):53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,\
  00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,\
  49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,\
  00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,\
  46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,\
  00,6c,00,64,00,00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,\
  54,00,43,00,2c,00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,\
  00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,\
  4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,\
  00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,\
  64,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,\
  65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,\
  00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,\
  48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,\
  00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,\
  69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,\
  00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,\
  6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,\
  36,00,00,00,4d,00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,\
  48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,\
  4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,\
  00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,\
  00,00,4d,00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,\
  00,2c,00,4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,\
  69,00,63,00,20,00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,\
  00,48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,\
  74,00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,\
  00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,\
  48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,\
  00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,\
  53,00,45,00,47,00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,\
  00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,\
  62,00,6f,00,6c,00,00,00,00,00
"ř ž č ルすしか"=hex(7):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,\
  00,6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,\
  20,00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,\
  00,29,00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,\
  54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,\
  00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,00,00,00,53,00,\
  45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,46,00,2c,00,53,\
  00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,\
  00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,\
  6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,45,00,49,\
  00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,65,00,69,00,\
  72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,\
  00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,\
  31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,\
  00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,\
  66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,00,48,00,42,00,\
  44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,\
  00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,\
  42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,4d,\
  00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,\
  00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,41,00,4c,00,\
  47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,61,00,6c,\
  00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,00,42,00,\
  6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,00,00,4d,00,41,\
  00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,\
  61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,\
  00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,\
  2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,\
  00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,\
  38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,2e,\
  00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,\
  63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,53,00,45,00,47,\
  00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,\
  67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,62,00,6f,00,6c,\
  00,00,00,00,00
"Ugh"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,6e,00,\
  69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,00,59,\
  01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,29,00,\
  2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,00
" č ルすしか"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,\
  6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,\
  00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,\
  29,00,2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,\
  00
[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_empty]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか]
"bledesu"="''Testing Unicode chars ř ž č ルすしかき'').          "
"しかき    "="Testus gradus"
" ř ž č ル.          "="Testing Unicode chars ř ž č ルすしかき"
"zero"=hex:
"non-zero"=hex:11,10
"す    "=hex:10
"dword_value"=dword:000023af
"き"=dword:234234af
"Font_Leelawadee UI Bold"=hex(7):53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,\
  00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,\
  49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,\
  00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,\
  46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,\
  00,6c,00,64,00,00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,\
  54,00,43,00,2c,00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,\
  00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,\
  4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,\
  00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,\
  64,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,\
  65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,\
  00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,\
  48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,\
  00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,\
  69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,\
  00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,\
  6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,\
  36,00,00,00,4d,00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,\
  48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,\
  4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,\
  00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,\
  00,00,4d,00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,\
  00,2c,00,4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,\
  69,00,63,00,20,00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,\
  00,48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,\
  74,00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,\
  00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,\
  48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,\
  00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,\
  53,00,45,00,47,00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,\
  00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,\
  62,00,6f,00,6c,00,00,00,00,00
"ř ž č ルすしか"=hex(7):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,\
  00,6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,\
  20,00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,\
  00,29,00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,\
  54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,\
  00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,00,00,00,53,00,\
  45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,46,00,2c,00,53,\
  00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,\
  00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,\
  6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,45,00,49,\
  00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,65,00,69,00,\
  72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,\
  00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,\
  31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,\
  00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,\
  66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,00,48,00,42,00,\
  44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,\
  00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,\
  42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,4d,\
  00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,\
  00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,41,00,4c,00,\
  47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,61,00,6c,\
  00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,00,42,00,\
  6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,00,00,4d,00,41,\
  00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,\
  61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,\
  00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,\
  2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,\
  00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,\
  38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,2e,\
  00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,\
  63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,53,00,45,00,47,\
  00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,\
  67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,62,00,6f,00,6c,\
  00,00,00,00,00
"Ugh"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,6e,00,\
  69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,00,59,\
  01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,29,00,\
  2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,00
" č ルすしか"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,\
  6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,\
  00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,\
  29,00,2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,\
  00

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end]
"testing"=" ルすしか"
"か"=dword:00000002
"256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end"="Longer_than_256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|endsdfsdfasdfasdfasdfjlkasdjflkasjdflkjasdlfjaslkdfjlkasdjflkasdflksadlkjsadlfalsdfůlasdjflkasdjflkasjdflkůjasdflůkjasdlůfjalsůkdjflůksd"

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end\unreachable]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end\reachable]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\ughu]
"bledesu"="''Testing Unicode chars ř ž č ルすしかき'').          "
"しかき    "="Testus gradus"
" ř ž č ル.          "="Testing Unicode chars ř ž č ルすしかき"
"zero"=hex:
"non-zero"=hex:11,10
"す    "=hex:10
"dword_value"=dword:000023af
"き"=dword:234234af
"Font_Leelawadee UI Bold"=hex(7):53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,\
  00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,\
  49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,\
  00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,\
  46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,\
  00,6c,00,64,00,00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,\
  54,00,43,00,2c,00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,\
  00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,\
  4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,\
  00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,\
  64,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,\
  65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,\
  00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,\
  48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,\
  00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,\
  69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,\
  00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,\
  6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,\
  36,00,00,00,4d,00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,\
  48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,\
  4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,\
  00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,\
  00,00,4d,00,41,00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,\
  00,2c,00,4d,00,61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,\
  69,00,63,00,20,00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,\
  00,48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,\
  74,00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,\
  00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,\
  48,00,42,00,2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,\
  00,68,00,69,00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,\
  53,00,45,00,47,00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,\
  00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,\
  62,00,6f,00,6c,00,00,00,00,00
"ř ž č ルすしか"=hex(7):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,\
  00,6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,\
  20,00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,\
  00,29,00,00,00,53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,\
  54,00,46,00,2c,00,53,00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,\
  00,6f,00,6c,00,64,00,2c,00,31,00,31,00,30,00,2c,00,38,00,32,00,00,00,53,00,\
  45,00,47,00,4f,00,45,00,55,00,49,00,42,00,2e,00,54,00,54,00,46,00,2c,00,53,\
  00,65,00,67,00,6f,00,65,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,\
  00,00,4d,00,45,00,49,00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,\
  00,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,\
  6c,00,64,00,2c,00,31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,45,00,49,\
  00,52,00,59,00,4f,00,42,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,65,00,69,00,\
  72,00,79,00,6f,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,\
  00,53,00,4a,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,\
  00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,\
  31,00,32,00,30,00,2c,00,39,00,36,00,00,00,4d,00,53,00,4a,00,48,00,42,00,44,\
  00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,\
  66,00,74,00,20,00,4a,00,68,00,65,00,6e,00,67,00,48,00,65,00,69,00,20,00,55,\
  00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,53,00,59,00,48,00,42,00,\
  44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,\
  00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,00,20,00,55,00,49,00,20,00,\
  42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,38,00,2c,00,39,00,36,00,00,00,4d,\
  00,53,00,59,00,48,00,42,00,44,00,2e,00,54,00,54,00,43,00,2c,00,4d,00,69,00,\
  63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,59,00,61,00,48,00,65,00,69,\
  00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,4d,00,41,00,4c,00,\
  47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,61,00,6c,\
  00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,00,42,00,\
  6f,00,6c,00,64,00,2c,00,31,00,31,00,38,00,2c,00,39,00,36,00,00,00,4d,00,41,\
  00,4c,00,47,00,55,00,4e,00,42,00,44,00,2e,00,54,00,54,00,46,00,2c,00,4d,00,\
  61,00,6c,00,67,00,75,00,6e,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,20,\
  00,42,00,6f,00,6c,00,64,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,\
  2e,00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,\
  00,63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,2c,00,31,00,32,00,\
  38,00,2c,00,39,00,36,00,00,00,59,00,55,00,47,00,4f,00,54,00,48,00,42,00,2e,\
  00,54,00,54,00,43,00,2c,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,\
  63,00,20,00,55,00,49,00,20,00,42,00,6f,00,6c,00,64,00,00,00,53,00,45,00,47,\
  00,55,00,49,00,53,00,59,00,4d,00,2e,00,54,00,54,00,46,00,2c,00,53,00,65,00,\
  67,00,6f,00,65,00,20,00,55,00,49,00,20,00,53,00,79,00,6d,00,62,00,6f,00,6c,\
  00,00,00,00,00
"Ugh"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,6e,00,\
  69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,00,59,\
  01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,29,00,\
  2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,00
" č ルすしか"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,\
  6e,00,69,00,63,00,6f,00,64,00,65,00,20,00,63,00,68,00,61,00,72,00,73,00,20,\
  00,59,01,20,00,7e,01,20,00,0d,01,20,00,eb,30,59,30,57,30,4b,30,4d,30,27,00,\
  29,00,2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,\
  00
[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\zubr]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\reg-none]
@=hex(0):

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\bobr]

[HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\bobr\boříččátka]
'

    "Created: / 01-02-2019 / 15:17:59 / svestkap"
! !

!Win32OperatingSystemTest methodsFor:'release'!

setUp
    | registryToImport file |

    self skipIf: OperatingSystem isMSWINDOWSlike not description: 'Windows only tests (registry manipulation)'.
    super setUp.    

    registryToImport := (OperatingSystem getSystemInfo at: #architecture) = #x64 ifTrue: [ self unicodeRegistryExample ]
                                                                                ifFalse: [ self unicodeRegistryExample32bit ].
    
    "/ registry path which will be used  
    registryPath := registryToImport 
        copyFrom: (registryToImport indexOf: $[) + 1
        to: (registryToImport indexOf: $]) - 1.       
        
    "/ temporary file which will be used for importing
    file := Filename newTemporary.

    "/ Registry export is in UTF-16LE with BOM

    " What is BOM?
      A byte order mark (BOM) consists of the character code U+FEFF at the beginning of a data stream, where it can be used as a signature 
      defining the byte order and encoding form, primarily of unmarked plaintext files. Under some higher level protocols, use of a BOM may
      be mandatory (or prohibited) in the Unicode data stream defined in that protocol."

    "/ needed to write to file as Windows Registry do UTF16-LE With Signature
    " BOM for UTF-16is:
       FE FF    UTF-16, big-endian (BE)
       FF FE    UTF-16, little-endian (LE)"
    
    "/ Writing BOM first
    file writingFileDo: [ :stream |         
       stream nextPutUtf16: (Character codePoint:16rFFFE)         
    ].    
    
    "/ this is UTF16-LE (Little Endian) Without Signature (BOM)
    file appendingFileDo: [ :stream | stream nextPutAllUtf16Bytes: registryToImport MSB: false].
     
    [   "/ adding registry entry so we can test it
        OperatingSystem getCommandOutputFrom: ('REG IMPORT ' , file asString)
    ] ensure: [ file remove ].

    "Created: / 28-12-2016 / 22:12:14 / jv"
    "Modified: / 01-02-2019 / 15:24:07 / svestkap"
!

tearDown
    self skipIf: OperatingSystem isMSWINDOWSlike not description: 'Windows specific tests'.
    super tearDown.
    
    "/ remove the added registry entry
    OperatingSystem getCommandOutputFrom:('REG DELETE "', registryPath, '" /f').

    "/ Check if testing registry was correctly deleted
    self assert: ((OperatingSystem registryEntry key: registryPath) isNil).

    "Created: / 16-11-2018 / 11:29:12 / svestkap"
! !

!Win32OperatingSystemTest methodsFor:'tests'!

testMutex
    |handle alreadyExists lastErrorCode handleAndLastErrorCode|

    handleAndLastErrorCode := Win32OperatingSystem createMutexNamed: UUID new printString.
    handle := handleAndLastErrorCode first.
    handle isNil ifTrue:[^ self].
    lastErrorCode := handleAndLastErrorCode second.
    self assert: lastErrorCode == 0.
    alreadyExists := (lastErrorCode == 5 "ERROR_ACCESS_DENIED" or:[ lastErrorCode == 183 "ERROR_ALREADY_EXISTS"]).
    alreadyExists ifTrue:[
        Transcript showCR: 'Mutex already exists!!'.
        ^ self.
    ].
    [
        Transcript showCR: 'Mutex created!!'.
        Win32OperatingSystem waitForSingleObject: handle.
        Delay waitForSeconds:0.5. "/ self halt.
        Win32OperatingSystem releaseMutex: handle.
    ] ensure:[
        Win32OperatingSystem primCloseHandle: handle.
        Transcript showCR: 'Mutex closed!!'.
    ].


    "
     self new testMutex
    "

    "Modified: / 28-06-2018 / 09:14:35 / jv"
!

testRegistry
    |k hasContentType|

    k := OperatingSystem registryEntry key:'HKEY_CLASSES_ROOT\MIME\Database\'.
    self assert:(k notNil).

    hasContentType := false.
    k subKeyNamesAndClassesDo:[:nm :clsNm |
        "/ Transcript showCR:nm.
        nm = 'Content Type' ifTrue:[hasContentType := true].
    ].
    self assert:hasContentType.

    "/ k subKeysDo:[:k | Transcript showCR:k].

    "
     self new testRegistry
    "

    "Modified: / 28-12-2016 / 22:13:43 / jv"
!

testRegistry02a
    | root key |

    root :=OperatingSystem registryEntry key:'HKEY_CURRENT_USER'.
    root deleteSubKeyNamed: testSelector.

    self assert:(root subKeyNamed: testSelector) isNil.
    self deny: (root deleteSubKeyNamed: testSelector).

    key := root createSubKeyNamed:testSelector.
    self assert: key notNil.
    self assert:(root subKeyNamed: testSelector) notNil.

    self assert: (root deleteSubKeyNamed:testSelector).
    self assert:(root subKeyNamed: testSelector) isNil.
    self deny: (root deleteSubKeyNamed: testSelector).

    "Created: / 28-12-2016 / 23:14:15 / jv"
    "Modified: / 05-01-2017 / 21:45:20 / jv"
! !

!Win32OperatingSystemTest methodsFor:'tests-UnicodeCreate'!

testCreatingSubKeyNamed_01
    "Testing if new subKey is created"
    | readData testingRegistryPath readSubKeys subKeysCount |   
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ creating the new subKey    
    readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: nil createIfAbsent: true.
    "/ check if new path is with the subKeyNamed above
    self assert: (readData path copyAfterLast: $\) = 'bledesu ル' .
    
    readSubKeys := testingRegistryPath subKeys.
    self assert: readSubKeys size = (subKeysCount + 1)
    
    "
     self run:#testCreatingSubKeyNamed_01
     self new testCreatingSubKeyNamed_01
    "

    "Created: / 07-12-2018 / 15:30:55 / svestkap"
!

testCreatingSubKeyNamed_02
    "Testing if new subKey is created via createSubKeyNamed:"
    | readData testingRegistryPath readSubKeys subKeysCount |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.

    self assert: subKeysCount = 3.
    "/ creating the new subKey    
    readData := testingRegistryPath createSubKeyNamed: 'bledesu ル'.
    "/ check if new path is with the subKeyNamed above
    self assert: (readData path copyAfterLast: $\) = 'bledesu ル' .

    readSubKeys := testingRegistryPath subKeys.
    self assert: readSubKeys size = (subKeysCount + 1)

    "
     self run:#testCreatingSubKeyNamed_02
     self new testCreatingSubKeyNamed_02
    "

    "Created: / 07-12-2018 / 15:57:09 / svestkap"
!

testCreatingSubKeyNamed_Wow64_32_01
    "Testing if new subKey is created in Wow64_32 (32bit program reading 32bit registry)"
    | readData testingRegistryPath readSubKeys subKeysCount |

    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.      
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ creating the new subKey    
    readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: #KEY_WOW64_32KEY createIfAbsent: true.
    "/ check if new path is with the subKeyNamed above
    self assert: (readData path copyAfterLast: $\) = 'bledesu ル' .
    
    readSubKeys := testingRegistryPath subKeys.
    self assert: readSubKeys size = (subKeysCount + 1)

    "
     self run:#testCreatingSubKeyNamed_Wow64_32_01
     self new testCreatingSubKeyNamed_Wow64_32_01
    "

    "Created: / 07-12-2018 / 15:58:24 / svestkap"
!

testCreatingSubKeyNamed_Wow64_32_02
    "Testing if new subKey is created in Wow64_32 (32bit program reading 32bit registry) via createSubKeyNamed:flags:"
    | readData testingRegistryPath readSubKeys subKeysCount |

    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.      

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.

    self assert: subKeysCount = 3.
    "/ creating the new subKey    
    readData := testingRegistryPath createSubKeyNamed: 'bledesu ル' flags: #KEY_WOW64_32KEY.
    "/ check if new path is with the subKeyNamed above
    self assert: (readData path copyAfterLast: $\) = 'bledesu ル' .

    readSubKeys := testingRegistryPath subKeys.
    self assert: readSubKeys size = (subKeysCount + 1)

    "
     self run:#testCreatingSubKeyNamed_Wow64_32_02
     self new testCreatingSubKeyNamed_Wow64_32_02
    "

    "Created: / 07-12-2018 / 15:59:32 / svestkap"
!

testCreatingSubKeyNamed_Wow64_64_01
    "Testing if new subKey is created in Wow64_32 (32bit program reading 64bit registry)"
    | readData testingRegistryPath readSubKeys subKeysCount |

    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.      
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ creating the new subKey    
    readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: #KEY_WOW64_64KEY createIfAbsent: true.
    "/ check if new path is with the subKeyNamed above
    self assert: (readData path copyAfterLast: $\) = 'bledesu ル' .
    
    readSubKeys := testingRegistryPath subKeys.
    self assert: readSubKeys size = (subKeysCount + 1)

    "
     self run:#testCreatingSubKeyNamed_Wow64_64_01
     self new testCreatingSubKeyNamed_Wow64_64_01
    "

    "Created: / 07-12-2018 / 15:58:38 / svestkap"
!

testCreatingSubKeyNamed_Wow64_64_02
    "Testing if new subKey is created in Wow64_32 (32bit program reading 64bit registry) via createSubKeyNamed:flags:"
    | readData testingRegistryPath readSubKeys subKeysCount |

    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.      
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ creating the new subKey    
    readData := testingRegistryPath createSubKeyNamed: 'bledesu ル' flags: #KEY_WOW64_64KEY.
    "/ check if new path is with the subKeyNamed above
    self assert: (readData path copyAfterLast: $\) = 'bledesu ル' .
    
    readSubKeys := testingRegistryPath subKeys.
    self assert: readSubKeys size = (subKeysCount + 1)

    "
     self run:#testCreatingSubKeyNamed_Wow64_64_02
     self new testCreatingSubKeyNamed_Wow64_64_02
    "

    "Created: / 07-12-2018 / 15:59:50 / svestkap"
! !

!Win32OperatingSystemTest methodsFor:'tests-UnicodeOpen'!

testOpenSubKeyNamed_01
    "Testing if an old subKey is opened"
    | readData testingRegistryPath readSubKeys subKeysCount |
   
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ trying to read already existing subKey    
    readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: nil createIfAbsent: false.

    "/ check if the existing
    self assert: (readData path copyAfterLast: $\) = ' ルすしか'.    
    
    "
     self run:#testOpenSubKeyNamed_01
     self new testOpenSubKeyNamed_01
    "

    "Created: / 07-12-2018 / 15:34:21 / svestkap"
!

testOpenSubKeyNamed_02
    "Testing if an old subKey is opened"
    | readData testingRegistryPath readSubKeys subKeysCount |
     
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ trying to read already existing subKey    
    readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: nil createIfAbsent: true.

    "/ check if the existing
    self assert: (readData path copyAfterLast: $\) = ' ルすしか'.    
    
    "
     self run:#testOpenSubKeyNamed_02
     self new testOpenSubKeyNamed_02
    "

    "Created: / 07-12-2018 / 15:36:27 / svestkap"
!

testOpenSubKeyNamed_03
    "Testing if an old subKey is opened via subKeyNamed:"
    | readData testingRegistryPath readSubKeys subKeysCount |
     
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ trying to read already existing subKey    
    readData := testingRegistryPath subKeyNamed: ' ルすしか'.

    "/ check if the existing
    self assert: (readData path copyAfterLast: $\) = ' ルすしか'.    
    
    "
     self run:#testOpenSubKeyNamed_03
     self new testOpenSubKeyNamed_03
    "

    "Created: / 07-12-2018 / 15:47:59 / svestkap"
!

testOpenSubKeyNamed_04
    "Testing if an old subKey is opened via subKeyNamed:createIfAbsent:"
    | readData testingRegistryPath readSubKeys subKeysCount |
     
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ trying to read already existing subKey    
    readData := testingRegistryPath subKeyNamed: ' ルすしか' createIfAbsent: true.

    "/ check if the existing
    self assert: (readData path copyAfterLast: $\) = ' ルすしか'.    
    
    "
     self run:#testOpenSubKeyNamed_04
     self new testOpenSubKeyNamed_04
    "

    "Created: / 07-12-2018 / 15:51:52 / svestkap"
!

testOpenSubKeyNamed_05
    "Testing an error is raised when number is used to access the subKey via subKeyNamed:createIfAbsent:"
    | testingRegistryPath readSubKeys subKeysCount |
     
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ trying to read already existing subKey    
    self should: [ testingRegistryPath subKeyNamed: 11 createIfAbsent: true ] 
         raise: Error 
         suchThat: [ :e | e messageText = 'subKeyString is not a string!!' ]
         
    "
     self run:#testOpenSubKeyNamed_05
     self new testOpenSubKeyNamed_05
    "

    "Created: / 01-02-2019 / 15:58:49 / svestkap"
!

testOpenSubKeyNamed_Wow64_32_01 
    "Testing if an old subKey is opened in Wow64_32 (32bit program reading 32bit registry)"
    | readData testingRegistryPath readSubKeys subKeysCount |
   
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.         
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ trying to read already existing subKey    
    readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: #KEY_WOW64_32KEY createIfAbsent: false.

    "/ check if the existing
    self assert: (readData path copyAfterLast: $\) = ' ルすしか'.    
    
    "
     self run:#testOpenSubKeyNamed_Wow64_32_01
     self new testOpenSubKeyNamed_Wow64_32_01
    "

    "Created: / 07-12-2018 / 15:53:04 / svestkap"
!

testOpenSubKeyNamed_Wow64_32_02
    "Testing if an old subKey is opened in Wow64_32 (32bit program reading 32bit registry) via subKeyNamed:flags:"
    | readData testingRegistryPath readSubKeys subKeysCount |
   
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.         
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ trying to read already existing subKey    
    readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: #KEY_WOW64_32KEY.

    "/ check if the existing
    self assert: (readData path copyAfterLast: $\) = ' ルすしか'.    
    
    "
     self run:#testOpenSubKeyNamed_Wow64_32_02
     self new testOpenSubKeyNamed_Wow64_32_02
    "

    "Created: / 07-12-2018 / 15:54:31 / svestkap"
!

testOpenSubKeyNamed_Wow64_64_01
    "Testing if an old subKey is opened in Wow64_64 (32bit program reading 64bit registry)"
    | readData testingRegistryPath readSubKeys subKeysCount |
   
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.         
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ trying to read already existing subKey    
    readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: #KEY_WOW64_64KEY createIfAbsent: false.

    "/ check if the existing
    self assert: (readData path copyAfterLast: $\) = ' ルすしか'.    
    
    "
     self run:#testOpenSubKeyNamed_Wow64_64_01
     self new testOpenSubKeyNamed_Wow64_64_01
    "

    "Created: / 07-12-2018 / 15:53:34 / svestkap"
!

testOpenSubKeyNamed_Wow64_64_02
    "Testing if an old subKey is opened in Wow64_64 (32bit program reading 64bit registry) via subKeyNamed:flags:"
    | readData testingRegistryPath readSubKeys subKeysCount |
   
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.         
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ trying to read already existing subKey    
    readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: #KEY_WOW64_64KEY.

    "/ check if the existing
    self assert: (readData path copyAfterLast: $\) = ' ルすしか'.    
    
    "
     self run:#testOpenSubKeyNamed_Wow64_64_02
     self new testOpenSubKeyNamed_Wow64_64_02
    "

    "Created: / 07-12-2018 / 15:55:07 / svestkap"
!

testOpenSubKeyNamed_nonExistingWow64_32
    "Trying to read non-existing subKey in Wow64_32 (32bit program reading 32bit registry)"
    | readData testingRegistryPath readSubKeys subKeysCount |
   
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.         
              
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ trying to read non-existent subKey    
    readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: #KEY_WOW64_32KEY createIfAbsent: false.
    "/ check if new path is with the subKeyNamed above

    self assert: readData isNil
    
    "
     self run:#testOpenSubKeyNamed_nonExistingWow64_32
     self new testOpenSubKeyNamed_nonExistingWow64_32
    "

    "Created: / 07-12-2018 / 15:44:52 / svestkap"
!

testOpenSubKeyNamed_nonExistingWow64_64
    "Trying to read non-existing subKey in Wow64_32 (32bit program reading 64bit registry)"
    | readData testingRegistryPath readSubKeys subKeysCount |
   
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.         
              
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.
    
    self assert: subKeysCount = 3.
    "/ trying to read non-existent subKey    
    readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: #KEY_WOW64_64KEY createIfAbsent: false.
    "/ check if new path is with the subKeyNamed above

    self assert: readData isNil
    
    "
     self run:#testOpenSubKeyNamed_nonExistingWow64_32
     self new testOpenSubKeyNamed_nonExistingWow64_32
    "

    "Created: / 07-12-2018 / 15:45:42 / svestkap"
!

testOpenSubKeyNamed_nonExisting_01
    "Trying to read non-existing subKey via subKeyNamed:flags:createIfAbsent:"
    | readData testingRegistryPath readSubKeys subKeysCount |
   
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.    
    self assert: subKeysCount = 3.
    
    "/ trying to read non-existent subKey    
    readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: nil createIfAbsent: false.
    "/ check if new path is with the subKeyNamed above
    self assert: readData isNil
    
    "
     self run:#testOpenSubKeyNamed_nonExisting_01
     self new testOpenSubKeyNamed_nonExisting_01
    "

    "Created: / 07-12-2018 / 15:50:18 / svestkap"
    "Modified (comment): / 01-02-2019 / 15:06:05 / svestkap"
!

testOpenSubKeyNamed_nonExisting_02
    "Trying to read non-existing subKey via subKeyNamed:"
    | readData testingRegistryPath readSubKeys subKeysCount |
   
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readSubKeys := testingRegistryPath subKeys. 
    subKeysCount := readSubKeys size.    
    self assert: subKeysCount = 3.
    
    "/ trying to read non-existent subKey    
    readData := testingRegistryPath subKeyNamed: 'bledesu ル'.
    "/ check if new path is with the subKeyNamed above
    self assert: readData isNil
    
    "
     self run:#testOpenSubKeyNamed_nonExisting_02
     self new testOpenSubKeyNamed_nonExisting_02
    "

    "Created: / 07-12-2018 / 15:50:48 / svestkap"
    "Modified (format): / 01-02-2019 / 15:05:45 / svestkap"
! !

!Win32OperatingSystemTest methodsFor:'tests-unicodeDelete'!

testDeleteSubKeyNamed_01
    "Testing deleting of empty subKey via deleteSubKeyNamed:"  
    | returnValue testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key:  registryPath.
    
    "/ if successfully deteted -> true 
    returnValue := testingRegistryPath deleteSubKeyNamed: ' ルすしか_empty'.
    self assert: returnValue
 
    "
     self run:#testDeleteSubKeyNamed_01
     self new testDeleteSubKeyNamed_01
    "

    "Created: / 30-01-2019 / 15:42:27 / svestkap"
    "Modified (format): / 01-02-2019 / 14:59:58 / svestkap"
!

testDeleteSubKeyNamed_02
    "Testing deleting of empty subKey via deleteSubKeyNamed:"
    | testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key:  registryPath.
    
    self should: [ testingRegistryPath deleteSubKeyNamed: 11 ] 
         raise: Error 
         suchThat: [ :e | e messageText = 'subKeyString is not a string!!' ].            
 
    "
     self run:#testDeleteSubKeyNamed_02
     self new testDeleteSubKeyNamed_02
    "

    "Created: / 30-01-2019 / 15:42:01 / svestkap"
    "Modified (format): / 01-02-2019 / 15:00:13 / svestkap"
!

testDeleteSubKeyNamed_Wow64_32
    "Testing deleting of empty subKey via deleteSubKeyNamed: (only on x64 systems)
     Wow subsystem enables running 32bit applications on 64bit windows"
    | returnValue testingRegistryPath |
    
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.

    testingRegistryPath := Win32OperatingSystem registryEntry key:  registryPath.
    
    "/ if successfully deteted -> true 
    returnValue := testingRegistryPath deleteSubKeyNamed: ' ルすしか_empty' flags:#KEY_WOW64_32KEY.
    self assert: returnValue
 
    "
     self run:#testDeleteSubKeyNamed_Wow64_32
     self new testDeleteSubKeyNamed_Wow64_32
    "

    "Created: / 07-12-2018 / 14:56:39 / svestkap"
    "Modified (comment): / 01-02-2019 / 15:00:17 / svestkap"
!

testDeleteSubKeyNamed_Wow64_64
    "Testing deleting of empty subKey via deleteSubKeyNamed: (only on x64 systems)
     Wow subsystem enables running 32bit applications on 64bit windows"
    | returnValue testingRegistryPath |
    
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.

    testingRegistryPath := Win32OperatingSystem registryEntry key:  registryPath.
    
    "/ if successfully deteted -> true 
    returnValue := testingRegistryPath deleteSubKeyNamed: ' ルすしか_empty' flags:#KEY_WOW64_64KEY.
    self assert: returnValue
 
    "
     self run:#testDeleteSubKeyNamed_Wow64_64
     self new testDeleteSubKeyNamed_Wow64_64
    "

    "Created: / 07-12-2018 / 14:55:03 / svestkap"
!

testDeleteValueNamed_REG_BINARY
    "Testing if REG_BINARY value name is correctly deleted via deleteValueNamed:"
    | readData testingRegistryPath registryValueName deleteResult |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか').
    registryValueName := 'non-zero'.

    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData notEmptyOrNil.

    deleteResult := testingRegistryPath deleteValueNamed: registryValueName.      
    self assert: deleteResult.

    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData isEmptyOrNil    

    "
     self run:#testDeleteValueNamed_REG_BINARY
     self new testDeleteValueNamed_REG_BINARY
    "

    "Created: / 06-12-2018 / 13:56:35 / svestkap"
    "Modified: / 07-12-2018 / 09:50:41 / svestkap"
    "Modified (format): / 01-02-2019 / 15:00:42 / svestkap"
!

testDeleteValueNamed_REG_DWORD
    "Testing if REG_DWORD value name is correctly deleted via deleteValueNamed:"
    | readData testingRegistryPath registryValueName deleteResult |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか').
    registryValueName := 'dword_value'.

    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData notEmptyOrNil.
    
    deleteResult := testingRegistryPath deleteValueNamed: registryValueName.      
    self assert: deleteResult.
    
    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData isEmptyOrNil    

    "
     self run:#testDeleteValueNamed_REG_DWORD
     self new testDeleteValueNamed_REG_DWORD
    "

    "Created: / 06-12-2018 / 09:09:24 / svestkap"
    "Modified: / 06-12-2018 / 13:59:57 / svestkap"
    "Modified (format): / 01-02-2019 / 15:00:56 / svestkap"
!

testDeleteValueNamed_REG_EXPAND_SZ
    "Testing if REG_EXPAND_SZ value name is correctly deleted via deleteValueNamed:"  
    | readData testingRegistryPath registryValueName deleteResult |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか').
    registryValueName := ' č ルすしか'.

    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData notEmptyOrNil.
    
    deleteResult := testingRegistryPath deleteValueNamed: registryValueName.      
    self assert: deleteResult.
    
    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData isEmptyOrNil    

    "
     self run:#testDeleteValueNamed_REG_EXPAND_SZ
     self new testDeleteValueNamed_REG_EXPAND_SZ
    "

    "Created: / 06-12-2018 / 13:54:53 / svestkap"
    "Modified (format): / 01-02-2019 / 15:01:09 / svestkap"
!

testDeleteValueNamed_REG_QWORD
    "Testing if REG_QWORD value name is correctly deleted via deleteValueNamed:"  
    | readData testingRegistryPath registryValueName deleteResult |
    
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.  

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか').
    registryValueName := 'qword_max'.
    
    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData notEmptyOrNil.
    
    deleteResult := testingRegistryPath deleteValueNamed: registryValueName.      
    self assert: deleteResult.
    
    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData isEmptyOrNil    

    "
     self run:#testDeleteValueNamed_REG_QWORD
     self new testDeleteValueNamed_REG_QWORD
    "

    "Created: / 06-12-2018 / 13:55:46 / svestkap"
    "Modified: / 01-02-2019 / 15:23:41 / svestkap"
!

testDeleteValueNamed_REG_SZ_01
    "Testing if REG_SZ value name is correctly deleted via deleteValueNamed:"    
    | readData testingRegistryPath registryValueName deleteResult |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか').
    registryValueName := ' ř ž č ル.          '.

    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData notEmptyOrNil.
    
    deleteResult := testingRegistryPath deleteValueNamed: registryValueName.      
    self assert: deleteResult.
    
    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData isEmptyOrNil    

    "
     self run:#testDeleteValueNamed_REG_SZ_01
     self new testDeleteValueNamed_REG_SZ_01
    "

    "Created: / 30-01-2019 / 15:23:27 / svestkap"
    "Modified (format): / 01-02-2019 / 15:01:23 / svestkap"
!

testDeleteValueNamed_REG_SZ_02
    "Testing if REG_SZ value name is correctly deleted via deleteValueNamed:"    
    | readData testingRegistryPath registryValueName |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか').
    registryValueName := ' ř ž č ル.          '.

    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData notEmptyOrNil.
    
    self should: [ testingRegistryPath deleteValueNamed: 88 ] 
         raise: Error
         suchThat: [ :e | e messageText = 'nameString is not a string!!' ]
         
    "
     self run:#testDeleteValueNamed_REG_SZ_02
     self new testDeleteValueNamed_REG_SZ_02
    "

    "Created: / 30-01-2019 / 15:23:10 / svestkap"
    "Modified (format): / 01-02-2019 / 15:01:30 / svestkap"
!

testDeleteValueNamed_defaultValue_01
    "Testing if (Default) value gets correctly deleted via deleteValueNamed:"    
    | readData registryValueName testingRegistryPath deleteResult|

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.        
    registryValueName := ''.

    readData := testingRegistryPath valueNamed: registryValueName.    
    self assert: readData notEmptyOrNil.
    self assert: readData = 'しか OMG'.
    
    deleteResult := testingRegistryPath deleteValueNamed: registryValueName.       
    self assert: deleteResult.
    
    readData := testingRegistryPath valueNamed: registryValueName.
    self assert: readData isEmptyOrNil    

    "
     self run:#testDeleteValueNamed_defaultValue_01
     self new testDeleteValueNamed_defaultValue_01
    "

    "Created: / 06-12-2018 / 14:04:16 / svestkap"
    "Modified (format): / 01-02-2019 / 15:01:34 / svestkap"
!

testDeleteValueNamed_defaultValue_02
    "Testing if deleting (Default) empty gets false via deleteValueNamed:"    
    | readData registryValueName testingRegistryPath deleteResult|

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか').       
    registryValueName := ''.

    readData := testingRegistryPath valueNamed: registryValueName.    
    self assert: readData isEmptyOrNil.
    
    deleteResult := testingRegistryPath deleteValueNamed: registryValueName.       
    self assert: deleteResult not.

    "
     self run:#testDeleteValueNamed_defaultValue_02
     self new testDeleteValueNamed_defaultValue_02
    "

    "Created: / 06-12-2018 / 14:01:38 / svestkap"
    "Modified (format): / 01-02-2019 / 15:01:39 / svestkap"
!

testDeleteValueNamed_nonStringValue
    "Testing if trying to delete a key with non-string name raises an error"
    | testingRegistryPath registryValueName |

    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか').
    registryValueName := 11.
    
    self should: [ testingRegistryPath deleteValueNamed: registryValueName ] raise: Error
        suchThat: [ :e | e messageText = 'nameString is not a string!!' ]    

    "
     self run:#testDeleteValueNamed_nonStringValue
     self new testDeleteValueNamed_nonStringValue
    "

    "Created: / 01-02-2019 / 15:02:57 / svestkap"
! !

!Win32OperatingSystemTest methodsFor:'tests-unicodeDeleteEnumeration'!

testDeleteSubKeyNamed_deletingMultipleSubKeys
    "Testing deleting whole tree of subKeys based on subKey path size via deleteSubKeyNamed:"
    | readData returnValue testingRegistryPath |

    readData := OrderedDictionary new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key:  (registryPath, '\', ' ルすしか_testing_delete').

    testingRegistryPath allSubKeysDo: [ :subEntry |
        readData at: subEntry path put: subEntry
    ].        
    
    "/ sorting based on path size
    readData sort: [ :firstRegistryPath :secondRegistryPath | 
        firstRegistryPath size <  secondRegistryPath size 
    ].    
    
    "/ sorting the path size (max -> min)
    readData reverse.      
    
    "/ deleting all the subKeys (even those that have some value names!!)
    readData valuesDo: [ :registryEntry |
        | tempRegistryEntry |
        tempRegistryEntry := Win32OperatingSystem registryEntry key: (registryEntry path copyUpToLast: $\).
        returnValue := tempRegistryEntry deleteSubKeyNamed: (registryEntry path copyAfterLast: $\).
        self assert: returnValue 
    ].
    
    "/ if successfully deteted -> true 
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    returnValue := testingRegistryPath deleteSubKeyNamed: ' ルすしか_testing_delete'.
    self assert: returnValue
 
    "
     self run:#testDeleteSubKeyNamed_deletingMultipleSubKeys
     self new testDeleteSubKeyNamed_deletingMultipleSubKeys
    "

    "Created: / 07-12-2018 / 10:54:34 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:59:37 / svestkap"
! !

!Win32OperatingSystemTest methodsFor:'tests-unicodeRead'!

testReadSubKeyAtIndex_01
    "Reading subKeys at certain index
     WARNING: subKeyAtIndex: is zero based!!!!!!"
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.

    readData := testingRegistryPath subKeyAtIndex: 0.

    self assert: readData notEmptyOrNil.
    self assert: (readData path copyAfterLast: $\) = ' ルすしか'

    "
     self run:#testReadSubKeyAtIndex_01
     self new testReadSubKeyAtIndex_01
    "

    "Created: / 11-12-2018 / 14:51:12 / svestkap"
    "Modified (format): / 01-02-2019 / 13:24:43 / svestkap"
!

testReadSubKeyAtIndex_02
    "Reading subKeys at certain index - reading non-existent subKey
     WARNING: subKeyAtIndex: is zero based!!!!!!"
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.

    readData := testingRegistryPath subKeyAtIndex: 10.

    self assert: readData isNil

    "
     self run:#testReadSubKeyAtIndex_02
     self new testReadSubKeyAtIndex_02
    "

    "Created: / 11-12-2018 / 14:49:03 / svestkap"
    "Modified (format): / 01-02-2019 / 13:24:48 / svestkap"
!

testReadSubKeyAtIndex_03
    "Reading subKeys via a String - should raise an error"
    | testingRegistryPath |
 
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    
    self should: [ testingRegistryPath subKeyAtIndex: 'keyName' ] 
         raise: Error 
         suchThat: [ :e | e messageText = 'subKeyIndex is not an integer!!' ].               

    "
     self run:#testReadSubKeyAtIndex_03
     self new testReadSubKeyAtIndex_03
    "

    "Created: / 01-02-2019 / 15:45:35 / svestkap"
!

testReadSubKeyAtIndex_04
    "Reading subKeys via a Float - should raise an error"
    | testingRegistryPath |
 
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    
    self should: [ testingRegistryPath subKeyAtIndex: 1.1 ] 
         raise: Error 
         suchThat: [ :e | e messageText = 'subKeyIndex is not an integer!!' ].               

    "
     self run:#testReadSubKeyAtIndex_04
     self new testReadSubKeyAtIndex_04
    "

    "Created: / 01-02-2019 / 15:48:14 / svestkap"
!

testReadSubKeyAtIndex_MaxPath
    "Reading subKeyAtIndex with max Path
     Note: This test acually breaks the limit that Microsoft specified in MSDN - registry key name should be maximum 255 characters including absolute path
       MSDN link: https://docs.microsoft.com/en-us/windows/desktop/sysinfo/registry-element-size-limits"
    | readData testingRegistryPath |

    "/readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        
    
    readData := testingRegistryPath subKeyAtIndex: 0.

    self assert: readData path notEmptyOrNil.
    self assert:(readData path endsWith: '|end').    

    "/ this is maximum path size which can be reached if the SubKey is reached via index
    self assert: readData path size = 563. "/ there is one backslash (for path) more compared to testReadSubKeyNamesAndClassesAtIndex_MaxPath_01
    
    "
     self run:#testReadSubKeyAtIndex_MaxPath
     self new testReadSubKeyAtIndex_MaxPath
    "

    "Created: / 05-12-2018 / 12:39:54 / svestkap"
    "Modified (comment): / 01-02-2019 / 15:49:05 / svestkap"
!

testReadSubKeyNamesAndClassesAtIndex_01
    "Reading SubKeyNamesAndClasses - reading non-existent subKey"
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        
    
    readData := testingRegistryPath subKeyNameAndClassAtIndex: 10.

    self assert: readData isNil.        
    "
     self run:#testReadSubKeyNamesAndClassesAtIndex_01
     self new testReadSubKeyNamesAndClassesAtIndex_01
    "

    "Created: / 11-12-2018 / 14:49:48 / svestkap"
    "Modified (comment): / 01-02-2019 / 15:48:57 / svestkap"
!

testReadSubKeyNamesAndClassesAtIndex_02
    "Reading SubKeyNamesAndClasses via String - should raise an error"
    | testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        

    self should: [ testingRegistryPath subKeyNameAndClassAtIndex: 'asString' ] 
         raise: Error 
         suchThat: [ :e | e messageText = 'subKeyIndex is not an integer!!' ]
         
    "
     self run:#testReadSubKeyNamesAndClassesAtIndex_02
     self new testReadSubKeyNamesAndClassesAtIndex_02
    "

    "Created: / 01-02-2019 / 15:48:02 / svestkap"
!

testReadSubKeyNamesAndClassesAtIndex_03
    "Reading SubKeyNamesAndClasses via Float - should raise an error"
    | testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        

    self should: [ testingRegistryPath subKeyNameAndClassAtIndex: 1.1 ] 
         raise: Error 
         suchThat: [ :e | e messageText = 'subKeyIndex is not an integer!!' ]
         
    "
     self run:#testReadSubKeyNamesAndClassesAtIndex_03
     self new testReadSubKeyNamesAndClassesAtIndex_03
    "

    "Created: / 01-02-2019 / 15:51:03 / svestkap"
!

testReadSubKeyNamesAndClassesAtIndex_MaxPath
    "Reading SubKeyNamesAndClasses with max Path
     Note: This test acually breaks the limit that Microsoft specified in MSDN - registry key name should be maximum 255 characters including absolute path
       MSDN link: https://docs.microsoft.com/en-us/windows/desktop/sysinfo/registry-element-size-limits"
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        
    
    readData := testingRegistryPath subKeyNameAndClassAtIndex: 0.

    self assert: readData notEmptyOrNil.
    self assert:(readData first endsWith: '|end').
    self assert: readData first = '256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end'.        

    "/ this is maximum path size which can be reached if the SubKey is reached via index
    self assert: (testingRegistryPath path size + readData first size) = 562.
    
    "
     self run:#testReadSubKeyNamesAndClassesAtIndex_MaxPath
     self new testReadSubKeyNamesAndClassesAtIndex_MaxPath
    "

    "Created: / 05-12-2018 / 12:40:08 / svestkap"
    "Modified (comment): / 01-02-2019 / 15:49:18 / svestkap"
!

testReadTooLongPath
    "Trying to read too long path - nil is returned"
    | testingRegistryPath |
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: 
            (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa
            |end','\','256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        

    self assert: testingRegistryPath isNil            
    
    "
     self run:#testReadTooLongPath
     self new testReadTooLongPath
    "

    "Created: / 22-11-2018 / 11:19:51 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:58:15 / svestkap"
!

testReadValueNameAtIndex_01
    "Reading values (#valueNameAtIndex:) at certain index
     WARNING: #valueNameAtIndex: is zero based!!!!!!
     Note: This test acually breaks the limit that Microsoft specified in MSDN - registry key name should be maximum 255 characters including absolute path
       MSDN link: https://docs.microsoft.com/en-us/windows/desktop/sysinfo/registry-element-size-limits" 
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath,'\', ' ルすしか').

    readData := testingRegistryPath valueNameAtIndex: 1.

    self assert: readData notEmptyOrNil.
    self assert: readData = 'しかき    '

    "
     self run:#testReadValueNameAtIndex
     self new testReadValueNameAtIndex
    "

    "Created: / 11-12-2018 / 14:54:37 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:58:25 / svestkap"
!

testReadValueNameAtIndex_02
    "Reading values (#valueNameAtIndex:) at certain index - non-existent value" 
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath,'\', ' ルすしか').

    readData := testingRegistryPath valueNameAtIndex: 100.

    self assert: readData isNil    

    "
     self run:#testReadValueNameAtIndex_02
     self new testReadValueNameAtIndex_02
    "

    "Created: / 11-12-2018 / 14:54:29 / svestkap"
    "Modified (format): / 01-02-2019 / 13:25:19 / svestkap"
!

testReadValueNameAtIndex_03    
    "Reading values (#valueNameAtIndex:) via String - should raise an error"
    | testingRegistryPath |
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath,'\', ' ルすしか').

    self should: [ testingRegistryPath valueNameAtIndex: 'stringInsteadOfIndex' ] 
         raise: Error 
         suchThat: [ :e | e messageText = 'valueIndex is not an integer!!' ]
                                                                                     
    "
     self run:#testReadValueNameAtIndex_03
     self new testReadValueNameAtIndex_03
    "

    "Created: / 01-02-2019 / 15:52:27 / svestkap"
!

testReadValueNameAtIndex_04    
    "Reading values (#valueNameAtIndex:) via Float - should raise an error"
    | testingRegistryPath |
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath,'\', ' ルすしか').

    self should: [ testingRegistryPath valueNameAtIndex: 1.1 ] 
         raise: Error 
         suchThat: [ :e | e messageText = 'valueIndex is not an integer!!' ]
                                                                                     
    "
     self run:#testReadValueNameAtIndex_04
     self new testReadValueNameAtIndex_04
    "

    "Created: / 01-02-2019 / 15:55:03 / svestkap"
!

testReadValueNamed_REG_BINARY_01
    "Testing if REG_BINARY values are read correctly via valueNamed:"
    | readData testingRegistryPath |
        
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'zero'.
        
    self assert: readData = ByteArray new.

    "
     self run:#testReadValueNamed_REG_BINARY_01
     self new testReadValueNamed_REG_BINARY_01
    "

    "Created: / 16-11-2018 / 12:37:50 / svestkap"
    "Modified (format): / 01-02-2019 / 13:28:15 / svestkap"
!

testReadValueNamed_REG_BINARY_02
    "Testing if REG_BINARY values are read correctly via valueNamed:"
    | testingRegistryPath readData readDataHex |
        
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'non-zero'.        
    readDataHex := readData hexPrintStringWithSeparator: $|.
    
    self assert: readData = #[17 16]. "/ ByteArray
    self assert: readDataHex = '11|10' "/ hex    
    
    "
     self run:#testReadValueNamed_REG_BINARY_02
     self new testReadValueNamed_REG_BINARY_02
    "

    "Created: / 16-11-2018 / 12:39:33 / svestkap"
    "Modified (format): / 01-02-2019 / 13:28:21 / svestkap"
!

testReadValueNamed_REG_DWORD_01
    "Testing if REG_DWORD values are read correctly via valueNamed:"
    | readData testingRegistryPath |
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'dword_value'.
        
    self assert: readData = 9135.

    "
     self run:#testReadValueNamed_REG_DWORD_01
     self new testReadValueNamed_REG_DWORD_01
    "

    "Created: / 16-11-2018 / 12:24:26 / svestkap"
    "Modified (format): / 01-02-2019 / 13:28:26 / svestkap"
!

testReadValueNamed_REG_DWORD_02
    "Testing if REG_DWORD values are read correctly via valueNamed:"
    | readData testingRegistryPath |
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'き'.
        
    self assert: readData = 591541423.

    "
     self run:#testReadValueNamed_REG_DWORD_02
     self new testReadValueNamed_REG_DWORD_02
    "

    "Created: / 16-11-2018 / 12:24:43 / svestkap"
    "Modified (format): / 01-02-2019 / 13:28:30 / svestkap"
!

testReadValueNamed_REG_EXPAND_SZ_01
    "Testing if REG_EXPAND_SZ values are read correctly via valueNamed:"
    | readData testingRegistryPath |
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: ' č ルすしか'.
        
    self assert: readData = '''Testing Unicode chars ř ž č ルすしかき'').          '. 

    "
     self run:#testReadValueNamed_REG_EXPAND_SZ_01
     self new testReadValueNamed_REG_EXPAND_SZ_01
    "

    "Created: / 16-11-2018 / 12:27:58 / svestkap"
    "Modified (format): / 01-02-2019 / 13:28:38 / svestkap"
!

testReadValueNamed_REG_EXPAND_SZ_02
    "Testing if REG_EXPAND_SZ values are read correctly via valueNamed:"
    | readData testingRegistryPath |
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'Ugh'.
        
    self assert: readData = '''Testing Unicode chars ř ž č ルすしかき'').          '. 

    "
     self run:#testReadValueNamed_REG_EXPAND_SZ_02
     self new testReadValueNamed_REG_EXPAND_SZ_02
    "

    "Created: / 16-11-2018 / 12:29:52 / svestkap"
    "Modified (format): / 01-02-2019 / 13:28:42 / svestkap"
!

testReadValueNamed_REG_MULTI_SZ_01
    "Testing if REG_MULTI_SZ values are read correctly via valueNamed:"
    | readData testingRegistryPath |
        
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold'.
        
    self assert: readData = #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'SEGOEUIB.TTF,Segoe UI Bold' 'MEIRYOB.TTC,Meiryo UI Bold,120,96' 
                              'MEIRYOB.TTC,Meiryo UI Bold' 'MSJHBD.TTC,Microsoft JhengHei UI Bold,120,96' 'MSJHBD.TTC,Microsoft JhengHei UI Bold'
                              'MSYHBD.TTC,Microsoft YaHei UI Bold,128,96' 'MSYHBD.TTC,Microsoft YaHei UI Bold' 'MALGUNBD.TTF,Malgun Gothic Bold,118,96'
                              'MALGUNBD.TTF,Malgun Gothic Bold' 'YUGOTHB.TTC,Yu Gothic UI Bold,128,96' 'YUGOTHB.TTC,Yu Gothic UI Bold' 'SEGUISYM.TTF,Segoe UI Symbol') 

    "
     self run:#testReadValueNamed_REG_MULTI_SZ_01
     self new testReadValueNamed_REG_MULTI_SZ_01
    "

    "Created: / 16-11-2018 / 12:30:24 / svestkap"
    "Modified (format): / 01-02-2019 / 13:28:46 / svestkap"
!

testReadValueNamed_REG_MULTI_SZ_02
    "Testing if REG_MULTI_SZ values are read correctly via valueNamed:"
    | readData testingRegistryPath |
        
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'ř ž č ルすしか'.
        
    self assert: readData = #('''Testing Unicode chars ř ž č ルすしかき'')'
                              'SEGOEUIB.TTF,Segoe UI Bold,110,82' 'SEGOEUIB.TTF,Segoe UI Bold' 'MEIRYOB.TTC,Meiryo UI Bold,120,96' 
                              'MEIRYOB.TTC,Meiryo UI Bold' 'MSJHBD.TTC,Microsoft JhengHei UI Bold,120,96' 'MSJHBD.TTC,Microsoft JhengHei UI Bold'
                              'MSYHBD.TTC,Microsoft YaHei UI Bold,128,96' 'MSYHBD.TTC,Microsoft YaHei UI Bold' 'MALGUNBD.TTF,Malgun Gothic Bold,118,96'
                              'MALGUNBD.TTF,Malgun Gothic Bold' 'YUGOTHB.TTC,Yu Gothic UI Bold,128,96' 'YUGOTHB.TTC,Yu Gothic UI Bold' 'SEGUISYM.TTF,Segoe UI Symbol') 

    "
     self run:#testReadValueNamed_REG_MULTI_SZ_02
     self new testReadValueNamed_REG_MULTI_SZ_02
    "

    "Created: / 16-11-2018 / 12:35:57 / svestkap"
    "Modified (format): / 01-02-2019 / 13:28:52 / svestkap"
!

testReadValueNamed_REG_MULTI_SZ_03
    "Testing if empty REG_MULTI_SZ value is read correctly via valueNamed:"
    | readData testingRegistryPath |
        
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'testEmptyMultiSZ'.
    
    self assert: readData isEmpty

    "
     self run:#testReadValueNamed_REG_MULTI_SZ_03
     self new testReadValueNamed_REG_MULTI_SZ_03
    "

    "Created: / 03-12-2018 / 10:59:48 / svestkap"
    "Modified (format): / 01-02-2019 / 13:28:58 / svestkap"
!

testReadValueNamed_REG_QWORD_01
    "Testing if REG_QWORD values are read correctly via valueNamed:.
     The read value is a QWORD maximum value"
    | readData testingRegistryPath |
    
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.  
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'qword_max'.
        
    self assert: readData = 18446744073709551615.

    "
     self run:#testReadValueNamed_REG_QWORD_01
     self new testReadValueNamed_REG_QWORD_01
    "

    "Created: / 16-11-2018 / 12:25:47 / svestkap"
    "Modified: / 01-02-2019 / 15:14:01 / svestkap"
!

testReadValueNamed_REG_QWORD_02
    "Testing if REG_QWORD values are read correctly via valueNamed:"
    | readData testingRegistryPath |
    
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.  
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'qwordvalue'.
        
    self assert: readData = 8751636011737964973.

    "
     self run:#testReadValueNamed_REG_QWORD_02
     self new testReadValueNamed_REG_QWORD_02
    "

    "Created: / 16-11-2018 / 12:26:23 / svestkap"
    "Modified: / 01-02-2019 / 15:14:06 / svestkap"
!

testReadValueNamed_REG_QWORD_03
    "Testing if REG_QWORD values are read correctly via valueNamed:"
    | readData testingRegistryPath |
    
    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.  
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'すし'.
        
    self assert: readData asSmallInteger = 44527.

    "
     self run:#testReadValueNamed_REG_QWORD_03
     self new testReadValueNamed_REG_QWORD_03
    "

    "Created: / 16-11-2018 / 12:27:17 / svestkap"
    "Modified: / 01-02-2019 / 15:14:11 / svestkap"
!

testReadValueNamed_REG_SZ_01
    "Testing if REG_SZ values are read correctly via valueNamed:"
    | readData testingRegistryPath |
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'bledesu'.
    
    self assert: readData = '''Testing Unicode chars ř ž č ルすしかき'').          '.
    
    "
     self run:#testReadValueNamed_REG_SZ_01
     self new testReadValueNamed_REG_SZ_01
    "

    "Created: / 16-11-2018 / 12:14:59 / svestkap"
    "Modified (format): / 01-02-2019 / 13:29:53 / svestkap"
!

testReadValueNamed_REG_SZ_02
    "Testing if REG_SZ values are read correctly via valueNamed:"
    | readData testingRegistryPath |
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: ' ř ž č ル.          '.
        
    self assert: readData = 'Testing Unicode chars ř ž č ルすしかき'.    

    "
     self run:#testReadValueNamed_REG_SZ_02
     self new testReadValueNamed_REG_SZ_02
    "

    "Created: / 16-11-2018 / 12:15:17 / svestkap"
    "Modified (format): / 01-02-2019 / 13:29:56 / svestkap"
!

testReadValueNamed_REG_SZ_03
    "Testing if REG_SZ values are read correctly via valueNamed:"
    | readData testingRegistryPath |
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'しかき    '.
        
    self assert: readData = 'Testus gradus'.

    "
     self run:#testReadValueNamed_REG_SZ_03
     self new testReadValueNamed_REG_SZ_03
    "

    "Created: / 16-11-2018 / 12:21:59 / svestkap"
    "Modified (format): / 01-02-2019 / 13:30:00 / svestkap"
!

testReadValueNamed_REG_SZ_04
    "Testing if empty REG_SZ value is read correctly via valueNamed:"
    | readData testingRegistryPath |
    
    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    readData := testingRegistryPath valueNamed: 'emptyToTest'.
    
    self assert: readData isEmpty.
    
    "
     self run:#testReadValueNamed_REG_SZ_04
     self new testReadValueNamed_REG_SZ_04
    "

    "Created: / 03-12-2018 / 10:56:11 / svestkap"
    "Modified (format): / 01-02-2019 / 13:30:45 / svestkap"
!

testReadValueNamed_nonStringValue
    "Testing reading non-string value from Registry via valueNamed raises an error"    
    | testingRegistryPath |
        
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    self should: [ testingRegistryPath valueNamed: 11 ] 
         raise: Error 
         suchThat: [ :e | e messageText = 'nameString is not a string!!' ].        

    "
     self run:#testReadValueNamed_nonStringValue
     self new testReadValueNamed_nonStringValue
    "

    "Created: / 05-12-2018 / 12:40:31 / svestkap"
    "Modified (format): / 30-01-2019 / 15:30:21 / svestkap"
!

testValueTypeAndSize_01
    "Testing if an error is returned when number is used instead of string as method parammeter at valueTypeAndSize:"
    | testingRegistryPath |
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    self should: [ testingRegistryPath valueTypeAndSize: 55 ] 
         raise: Error 
         suchThat: [ :e | e messageText = 'nameString is not a string!!' ].                                                                          
    
    "
     self run:#testValueTypeAndSize_01
     self new testValueTypeAndSize_01
    "

    "Created: / 30-01-2019 / 17:15:49 / svestkap"
!

testValueTypeAndSize_REG_BINARY_01
    "Testing if #REG_BINARY type returns correct size in bytes"
    | testingRegistryPath readData testingData |

    testingData := Dictionary new.            
    testingData at: #'REG_BINARY' put: 2. "/ [bytes] - testing registry contains #[17 16]    
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readData := testingRegistryPath valueTypeAndSize: 'non-zero'.
    
    self assert: readData keys first = #REG_BINARY.  
    self assert: (readData at: #'REG_BINARY') = (testingData at: #'REG_BINARY')    
    
    "
     self run:#testValueTypeAndSize_REG_BINARY_01
     self new testValueTypeAndSize_REG_BINARY_01
    "

    "Created: / 31-01-2019 / 15:47:05 / svestkap"
!

testValueTypeAndSize_REG_DWORD_01
    "Testing if #REG_DWORD type returns correct size in bytes"
    | testingData testingRegistryType testingRegistryPath readData |

    testingData := Dictionary new.
    testingRegistryType := UninterpretedBytes isBigEndian ifTrue: [ #REG_DWORD_BIG_ENDIAN ]
                                                         ifFalse: [ #REG_DWORD_LITTLE_ENDIAN ].
    testingData at: testingRegistryType put: 4. "/ 32bits = 4 bytes - testing registry contains 0xffffffff 
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readData := testingRegistryPath valueTypeAndSize: 'dword_value'.
    
    self assert: readData keys first = testingRegistryType.  
    self assert: (readData at: testingRegistryType) = (testingData at: testingRegistryType)    
    
    "
     self run:#testValueTypeAndSize_REG_DWORD_01
     self new testValueTypeAndSize_REG_DWORD_01
    "

    "Created: / 31-01-2019 / 16:03:52 / svestkap"
    "Modified (comment): / 01-02-2019 / 15:13:01 / svestkap"
!

testValueTypeAndSize_REG_EXPAND_SZ_01
    "Testing if #REG_EXPAND_SZ type returns expected string size"
    | testingData testingRegistryType testingRegistryPath readData |

    testingData := Dictionary new.
    testingRegistryType := #REG_EXPAND_SZ.
    testingData at: testingRegistryType put: 47. "/ expected string size
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readData := testingRegistryPath valueTypeAndSize: ' č ルすしか'.
    
    self assert: readData keys first = testingRegistryType.  
    self assert: (readData at: testingRegistryType) = (testingData at: testingRegistryType)    
    
    "
     self run:#testValueTypeAndSize_REG_EXPAND_SZ_01
     self new testValueTypeAndSize_REG_EXPAND_SZ_01
    "

    "Created: / 31-01-2019 / 15:55:35 / svestkap"
    "Modified (comment): / 01-02-2019 / 15:09:26 / svestkap"
!

testValueTypeAndSize_REG_MULTI_SZ_01
    "Testing if #REG_MULTI_SZ type returns correct size in bytes"
    | testingData testingRegistryType testingRegistryPath readData |

    testingData := Dictionary new.
    testingRegistryType :=  #REG_MULTI_SZ.
    testingData at: testingRegistryType put: 974. "/ [bytes] - multiple lines in registry
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readData := testingRegistryPath valueTypeAndSize: 'ř ž č ルすしか'.
    
    self assert: readData keys first = testingRegistryType.  
    self assert: (readData at: testingRegistryType) = (testingData at: testingRegistryType)    
    
    "
     self run:#testValueTypeAndSize_REG_MULTI_SZ_01
     self new testValueTypeAndSize_REG_MULTI_SZ_01
    "

    "Created: / 31-01-2019 / 16:14:31 / svestkap"
!

testValueTypeAndSize_REG_NONE_01
    "Testing if #REG_NONE type returns alwyas 0 as it should"
    | testingRegistryPath readData testingData |

    testingData := Dictionary new.            
    testingData at: #REG_NONE put: 0. "/ #REG_NONE always returns 0
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath,'\', '\ ルすしか_testing_delete\reg-none').
    readData := testingRegistryPath valueTypeAndSize: ''.
    
    self assert: readData keys first = #REG_NONE.  
    self assert: (readData at: #'REG_NONE') = (testingData at: #'REG_NONE')    
    
    "
     self run:#testValueTypeAndSize_REG_NONE_01
     self new testValueTypeAndSize_REG_NONE_01
    "

    "Created: / 31-01-2019 / 15:35:37 / svestkap"
    "Modified (comment): / 01-02-2019 / 15:13:27 / svestkap"
!

testValueTypeAndSize_REG_QWORD_01
    "Testing if #REG_QWORD type returns correct size in bytes"
    | testingData testingRegistryType testingRegistryPath readData |

    self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'.  
    
    testingData := Dictionary new.
    testingRegistryType :=  #REG_QWORD.
    testingData at: testingRegistryType put: 8. "/ 64bits = 8bytes - testing registry contains 0xffffffffffffffff 
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readData := testingRegistryPath valueTypeAndSize: 'qword_max'.
    
    self assert: readData keys first = testingRegistryType.  
    self assert: (readData at: testingRegistryType) = (testingData at: testingRegistryType)    
    
    "
     self run:#testValueTypeAndSize_REG_DWORD_01
     self new testValueTypeAndSize_REG_DWORD_01
    "

    "Created: / 31-01-2019 / 16:12:21 / svestkap"
    "Modified (comment): / 01-02-2019 / 15:11:57 / svestkap"
!

testValueTypeAndSize_REG_SZ_01
    "Testing if #REG_SZ type returns expected string size"
    | testingRegistryPath readData testingData |

    testingData := Dictionary new.            
    testingData at: #REG_SZ put: 13.
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    readData := testingRegistryPath valueTypeAndSize: 'しかき    '.
    
    self assert: readData keys first = #REG_SZ.  
    self assert: (readData at: #'REG_SZ') = (testingData at: #'REG_SZ')    
    
    "
     self run:#testValueTypeAndSize_REG_SZ_01
     self new testValueTypeAndSize_REG_SZ_01
    "

    "Created: / 30-01-2019 / 17:13:53 / svestkap"
    "Modified (comment): / 31-01-2019 / 16:01:37 / svestkap"
! !

!Win32OperatingSystemTest methodsFor:'tests-unicodeReadEnumeration'!

testReadAllSubKeysDo_MaxPath
    "Reading via allSubKeysDo (using subKeyAtIndex:)with maximum path length.
     The path suppasses the limit specified by Microsoft - for more information see testReadSubKeyAtIndex_MaxPath_01"
    | readData testingRegistryPath |

    readData := OrderedCollection new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        
    
    testingRegistryPath  allSubKeysDo: [ :subEntry |
        readData add: subEntry
    ].     
    
    self assert: readData notEmptyOrNil.    
    self assert: readData size = 3.
    "/ this is normally unreachable subKey (subkey actually called 'unreachable')
    self assert: (readData at: 2) path size = 575.
    
    readData := readData copy collect: [ :subEntry | subEntry path copyAfterLast: $\ ].

    self assert: readData size = 3.    
    self assert: (readData first endsWith: '|end').
    self assert: readData second = 'unreachable'.
    self assert: readData third = 'reachable'

    "
     self run:#testReadAllSubKeysDo_MaxPath
     self new testReadAllSubKeysDo_MaxPath
    "

    "Created: / 05-12-2018 / 12:40:53 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:57:24 / svestkap"
!

testReadRemoteKeyOnHost_01
    "Reading remote registry via remoteKeyOnHost:
     Note: a key must be a predefined key for more see: 
       https://docs.microsoft.com/en-us/windows/desktop/SysInfo/predefined-keys"
    | testingRegistryPath remoteRegistry readData  |
    
    "/ HKEY_CURRENT_USER is one of the predefined keys
    testingRegistryPath := Win32OperatingSystem registryEntry key: 'HKEY_CURRENT_USER'.        
    "/ testing done on localhost
    "Skip testing if the remote registry is unreachable.  With localhost this can happen when 
     the service RemoteRegistry, the service name in Windows 10, is not started."
    [ remoteRegistry := testingRegistryPath remoteKeyOnHost: 'localhost' ] on: OsError do: [ :ex | "/ errorCode => `ex parameter parameter`
        self skipIf: ex parameter parameter = '53' description: 'ERROR_BAD_NETPATH, 53 (0x35) - The network path was not found.'
    ].
    readData := remoteRegistry subKeys.
    
    readData := readData copy collect: [ :subEntry | (subEntry path copyAfterLast: $\) asLowercase ].
    
    self assert: readData notEmptyOrNil.    
    self assert: (readData includes: 'software').    

    "
     self run:#testReadRemoteKeyOnHost_01
     self new testReadRemoteKeyOnHost_01
    "

    "Created: / 31-01-2019 / 12:11:06 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:51:09 / svestkap"
!

testReadRemoteKeyOnHost_02
    "Reading remote registry via remoteKeyOnHost: using non-string key name
     Note: a key must be a predefined key for more see: 
       https://docs.microsoft.com/en-us/windows/desktop/SysInfo/predefined-keys"
    | testingRegistryPath |
    
    "/ HKEY_CURRENT_USER is one of the predefined keys
    testingRegistryPath := Win32OperatingSystem registryEntry key: 'HKEY_CURRENT_USER'.            
    self should: [ testingRegistryPath remoteKeyOnHost: 11 ] 
         raise: Error 
         suchThat: [ :e | e messageText = 'hostNameString is not a string!!' ]
    
    "
     self run:#testReadRemoteKeyOnHost_02
     self new testReadRemoteKeyOnHost_02
    "

    "Created: / 31-01-2019 / 12:10:18 / svestkap"
    "Modified (format): / 01-02-2019 / 14:51:23 / svestkap"
!

testReadSubKeyNamesAndClassesDo_MaxPath
    "Reading SubKeyNamesAndClasses with maximum path length.
     The path suppasses the limit specified by Microsoft - for more information see testReadSubKeyNamesAndClassesAtIndex_MaxPath_01"
    | readData testingRegistryPath |

    readData := OrderedDictionary new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        
    
    testingRegistryPath  subKeyNamesAndClassesDo: [ :name :className |
        readData at: name put: className.
    ].     

    self assert: readData notEmptyOrNil.
    self assert: readData size = 2.
    self assert: (readData at: 'reachable') isEmpty. "/ the class is empty

    "
     self run:#testReadSubKeyNamesAndClassesDo_MaxPath
     self new testReadSubKeyNamesAndClassesDo_MaxPath
    "

    "Created: / 05-12-2018 / 12:41:31 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:57:00 / svestkap"
!

testReadSubKeysDo_MaxPath
    "Reading data via subKeysDo (using subKeyAtIndex:) with maximum path length.
     The path suppasses the limit specified by Microsoft - for more information see testReadSubKeyAtIndex_MaxPath_01"
    | readData testingRegistryPath |

    readData := OrderedCollection new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        
    
    testingRegistryPath subKeysDo: [ :subEntry |
        readData add: subEntry
    ].     
    
    self assert: readData notEmptyOrNil.    
    self assert: readData size = 2.    
    self assert: (readData first) path size = 563.
    
    readData := readData copy collect: [ :subEntry | subEntry path copyAfterLast: $\ ].

    self assert: readData size = 2.    
    self assert: (readData first endsWith: '|end').
    self assert: readData second = 'reachable'.

    "
     self run:#testReadSubKeysDo_MaxPath
     self new testReadSubKeysDo_MaxPath
    "

    "Created: / 05-12-2018 / 12:41:49 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:56:31 / svestkap"
!

testReadSubKeys_MaxPath
    "Reading via subKeys (using subKeyAtIndex:) with maximum path length.
     The path suppasses the limit specified by Microsoft - for more information see testReadSubKeyAtIndex_MaxPath_01"
    | readData testingRegistryPath |
    
    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        
    
    readData := testingRegistryPath subKeys.
    
    self assert: readData notEmptyOrNil.    
    self assert: readData size = 2.    
    self assert: (readData first) path size = 563.
    
    readData := readData copy collect: [ :subEntry | subEntry path copyAfterLast: $\ ].

    self assert: readData size = 2.    
    self assert: (readData first endsWith: '|end').
    self assert: readData second = 'reachable'.

    "
     self run:#testReadSubKeys_MaxPath
     self new testReadSubKeys_MaxPath
    "

    "Created: / 05-12-2018 / 12:41:59 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:56:12 / svestkap"
!

testReadValueNamesAndValuesDo_MaxPath
    "Reading data via #valueNamesAndValuesDo: (using #valueNameAtIndex:) with maximum path length.
     The path suppasses the limit specified by Microsoft - for more information see testReadValueNameAtIndex_01"
    | readData testingRegistryPath |

    readData := OrderedDictionary new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        
    
    testingRegistryPath valueNamesAndValuesDo: [ :name :value |
        readData at: name put: value
    ].     
    
    self assert: readData notEmptyOrNil.    
    self assert: readData size = 3.    
    self assert: readData first =  ('testing'->' ルすしか').
    self assert: (readData at: 'か')= 2.
    self assert: readData second = 2.
    self assert: (readData at: '256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end') 
        = 'Longer_than_256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|endsdfsdfasdfasdfasdfjlkasdjflkasjdflkjasdlfjaslkdfjlkasdjflkasdflksadlkjsadlfalsdfůlasdjflkasdjflkasjdflkůjasdflůkjasdlůfjalsůkdjflůksd'.
    self assert: readData third = 'Longer_than_256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|endsdfsdfasdfasdfasdfjlkasdjflkasjdflkjasdlfjaslkdfjlkasdjflkasdflksadlkjsadlfalsdfůlasdjflkasdjflkasjdflkůjasdflůkjasdlůfjalsůkdjflůksd'.

    "  
     self run:#testReadValueNamesAndValuesDo_MaxPath
     self new testReadValueNamesAndValuesDo_MaxPath
    "

    "Created: / 05-12-2018 / 12:43:05 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:54:23 / svestkap"
!

testReadValueNamesAndValuesDo_REG_SZ_01
    "Testing if REG_SZ values are read correctly via valueNamesAndValuesDo:"
    | readData testingRegistryPath |
    
    readData := OrderedDictionary new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    testingRegistryPath valueNamesAndValuesDo: [ :name :data |
        readData at: name put: data
    ].
    
    self assert: (readData at: 'bledesu') = '''Testing Unicode chars ř ž č ルすしかき'').          '.
    
    "
     self run:#testReadValueNamesAndValuesDo_REG_SZ_01
     self new testReadValueNamesAndValuesDo_REG_SZ_01
    "

    "Created: / 16-11-2018 / 12:15:52 / svestkap"
    "Modified (format): / 01-02-2019 / 13:31:44 / svestkap"
!

testReadValueNamesAndValuesDo_REG_SZ_02
    "Testing if REG_SZ values are read correctly via valueNamesAndValuesDo:"
    | readData testingRegistryPath |
    
    readData := OrderedDictionary new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    testingRegistryPath valueNamesAndValuesDo: [ :name :data |
        readData at: name put: data
    ].
    
    self assert: (readData at: ' ř ž č ル.          ') = 'Testing Unicode chars ř ž č ルすしかき'.    

    "
     self run:#testReadValueNamesAndValuesDo_REG_SZ_02
     self new testReadValueNamesAndValuesDo_REG_SZ_02
    "

    "Created: / 05-12-2018 / 12:43:35 / svestkap"
    "Modified (format): / 01-02-2019 / 13:31:48 / svestkap"
!

testReadValueNamesDo_MaxPath
    "Reading data via #valueNamesDo: (using #valueNameAtIndex:)  with maximum path length.
     The path is suppassing the Microsoft limit - for more information see testReadValueNameAtIndex_01"
    | readData readDataValue testingRegistryPath |

    readData := OrderedCollection new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        
    
    testingRegistryPath valueNamesDo: [ :subEntry |
        readData add: subEntry
    ].     
    
    self assert: readData notEmptyOrNil.    
    self assert: readData size = 3.    
    self assert: readData first = 'testing'.
    self assert: readData second = 'か'.
    self assert: readData third = '256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end'.
    
    readDataValue := testingRegistryPath valueNamed: readData third.  
    
    "/ MSDN limits: Value name 16,383 characters (@Windows 2000: 260 ANSI characters or 16,383 Unicode characters)
    "/ the following tests 401 characters       
    self assert: readDataValue = 'Longer_than_256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|endsdfsdfasdfasdfasdfjlkasdjflkasjdflkjasdlfjaslkdfjlkasdjflkasdflksadlkjsadlfalsdfůlasdjflkasdjflkasjdflkůjasdflůkjasdlůfjalsůkdjflůksd'.
    "
     self run:#testReadValueNamesDo_MaxPath
     self new testReadValueNamesDo_MaxPath
    "

    "Created: / 05-12-2018 / 12:43:49 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:55:15 / svestkap"
!

testReadValueNames_MaxPath
    "reading via #valueNames (using #valueNameAtIndex:) with max Path
     The path is suppassing the Microsoft limit - for more information see testReadValueNameAtIndex_01"
    | readData testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        
    
    readData := testingRegistryPath valueNames.
    
    self assert: readData isArray.
    self assert: readData notEmptyOrNil.    
    self assert: readData size = 3.    
    self assert: readData first = 'testing'.
    self assert: readData second = 'か'.
    self assert: readData third = '256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end'.

    "  
     self run:#testReadValueNames_MaxPath
     self new testReadValueNames_MaxPath
    "

    "Created: / 05-12-2018 / 12:44:16 / svestkap"
    "Modified (format): / 01-02-2019 / 13:31:55 / svestkap"
!

testReadvalueNamesAndValuesDo_MaxPath_01
    "reading via #valueNamesAndValuesDo: (using #valueNameAtIndex:) with max Path
     The path is suppassing the Microsoft limit - for more information see testReadValueNameAtIndex_01"
    | readData testingRegistryPath |

    readData := OrderedDictionary new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: 
        (registryPath,'\', ' ルすしか\256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end').        
    
    testingRegistryPath valueNamesAndValuesDo: [ :name :value |
        readData at: name put: value
    ].     
    
    self assert: readData notEmptyOrNil.    
    self assert: readData size = 3.    
    self assert: readData first =  ('testing'->' ルすしか').
    self assert: (readData at: 'か')= 2.
    self assert: readData second = 2.
    self assert: (readData at: '256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|end') 
        = 'Longer_than_256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|endsdfsdfasdfasdfasdfjlkasdjflkasjdflkjasdlfjaslkdfjlkasdjflkasdflksadlkjsadlfalsdfůlasdjflkasdjflkasjdflkůjasdflůkjasdlůfjalsůkdjflůksd'.
    self assert: readData third = 'Longer_than_256_chars_max_long|arsdfasdfjljljasdf;jl;jljsfasdfasdfljaslkdfjkasdfljalsd;jfa;lsdjflkasjdflkajsdflkjasdflkjsadlfjasldfjlsadjflksdjflksadjflkajsdflkjasdlfjalskdjflkasdjflkasdfkj;sdaf;kljkkjkklkjjjjkas|1asdfjsldfjlasdlfjlasdjfljasdlfjalsdjflajdfsdsasdfa|endsdfsdfasdfasdfasdfjlkasdjflkasjdflkjasdlfjaslkdfjlkasdjflkasdflksadlkjsadlfalsdfůlasdjflkasdjflkasjdflkůjasdflůkjasdlůfjalsůkdjflůksd'.

    "  
     self run:#testReadvalueNamesAndValuesDo_MaxPath_01
     self new testReadvalueNamesAndValuesDo_MaxPath_01
    "

    "Created: / 22-11-2018 / 14:10:34 / svestkap"
    "Modified (format): / 01-02-2019 / 13:31:59 / svestkap"
!

testReadvalueNamesAndValuesDo_REG_SZ_02
    "Testing if REG_SZ values are read correctly via valueNamesAndValuesDo:"
    | readData testingRegistryPath |
    
    readData := OrderedDictionary new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
     
    testingRegistryPath valueNamesAndValuesDo: [ :name :data |
        readData at: name put: data
    ].
    
    self assert: (readData at: ' ř ž č ル.          ') = 'Testing Unicode chars ř ž č ルすしかき'.    

    "
     self run:#testReadvalueNamesAndValuesDo_REG_SZ_02
     self new testReadvalueNamesAndValuesDo_REG_SZ_02
    "

    "Created: / 16-11-2018 / 12:16:16 / svestkap"
    "Modified (format): / 01-02-2019 / 13:32:02 / svestkap"
! !

!Win32OperatingSystemTest methodsFor:'tests-unicodeWrite'!

testDefaultValue_01
    "Testing if value can be stored (defaultValue:) and read (defaultValue)
     Note: the value is stored in (Default) value at the key"
    | testingRegistryPath readData |
    
    registryPath := registryPath, '\', ' ルすしか'.
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    
    readData := testingRegistryPath defaultValue.
    self assert: readData isNil.
    
    testingRegistryPath defaultValue: 'すし.ACE.OLEDB.16.0'.    
    
    readData := testingRegistryPath defaultValue.
    self assert: readData = 'すし.ACE.OLEDB.16.0'.
    
    "
     self run:#testDefaultValue_01
     self new testDefaultValue_01
    "

    "Created: / 12-12-2018 / 12:35:53 / svestkap"
    "Modified (format): / 01-02-2019 / 13:55:01 / svestkap"
!

testDefaultValue_02
    "Testing if value can be stored (defaultValue:) and read (defaultValue) with registry type and size check
     Note: the value is stored in (Default) value at the key"
    | testingRegistryPath registryType readData |

    registryPath := registryPath, '\', ' ルすしか'.
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
  
    readData := testingRegistryPath defaultValue.
    self assert: readData isNil.       
    
    testingRegistryPath defaultValue: 'すし.ACE.OLEDB.16.0'.    
    
    registryType := testingRegistryPath valueTypeAndSize: ''.
    self assert: registryType keys first isSymbol.
    self assert: registryType keys first equals: #REG_SZ.
    self assert: registryType first isNumber.
    self assert: registryType first equals: 17.     
    
    
    readData := testingRegistryPath defaultValue.
    
    self assert: readData = 'すし.ACE.OLEDB.16.0'.
    
    "
     self run:#testDefaultValue_02
     self new testDefaultValue_02
    "

    "Created: / 12-12-2018 / 11:07:11 / svestkap"
    "Modified: / 12-12-2018 / 14:08:14 / svestkap"
    "Modified (comment): / 01-02-2019 / 13:55:06 / svestkap"
!

testWriteValueNamedPut_REG_BINARY_01
    "Testing if REG_BINARY zero value is written correctly via valueNamed:put:
     Data is written and read back again." 
    | testingRegistryPath readData |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.    
    testingRegistryPath valueNamed: 'non-zero' put: ByteArray new.
    
    readData := testingRegistryPath valueNamed: 'non-zero'.    
    
    self assert: readData = ByteArray new.
    
    "
     self run:#testWriteValueNamedPut_REG_BINARY_01
     self new testWriteValueNamedPut_REG_BINARY_01
    "

    "Created: / 04-12-2018 / 11:52:46 / svestkap"
    "Modified (format): / 01-02-2019 / 13:55:10 / svestkap"
!

testWriteValueNamedPut_REG_BINARY_02
    "Testing if REG_BINARY values are written correctly via valueNamed:put:
     Data is written and read back again." 
    | testingRegistryPath byteArray readData readDataHex |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    
    byteArray := ByteArray new: 5.
    "/ data to be written  
    byteArray replaceElementsFrom: 1 to: 5 withArray: #[18 234 11 0 18] startingAt: 1. 
    
    testingRegistryPath valueNamed: 'non-zero' put: byteArray.
    
    readData := testingRegistryPath valueNamed: 'non-zero'.
    readDataHex := readData hexPrintStringWithSeparator: $|.
    
    self assert: readData = #[18 234 11 0 18]. "/ ByteArray
    self assert: readDataHex = '12|EA|0B|00|12' "/ hex    

    "
     self run:#testWriteValueNamedPut_REG_BINARY_02
     self new testWriteValueNamedPut_REG_BINARY_02
    "

    "Created: / 04-12-2018 / 12:04:18 / svestkap"
    "Modified (format): / 01-02-2019 / 13:55:13 / svestkap"
!

testWriteValueNamedPut_REG_BINARY_03
    "Testing if new REG_BINARY value name is written correctly via valueNamed:put:
     Data is written and read back again." 
    | testingRegistryPath byteArray readData readDataHex |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    
    byteArray := ByteArray new: 5.
    "/ data to be written  
    byteArray replaceElementsFrom: 1 to: 5 withArray: #[18 234 11 0 18] startingAt: 1. 
    
    testingRegistryPath valueNamed: 'Binaryル' put: byteArray.
    
    readData := testingRegistryPath valueNamed: 'Binaryル'.
    readDataHex := readData hexPrintStringWithSeparator: $|.
    
    self assert: readData = #[18 234 11 0 18]. "/ ByteArray
    self assert: readDataHex = '12|EA|0B|00|12' "/ hex    

    "
     self run:#testWriteValueNamedPut_REG_BINARY_03
     self new testWriteValueNamedPut_REG_BINARY_03
    "

    "Created: / 07-12-2018 / 15:15:06 / svestkap"
    "Modified (format): / 01-02-2019 / 13:56:49 / svestkap"
!

testWriteValueNamedPut_REG_BINARY_04
    "Testing if new REG_BINARY value name is written correctly via valueNamed:put: with registry type and size check
     Data is written and read back again." 
    | testingRegistryPath byteArray readData readDataHex registryType |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
       
    byteArray := ByteArray new: 5.
    "/ data to be written  
    byteArray replaceElementsFrom: 1 to: 5 withArray: #[18 234 11 0 18] startingAt: 1. 
    
    testingRegistryPath valueNamed: 'Binaryル' put: byteArray.
    
    registryType := testingRegistryPath valueTypeAndSize: 'Binaryル'.
    self assert: registryType keys first equals: #REG_BINARY.
    self assert: registryType first equals: 5.   
    
    readData := testingRegistryPath valueNamed: 'Binaryル'.
    readDataHex := readData hexPrintStringWithSeparator: $|.
    
    self assert: readData = #[18 234 11 0 18]. "/ ByteArray
    self assert: readDataHex = '12|EA|0B|00|12' "/ hex    

    "
     self run:#testWriteValueNamedPut_REG_BINARY_04
     self new testWriteValueNamedPut_REG_BINARY_04
    "

    "Created: / 12-12-2018 / 12:36:46 / svestkap"
    "Modified (format): / 01-02-2019 / 13:56:52 / svestkap"
!

testWriteValueNamedPut_REG_BINARY_05
    "Testing if REG_BINARY values are written correctly via valueNamed:put:
     Data is written and read back again." 
    | testingRegistryPath byteArray readData readDataHex registryType |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    
    readData := testingRegistryPath valueNamed: 'non-zero'.
    self assert: readData = #[17 16].
    registryType := testingRegistryPath valueTypeAndSize: 'non-zero'.
    self assert: registryType keys first equals: #REG_BINARY.
    self assert: registryType first equals: 2.              
    
    byteArray := ByteArray new: 5.
    "/ data to be written  
    byteArray replaceElementsFrom: 1 to: 5 withArray: #[18 234 11 0 18] startingAt: 1. 
    "/ saving value into registry
    testingRegistryPath valueNamed: 'non-zero' put: byteArray.
    
    "/ testing the saved value
    registryType := testingRegistryPath valueTypeAndSize: 'non-zero'.
    self assert: registryType keys first equals: #REG_BINARY.
    self assert: registryType first equals: 5.
    
    readData := testingRegistryPath valueNamed: 'non-zero'.
    readDataHex := readData hexPrintStringWithSeparator: $|.
    
    self assert: readData = #[18 234 11 0 18]. "/ ByteArray
    self assert: readDataHex = '12|EA|0B|00|12' "/ hex    

    "
     self run:#testWriteValueNamedPut_REG_BINARY_05
     self new testWriteValueNamedPut_REG_BINARY_05
    "

    "Created: / 12-12-2018 / 13:16:13 / svestkap"
    "Modified (format): / 01-02-2019 / 13:56:55 / svestkap"
!

testWriteValueNamedPut_REG_DWORD_01
    "Testing if REG_DWORD values are written correctly via valueNamed:put:"
    | readData testingRegistryPath |

    readData := Integer new.     
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'dword_value' put: 7337.
    readData := testingRegistryPath valueNamed: 'dword_value'.

    self assert: readData = 7337.

    "
     self run:#testWriteValueNamedPut_REG_DWORD_01
     self new testWriteValueNamedPut_REG_DWORD_01
    "

    "Created: / 05-12-2018 / 11:35:52 / svestkap"
    "Modified: / 07-12-2018 / 15:13:18 / svestkap"
    "Modified (format): / 01-02-2019 / 13:56:59 / svestkap"
!

testWriteValueNamedPut_REG_DWORD_02
    "Testing if max DWORD is accepted as REG_DWORD (written correctly via valueNamed:put:)"
    | readData testingRegistryPath |

    readData := Integer new.          
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    "/ max DWORD value 0xffffffff -> 4294967295 (which is on x64 SmallInteger)    
    testingRegistryPath valueNamed: 'dword_value' put: 4294967295.
    readData := testingRegistryPath valueNamed: 'dword_value'.

    self assert: readData = 4294967295.

    "
     self run:#testWriteValueNamedPut_REG_DWORD_02
     self new testWriteValueNamedPut_REG_DWORD_02
    "

    "Created: / 05-12-2018 / 11:36:00 / svestkap"
    "Modified: / 07-12-2018 / 15:13:42 / svestkap"
    "Modified (format): / 01-02-2019 / 13:57:02 / svestkap"
!

testWriteValueNamedPut_REG_DWORD_03
    "Testing if REG_DWORD values are written correctly via valueNamed:put:
     Data is written and read back again."
    | readData testingRegistryPath |

    readData := Integer new.          
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: '11' put: 7337.
    readData := testingRegistryPath valueNamed: '11'.

    self assert: readData = 7337

    "
     self run:#testWriteValueNamedPut_REG_DWORD_03
     self new testWriteValueNamedPut_REG_DWORD_03
    "

    "Created: / 05-12-2018 / 11:35:36 / svestkap"
    "Modified (format): / 01-02-2019 / 13:57:05 / svestkap"
!

testWriteValueNamedPut_REG_DWORD_04
    "Testing if REG_DWORD values are written correctly via valueNamed:put:
     Data is written and read back again."
    | readData testingRegistryPath |
   
    readData := Integer new.          
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: '11' put: 7337.
    readData := testingRegistryPath valueNamed: '11'.

    self assert: readData = 7337

    "
     self run:#testWriteValueNamedPut_REG_DWORD_04
     self new testWriteValueNamedPut_REG_DWORD_04
    "

    "Created: / 05-12-2018 / 11:39:00 / svestkap"
    "Modified (format): / 01-02-2019 / 13:57:09 / svestkap"
!

testWriteValueNamedPut_REG_DWORD_05
    "Testing if trying to access REG_DWORD values via name as number raises a predefined error"
    | testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.

    self should: [ testingRegistryPath valueNamed: 11 put: 7337] raise: Error
        suchThat: [ :e | e messageText = 'nameString is not a string!!' ].        

    "
     self run:#testWriteValueNamedPut_REG_DWORD_05
     self new testWriteValueNamedPut_REG_DWORD_05
    "

    "Created: / 05-12-2018 / 12:29:06 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:28:28 / svestkap"
!

testWriteValueNamedPut_REG_DWORD_06
    "Testing if new REG_DWORD value name is written correctly via valueNamed:put:
     Data is written and read back again."

    | readData testingRegistryPath |

    readData := Integer new.          
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: '374657654ル' put: 7337.
    readData := testingRegistryPath valueNamed: '374657654ル'.

    self assert: readData = 7337

    "
     self run:#testWriteValueNamedPut_REG_DWORD_06
     self new testWriteValueNamedPut_REG_DWORD_06
    "

    "Created: / 07-12-2018 / 15:10:24 / svestkap"
!

testWriteValueNamedPut_REG_DWORD_07
    "Testing if REG_DWORD values are written correctly via valueNamed:put: with registry type and size check"
    | readData testingRegistryPath registryType endianness |

    readData := Integer new.     
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    
    "/ checking registry type and size
    registryType := testingRegistryPath valueTypeAndSize: 'dword_value'.
    registryType keys first == #REG_DWORD_LITTLE_ENDIAN ifTrue: [ 
        self assert: registryType keys first equals: #REG_DWORD_LITTLE_ENDIAN.
        endianness := #REG_DWORD_LITTLE_ENDIAN
    ] ifFalse: [ 
        self assert: registryType keys first equals: #REG_DWORD_BIG_ENDIAN.
        endianness := #REG_DWORD_BIG_ENDIAN
    ].  
    self assert: registryType first equals: 4. "/ 32 bits = 4 bytes      
    "/ read data
    readData := testingRegistryPath valueNamed: 'dword_value'.
    self assert: readData = 9135. "/ the previous value
    
    "/ inserting new value
    testingRegistryPath valueNamed: 'dword_value' put: 7337.  
    
    "/ checking registry type and size
    registryType := testingRegistryPath valueTypeAndSize: 'dword_value'.
    self assert: registryType keys first equals: endianness.
    self assert: registryType first equals: 4. "/ 32 bits = 4 bytes    
    
    "/ read data
    readData := testingRegistryPath valueNamed: 'dword_value'.    
    self assert: readData = 7337.

    "
     self run:#testWriteValueNamedPut_REG_DWORD_07
     self new testWriteValueNamedPut_REG_DWORD_07
    "

    "Created: / 12-12-2018 / 12:13:53 / svestkap"
    "Modified (format): / 01-02-2019 / 14:10:04 / svestkap"
!

testWriteValueNamedPut_REG_EXPAND_SZ_01
    "Testing if REG_EXPAND_SZ values are written correctly via valueNamed:put:
     Data is written and read back again."
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'bledesu' put: '"%PATH%"' unexpandedReferences: true.
    readData := testingRegistryPath valueNamed: 'bledesu'.
    
    self assert: readData = '"%PATH%"'

    "
     self run:#testWriteValueNamedPut_REG_EXPAND_SZ_01
     self new testWriteValueNamedPut_REG_EXPAND_SZ_01
    "

    "Created: / 07-12-2018 / 15:08:50 / svestkap"
    "Modified (format): / 01-02-2019 / 14:29:14 / svestkap"
!

testWriteValueNamedPut_REG_EXPAND_SZ_02
    "Testing if new REG_EXPAND_SZ value name is written correctly via valueNamed:put:
     Data is written and read back again."
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'Yooooル' put: '"%PATH%"' unexpandedReferences: true.
    readData := testingRegistryPath valueNamed:  'Yooooル'.
    
    self assert: readData = '"%PATH%"'

    "
     self run:#testWriteValueNamedPut_REG_EXPAND_SZ_02
     self new testWriteValueNamedPut_REG_EXPAND_SZ_02
    "

    "Created: / 07-12-2018 / 15:09:14 / svestkap"
    "Modified (format): / 01-02-2019 / 14:29:20 / svestkap"
!

testWriteValueNamedPut_REG_EXPAND_SZ_03
    "Testing if new REG_EXPAND_SZ value name is written correctly via valueNamed:put: with registry type and size check
     Data is written and read back again."

    | readData testingRegistryPath registryType |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'Yooooル' put: '"%PATH%"' unexpandedReferences: true.
    
    registryType := testingRegistryPath valueTypeAndSize: 'Yooooル'.
    self assert: registryType keys first equals: #REG_EXPAND_SZ.
    self assert: registryType first equals: 8.    
    
    readData := testingRegistryPath valueNamed:  'Yooooル'.
    self assert: readData = '"%PATH%"'

    "
     self run:#testWriteValueNamedPut_REG_EXPAND_SZ_03
     self new testWriteValueNamedPut_REG_EXPAND_SZ_03
    "

    "Created: / 12-12-2018 / 12:41:44 / svestkap"
!

testWriteValueNamedPut_REG_EXPAND_SZ_04
    "Testing if REG_EXPAND_SZ values are written correctly via valueNamed:put: with registry type and size check    
     Data is written and read back again (notice the registry type change #REG_SZ to #REG_EXPAND_SZ)."
    | readData testingRegistryPath registryType |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    "/ checking type and size
    registryType := testingRegistryPath valueTypeAndSize: 'bledesu'.
    self assert: registryType keys first equals: #REG_SZ.
    self assert: registryType first equals: 47.    
    "/ checking the actual value
    readData := testingRegistryPath valueNamed: 'bledesu'.                                                              
    self assert: readData = '''Testing Unicode chars ř ž č ルすしかき'').          '.
    
    "/ saving value into the registry
    testingRegistryPath valueNamed: 'bledesu' put: '"%PATH%"' unexpandedReferences: true.
    "/ checking type and size
    registryType := testingRegistryPath valueTypeAndSize: 'bledesu'.
    self assert: registryType keys first equals: #REG_EXPAND_SZ.
    self assert: registryType first equals: 8.        
    "/ checking the actual value 
    readData := testingRegistryPath valueNamed: 'bledesu'.
    self assert: readData = '"%PATH%"'

    "
     self run:#testWriteValueNamedPut_REG_EXPAND_SZ_04
     self new testWriteValueNamedPut_REG_EXPAND_SZ_04
    "

    "Created: / 12-12-2018 / 13:22:25 / svestkap"
    "Modified (format): / 01-02-2019 / 14:29:48 / svestkap"
!

testWriteValueNamedPut_REG_MULTI_SZ_01
    "Testing if REG_MULTI_SZ values are write correctly via valueNamed:put:"
    | readData testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold' put: #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'řeřicha - ルすしかき').
    readData := testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold'.

    self assert: readData = #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'řeřicha - ルすしかき').

    "
     self run:#testWriteValueNamedPut_REG_MULTI_SZ_01
     self new testWriteValueNamedPut_REG_MULTI_SZ_01
    "

    "Created: / 27-11-2018 / 09:29:57 / svestkap"
    "Modified (format): / 01-02-2019 / 14:30:32 / svestkap"
!

testWriteValueNamedPut_REG_MULTI_SZ_02
    "Testing if REG_MULTI_SZ values are write correctly via valueNamed:put:
     The value data could be up to available memory (in reality NOT recommended to go over 1MB).
     Testing here a 2^16 + 2 sized OrderedCollection (a reasonable trade-off between size and speed)"
    | testingRegistryPath testData testDataArray readData |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.    
    testData := OrderedCollection new.
    
    "/ testing 2^15 + 1 which should be 
    "/ 2^15 + 1 timeRepeat -> testData OrderedCollection size should be: 2^16 + 1 (65538)
    32769 timesRepeat: [ testData add: 'SEGOEUIB.TTF,Segoe UI Bold,110,82'.
                       testData add: 'řeřicha - ルすしかき'
    ].
    
    testDataArray := testData asArray.
    "/ storing the array        
    testingRegistryPath valueNamed: 'ř ž č ルすしか' put: testDataArray.
    "/ reading the stored array back
    readData := testingRegistryPath valueNamed: 'ř ž č ルすしか'.
        
    self assert: readData = testDataArray.
    
    "
     self run:#testWriteValueNamedPut_REG_MULTI_SZ_02
     self new testWriteValueNamedPut_REG_MULTI_SZ_02
    "

    "Created: / 28-11-2018 / 14:46:55 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:32:22 / svestkap"
!

testWriteValueNamedPut_REG_MULTI_SZ_03
    "Testing if REG_MULTI_SZ an empty array is written via valueNamed:put:"
    | readData testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold' put: Array new.
    readData := testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold'.

    self assert: readData isEmpty.
    self assert: readData isArray.

    "
     self run:#testWriteValueNamedPut_REG_MULTI_SZ_03
     self new testWriteValueNamedPut_REG_MULTI_SZ_03
    "

    "Created: / 05-12-2018 / 11:54:05 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:33:14 / svestkap"
!

testWriteValueNamedPut_REG_MULTI_SZ_04
    "Testing if new REG_MULTI_SZ value name is written correctly via valueNamed:put:"
    | readData testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'new_reg_multiル' put: #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'řeřicha - ルすしかき').
    readData := testingRegistryPath valueNamed: 'new_reg_multiル'.

    self assert: readData = #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'řeřicha - ルすしかき').

    "
     self run:#testWriteValueNamedPut_REG_MULTI_SZ_04
     self new testWriteValueNamedPut_REG_MULTI_SZ_04
    "

    "Created: / 07-12-2018 / 15:08:03 / svestkap"
    "Modified (format): / 01-02-2019 / 14:33:54 / svestkap"
!

testWriteValueNamedPut_REG_MULTI_SZ_05
    "Testing if REG_MULTI_SZ values are write correctly via valueNamed:put: with registry type and size check"
    | registryType readData testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold' put: #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'řeřicha - ルすしかき').
    readData := testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold'.

    self assert: readData = #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'řeřicha - ルすしかき').
    
    registryType := testingRegistryPath valueTypeAndSize: 'Font_Leelawadee UI Bold'.
    self assert: registryType keys first equals: #REG_MULTI_SZ.
    
    "/ (array node size + terminating null) + (array node size + terminating null) * sizeof(wchar_t) + terminating null
    "/ ((Array at: 1) size + 1) + ((Array at: 2) size + 1) * 2 + 1 = (34 + 16) * 2 + 1 = 101     
    self assert: (registryType at: #REG_MULTI_SZ) equals: 101.       
    "
     self run:#testWriteValueNamedPut_REG_MULTI_SZ_05
     self new testWriteValueNamedPut_REG_MULTI_SZ_05
    "

    "Created: / 12-12-2018 / 11:34:08 / svestkap"
    "Modified (format): / 01-02-2019 / 14:34:22 / svestkap"
!

testWriteValueNamedPut_REG_NONE_01
    "Testing if REG_NONE values are written correctly via valueNamed:put:
     Data is written and read back again."
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'bledesu' put: nil.
    readData := testingRegistryPath valueNamed: 'bledesu'.
    
    self assert: readData isNil

    "
     self run:#testWriteValueNamedPut_REG_NONE_01
     self new testWriteValueNamedPut_REG_NONE_01
    "

    "Created: / 07-12-2018 / 15:06:08 / svestkap"
    "Modified (format): / 01-02-2019 / 14:34:27 / svestkap"
!

testWriteValueNamedPut_REG_NONE_02
    "Testing if new REG_NONE value name is written correctly via valueNamed:put:
     Data is written and read back again."
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'New nilル name' put: nil.
    readData := testingRegistryPath valueNamed: 'New nilル name'.
    
    self assert: readData isNil

    "
     self run:#testWriteValueNamedPut_REG_NONE_02
     self new testWriteValueNamedPut_REG_NONE_02
    "

    "Created: / 07-12-2018 / 15:06:48 / svestkap"
    "Modified (format): / 01-02-2019 / 14:34:44 / svestkap"
!

testWriteValueNamedPut_REG_NONE_03
    "Testing if new REG_NONE value name is written correctly via valueNamed:put: 
     with registry type and size check. Data is written and read back again."
    | readData testingRegistryPath registryType |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'New nilル name' put: nil.
    
    registryType := testingRegistryPath valueTypeAndSize: 'New nilル name'.
    self assert: registryType keys first equals: #REG_NONE.
    self assert: registryType first equals: 0.    
    
    readData := testingRegistryPath valueNamed: 'New nilル name'.
    
    self assert: readData isNil

    "
     self run:#testWriteValueNamedPut_REG_NONE_03
     self new testWriteValueNamedPut_REG_NONE_03
    "

    "Created: / 12-12-2018 / 12:47:40 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:35:12 / svestkap"
!

testWriteValueNamedPut_REG_QWORD_01
    "Testing if max QWORD value is written and read correctly from REG_QWORD (valueNamed:put: and valueNamed:).
     Storing maximum QWORD value (0xffffffffffffffff -> 18446744073709551615x64)"
    | readData testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'qword_max' put: 18446744073709551615.
    readData := testingRegistryPath valueNamed: 'qword_max'.

    self assert: readData = 18446744073709551615.

    "
     self run:#testReadValueNamed_REG_QWORD_01
     self new testReadValueNamed_REG_QWORD_01
    "

    "Created: / 26-11-2018 / 14:54:45 / svestkap"
    "Modified: / 07-12-2018 / 15:11:56 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:37:55 / svestkap"
!

testWriteValueNamedPut_REG_QWORD_02
    "Testing what happens if more then max value is stored in REG_QWORD registry type (valueNamed:put: and valueNamed:)"
    | readData testingRegistryPath |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    "/ max QWORD value is: 0xff-ff-ff-ff-ff-ff-ff-ff -> 18446744073709551615 (on x64 only)
    testingRegistryPath valueNamed: 'qword_max' put: 18446744073709551700.
    readData := testingRegistryPath valueNamed: 'qword_max'.

    self assert: readData ~= 18446744073709551700.
    "/ when you try to store more than maximum value you will get only the maximum losing the rest
    self assert: readData = 18446744073709551615.

    "
     self run:#testWriteValueNamedPut_REG_QWORD_02
     self new testWriteValueNamedPut_REG_QWORD_02
    "

    "Created: / 04-12-2018 / 11:02:20 / svestkap"
    "Modified: / 07-12-2018 / 15:12:12 / svestkap"
    "Modified (format): / 01-02-2019 / 14:36:06 / svestkap"
!

testWriteValueNamedPut_REG_QWORD_03
    "Testing if new QWORD value name is written and read correctly from REG_QWORD (valueNamed:put: and valueNamed:)"
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'qword_new_testingル' put: 18446744073709551101.
    readData := testingRegistryPath valueNamed: 'qword_new_testingル'.

    self assert: readData = 18446744073709551101.

    "
     self run:#testWriteValueNamedPut_REG_QWORD_03
     self new testWriteValueNamedPut_REG_QWORD_03
    "

    "Created: / 07-12-2018 / 15:05:48 / svestkap"
    "Modified (format): / 01-02-2019 / 14:36:20 / svestkap"
!

testWriteValueNamedPut_REG_QWORD_04
    "Testing if max QWORD value is written and read correctly from REG_QWORD (valueNamed:put: and valueNamed:)
     with registry type and size check. Storing maximum QWORD value (0xffffffffffffffff -> 18446744073709551615(x64))"
    | readData testingRegistryPath registryType |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'qword_max' put: 18446744073709551615.
    readData := testingRegistryPath valueNamed: 'qword_max'.
    
    registryType := testingRegistryPath valueTypeAndSize: 'qword_max'.
    self assert: registryType keys first equals: #REG_QWORD.
    self assert: registryType first equals: 8. "/ 64 bits = 8 bytes
    
    self assert: readData = 18446744073709551615.

    "
     self run:#testWriteValueNamedPut_REG_QWORD_04
     self new testWriteValueNamedPut_REG_QWORD_04
    "

    "Created: / 12-12-2018 / 12:08:35 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:36:34 / svestkap"
!

testWriteValueNamedPut_REG_QWORD_05
    "Testing if max QWORD value is written and read correctly from REG_QWORD (valueNamed:put: and valueNamed:)
     with registry type and size check.  Notice the #REG_SZ -> #REG_QWORD change.
     Storing maximum QWORD value (0xffffffffffffffff -> 18446744073709551615(x64))"
    | readData testingRegistryPath registryType |

    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    "/ checking type and size
    registryType := testingRegistryPath valueTypeAndSize: ' ř ž č ル.          '.    
    self assert: registryType keys first equals: #REG_SZ.
    self assert: registryType first equals: 33. "/ string size
    "/ checking the value
    readData := testingRegistryPath valueNamed: ' ř ž č ル.          '.    
    self assert: readData = 'Testing Unicode chars ř ž č ルすしかき'.
    
    "/ saving into registry
    testingRegistryPath valueNamed: ' ř ž č ル.          ' put: 18446744073709551615.
        
    registryType := testingRegistryPath valueTypeAndSize: ' ř ž č ル.          '.    
    self assert: registryType keys first equals: #REG_QWORD.
    self assert: registryType first equals: 8. "/ 64 bits = 8 bytes
    
    readData := testingRegistryPath valueNamed: ' ř ž č ル.          '.    
    self assert: readData = 18446744073709551615.

    "
     self run:#testWriteValueNamedPut_REG_QWORD_05
     self new testWriteValueNamedPut_REG_QWORD_05
    "

    "Created: / 12-12-2018 / 13:38:31 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:37:40 / svestkap"
!

testWriteValueNamedPut_REG_SZ_01
    "Testing if REG_SZ values are written correctly via valueNamed:put:.
     Data is written and read back again."
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'bledesu' put: 'řeřicha - ルすしかき'.
    readData := testingRegistryPath valueNamed: 'bledesu'.
    
    self assert: readData = 'řeřicha - ルすしかき'.

    "
     self run:#testWriteValueNamedPut_REG_SZ_01
     self new testWriteValueNamedPut_REG_SZ_01
    "

    "Created: / 26-11-2018 / 09:51:58 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:38:18 / svestkap"
!

testWriteValueNamedPut_REG_SZ_02
    "Testing if REG_SZ values are written correctly via valueNamed:put:. Data is written and read back again.
     Note: this is testing Unicode with spaces - probably the worst combination"
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'しかき    ' put: 'řeřicha - ルすしかき'.
    readData := testingRegistryPath valueNamed: 'しかき    '.

    self assert: readData = 'řeřicha - ルすしかき'.

    "
     self run:#testReadValueNamed_REG_SZ_03
     self new testReadValueNamed_REG_SZ_03
    "

    "Created: / 26-11-2018 / 14:10:35 / svestkap"
    "Modified (format): / 01-02-2019 / 14:41:51 / svestkap"
!

testWriteValueNamedPut_REG_SZ_03
    "Testing if REG_SZ empty value is written correctly via valueNamed:put:. Data is written and read back again.
     Note: this is testing Unicode with spaces - probably the worst combination"
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'しかき    ' put: ''.
    readData := testingRegistryPath valueNamed: 'しかき    '.

    self assert: readData = ''

    "
     self run:#testWriteValueNamedPut_REG_SZ_03
     self new testWriteValueNamedPut_REG_SZ_03
    "

    "Created: / 05-12-2018 / 10:16:59 / svestkap"
    "Modified (format): / 01-02-2019 / 14:41:35 / svestkap"
!

testWriteValueNamedPut_REG_SZ_04
    "Testing if REG_SZ empty value is written correctly via valueNamed:put:. Data is written and read back again.
     Note: this is testing Unicode with spaces - probably the worst combination"
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'bledesu' put: ''.
    readData := testingRegistryPath valueNamed: 'bledesu'.

    self assert: readData = ''

    "
     self run:#testWriteValueNamedPut_REG_SZ_04
     self new testWriteValueNamedPut_REG_SZ_04
    "

    "Created: / 05-12-2018 / 10:22:39 / svestkap"
    "Modified (format): / 01-02-2019 / 14:41:26 / svestkap"
!

testWriteValueNamedPut_REG_SZ_05
    "Testing if REG_SZ completely new value is written correctly via valueNamed:put:.
     Data is written and read back again."
    | readData testingRegistryPath |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'Newル guy' put: 'Singルing'.
    readData := testingRegistryPath valueNamed: 'Newル guy'.

    self assert: readData = 'Singルing'

    "
     self run:#testWriteValueNamedPut_REG_SZ_05
     self new testWriteValueNamedPut_REG_SZ_05
    "

    "Created: / 07-12-2018 / 15:03:05 / svestkap"
    "Modified (format): / 01-02-2019 / 14:40:47 / svestkap"
!

testWriteValueNamedPut_REG_SZ_06
    "Testing if REG_SZ completely new value is written correctly via valueNamed:put: with registry type and size check
     Data is written and read back again."
    | readData testingRegistryPath registryType |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    testingRegistryPath valueNamed: 'Newル guy' put: 'Singルing'.
    
    registryType := testingRegistryPath valueTypeAndSize: 'Newル guy'.
    self assert: registryType keys first equals: #REG_SZ.
    self assert: registryType first equals: 8.           
   
    readData := testingRegistryPath valueNamed: 'Newル guy'. 
    self assert: readData = 'Singルing'

    "
     self run:#testWriteValueNamedPut_REG_SZ_06
     self new testWriteValueNamedPut_REG_SZ_06
    "

    "Created: / 12-12-2018 / 12:39:52 / svestkap"
    "Modified (format): / 01-02-2019 / 14:43:29 / svestkap"
!

testWriteValueNamedPut_REG_SZ_07
    "Testing if REG_SZ values are written correctly via valueNamed:put:. Data is written and read back again.
     Note: the registry type change: #REG_MULTI_SZ to #REG_SZ."
    | readData testingRegistryPath registryType |

    readData := Unicode16String new.    
    testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath.
    "/ reading type and size
    registryType := testingRegistryPath valueTypeAndSize: 'ř ž č ルすしか'.
    self assert: registryType keys first equals: #REG_MULTI_SZ.
    self assert: registryType first equals: 974. "/ REG_MULTI_SZ size in bytes
   
    "/ saving data (unicode string) into registry
    testingRegistryPath valueNamed: 'bledesu' put: 'řeřicha - ルすしかき'.
    
    registryType := testingRegistryPath valueTypeAndSize: 'bledesu'.
    self assert: registryType keys first equals: #REG_SZ.
    self assert: registryType first equals: 15.              
    
    readData := testingRegistryPath valueNamed: 'bledesu'.
    self assert: readData = 'řeřicha - ルすしかき'.

    "
     self run:#testWriteValueNamedPut_REG_SZ_07
     self new testWriteValueNamedPut_REG_SZ_07
    "

    "Created: / 12-12-2018 / 13:48:00 / svestkap"
    "Modified (comment): / 01-02-2019 / 14:44:48 / svestkap"
! !

!Win32OperatingSystemTest class methodsFor:'documentation'!

version
    ^ '$Header$'
!

version_HG

    ^ '$Changeset: <not expanded> $'
! !