| 262 | |
| 263 | [HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete] |
| 264 | |
| 265 | [HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\ughu] |
| 266 | "bledesu"="''Testing Unicode chars ř ž č ルすしかき''). " |
| 267 | "しかき "="Testus gradus" |
| 268 | " ř ž č ル. "="Testing Unicode chars ř ž č ルすしかき" |
| 269 | "zero"=hex: |
| 270 | "non-zero"=hex:11,10 |
| 271 | "す "=hex:10 |
| 272 | "dword_value"=dword:000023af |
| 273 | "き"=dword:234234af |
| 274 | "qwordvalue"=hex(b):ad,61,28,a3,95,0e,74,79 |
| 275 | "qword_max"=hex(b):ff,ff,ff,ff,ff,ff,ff,ff |
| 276 | "すし"=hex(b):ef,ad,00,00,00,00,00,00 |
| 277 | "Font_Leelawadee UI Bold"=hex(7):53,00,45,00,47,00,4f,00,45,00,55,00,49,00,42,\ |
| 278 | 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,\ |
| 279 | 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,\ |
| 280 | 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,\ |
| 281 | 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,\ |
| 282 | 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,\ |
| 283 | 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,\ |
| 284 | 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,\ |
| 285 | 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,\ |
| 286 | 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,\ |
| 287 | 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,\ |
| 288 | 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,\ |
| 289 | 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,\ |
| 290 | 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,\ |
| 291 | 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,\ |
| 292 | 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,\ |
| 293 | 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,\ |
| 294 | 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,\ |
| 295 | 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,\ |
| 296 | 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,\ |
| 297 | 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,\ |
| 298 | 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,\ |
| 299 | 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,\ |
| 300 | 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,\ |
| 301 | 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,\ |
| 302 | 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,\ |
| 303 | 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,\ |
| 304 | 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,\ |
| 305 | 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,\ |
| 306 | 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,\ |
| 307 | 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,\ |
| 308 | 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,\ |
| 309 | 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,\ |
| 310 | 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,\ |
| 311 | 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,\ |
| 312 | 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,\ |
| 313 | 62,00,6f,00,6c,00,00,00,00,00 |
| 314 | "ř ž č ルすしか"=hex(7):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,\ |
| 315 | 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,\ |
| 316 | 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,\ |
| 317 | 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,\ |
| 318 | 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,\ |
| 319 | 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,\ |
| 320 | 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,\ |
| 321 | 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,\ |
| 322 | 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,\ |
| 323 | 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,\ |
| 324 | 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,\ |
| 325 | 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,\ |
| 326 | 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,\ |
| 327 | 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,\ |
| 328 | 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,\ |
| 329 | 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,\ |
| 330 | 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,\ |
| 331 | 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,\ |
| 332 | 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,\ |
| 333 | 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,\ |
| 334 | 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,\ |
| 335 | 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,\ |
| 336 | 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,\ |
| 337 | 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,\ |
| 338 | 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,\ |
| 339 | 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,\ |
| 340 | 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,\ |
| 341 | 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,\ |
| 342 | 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,\ |
| 343 | 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,\ |
| 344 | 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,\ |
| 345 | 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,\ |
| 346 | 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,\ |
| 347 | 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,\ |
| 348 | 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,\ |
| 349 | 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,\ |
| 350 | 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,\ |
| 351 | 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,\ |
| 352 | 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,\ |
| 353 | 00,00,00,00,00 |
| 354 | "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,\ |
| 355 | 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,\ |
| 356 | 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,\ |
| 357 | 2e,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,20,00,00,00 |
| 358 | " č ルすしか"=hex(2):27,00,54,00,65,00,73,00,74,00,69,00,6e,00,67,00,20,00,55,00,\ |
| 359 | 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,\ |
| 360 | 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,\ |
| 361 | 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,\ |
| 362 | 00 |
| 363 | [HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\zubr] |
| 364 | |
| 365 | [HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\bobr] |
| 366 | |
| 367 | [HKEY_CURRENT_USER\Software\SmalltalkX-tests\ ルすしか_testing_delete\bobr\boříččátka] |
| 509 | !Win32OperatingSystemTest methodsFor:'tests-UnicodeCreate'! |
| 510 | |
| 511 | testCreatingSubKeyNamed_01 |
| 512 | "Testing if new subKey is created" |
| 513 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 514 | |
| 515 | readData := Unicode16String new. |
| 516 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 517 | readSubKeys := testingRegistryPath subKeys. |
| 518 | subKeysCount := readSubKeys size. |
| 519 | |
| 520 | self assert: subKeysCount = 3. |
| 521 | "/ creating the new subKey |
| 522 | readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: nil createIfAbsent: true. |
| 523 | "/ check if new path is with the subKeyNamed above |
| 524 | self assert: (readData path copyAfterLast: $\) = 'bledesu ル' . |
| 525 | |
| 526 | readSubKeys := testingRegistryPath subKeys. |
| 527 | self assert: readSubKeys size = (subKeysCount + 1) |
| 528 | |
| 529 | " |
| 530 | self run:#testCreatingSubKeyNamed_01 |
| 531 | self new testCreatingSubKeyNamed_01 |
| 532 | " |
| 533 | |
| 534 | "Created: / 07-12-2018 / 15:30:55 / svestkap" |
| 535 | ! |
| 536 | |
| 537 | testCreatingSubKeyNamed_02 |
| 538 | "Testing if new subKey is created via createSubKeyNamed:" |
| 539 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 540 | |
| 541 | readData := Unicode16String new. |
| 542 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 543 | readSubKeys := testingRegistryPath subKeys. |
| 544 | subKeysCount := readSubKeys size. |
| 545 | |
| 546 | self assert: subKeysCount = 3. |
| 547 | "/ creating the new subKey |
| 548 | readData := testingRegistryPath createSubKeyNamed: 'bledesu ル'. |
| 549 | "/ check if new path is with the subKeyNamed above |
| 550 | self assert: (readData path copyAfterLast: $\) = 'bledesu ル' . |
| 551 | |
| 552 | readSubKeys := testingRegistryPath subKeys. |
| 553 | self assert: readSubKeys size = (subKeysCount + 1) |
| 554 | |
| 555 | " |
| 556 | self run:#testCreatingSubKeyNamed_02 |
| 557 | self new testCreatingSubKeyNamed_02 |
| 558 | " |
| 559 | |
| 560 | "Created: / 07-12-2018 / 15:57:09 / svestkap" |
| 561 | ! |
| 562 | |
| 563 | testCreatingSubKeyNamed_Wow64_32_01 |
| 564 | "Testing if new subKey is created in Wow64_32 (32bit program reading 32bit registry)" |
| 565 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 566 | |
| 567 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 568 | |
| 569 | readData := Unicode16String new. |
| 570 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 571 | readSubKeys := testingRegistryPath subKeys. |
| 572 | subKeysCount := readSubKeys size. |
| 573 | |
| 574 | self assert: subKeysCount = 3. |
| 575 | "/ creating the new subKey |
| 576 | readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: #KEY_WOW64_32KEY createIfAbsent: true. |
| 577 | "/ check if new path is with the subKeyNamed above |
| 578 | self assert: (readData path copyAfterLast: $\) = 'bledesu ル' . |
| 579 | |
| 580 | readSubKeys := testingRegistryPath subKeys. |
| 581 | self assert: readSubKeys size = (subKeysCount + 1) |
| 582 | |
| 583 | " |
| 584 | self run:#testCreatingSubKeyNamed_Wow64_32_01 |
| 585 | self new testCreatingSubKeyNamed_Wow64_32_01 |
| 586 | " |
| 587 | |
| 588 | "Created: / 07-12-2018 / 15:58:24 / svestkap" |
| 589 | ! |
| 590 | |
| 591 | testCreatingSubKeyNamed_Wow64_32_02 |
| 592 | "Testing if new subKey is created in Wow64_32 (32bit program reading 32bit registry) via createSubKeyNamed:flags:" |
| 593 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 594 | |
| 595 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 596 | |
| 597 | readData := Unicode16String new. |
| 598 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 599 | readSubKeys := testingRegistryPath subKeys. |
| 600 | subKeysCount := readSubKeys size. |
| 601 | |
| 602 | self assert: subKeysCount = 3. |
| 603 | "/ creating the new subKey |
| 604 | readData := testingRegistryPath createSubKeyNamed: 'bledesu ル' flags: #KEY_WOW64_32KEY. |
| 605 | "/ check if new path is with the subKeyNamed above |
| 606 | self assert: (readData path copyAfterLast: $\) = 'bledesu ル' . |
| 607 | |
| 608 | readSubKeys := testingRegistryPath subKeys. |
| 609 | self assert: readSubKeys size = (subKeysCount + 1) |
| 610 | |
| 611 | " |
| 612 | self run:#testCreatingSubKeyNamed_Wow64_32_02 |
| 613 | self new testCreatingSubKeyNamed_Wow64_32_02 |
| 614 | " |
| 615 | |
| 616 | "Created: / 07-12-2018 / 15:59:32 / svestkap" |
| 617 | ! |
| 618 | |
| 619 | testCreatingSubKeyNamed_Wow64_64_01 |
| 620 | "Testing if new subKey is created in Wow64_32 (32bit program reading 64bit registry)" |
| 621 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 622 | |
| 623 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 624 | |
| 625 | readData := Unicode16String new. |
| 626 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 627 | readSubKeys := testingRegistryPath subKeys. |
| 628 | subKeysCount := readSubKeys size. |
| 629 | |
| 630 | self assert: subKeysCount = 3. |
| 631 | "/ creating the new subKey |
| 632 | readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: #KEY_WOW64_64KEY createIfAbsent: true. |
| 633 | "/ check if new path is with the subKeyNamed above |
| 634 | self assert: (readData path copyAfterLast: $\) = 'bledesu ル' . |
| 635 | |
| 636 | readSubKeys := testingRegistryPath subKeys. |
| 637 | self assert: readSubKeys size = (subKeysCount + 1) |
| 638 | |
| 639 | " |
| 640 | self run:#testCreatingSubKeyNamed_Wow64_64_01 |
| 641 | self new testCreatingSubKeyNamed_Wow64_64_01 |
| 642 | " |
| 643 | |
| 644 | "Created: / 07-12-2018 / 15:58:38 / svestkap" |
| 645 | ! |
| 646 | |
| 647 | testCreatingSubKeyNamed_Wow64_64_02 |
| 648 | "Testing if new subKey is created in Wow64_32 (32bit program reading 64bit registry) via createSubKeyNamed:flags:" |
| 649 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 650 | |
| 651 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 652 | |
| 653 | readData := Unicode16String new. |
| 654 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 655 | readSubKeys := testingRegistryPath subKeys. |
| 656 | subKeysCount := readSubKeys size. |
| 657 | |
| 658 | self assert: subKeysCount = 3. |
| 659 | "/ creating the new subKey |
| 660 | readData := testingRegistryPath createSubKeyNamed: 'bledesu ル' flags: #KEY_WOW64_64KEY. |
| 661 | "/ check if new path is with the subKeyNamed above |
| 662 | self assert: (readData path copyAfterLast: $\) = 'bledesu ル' . |
| 663 | |
| 664 | readSubKeys := testingRegistryPath subKeys. |
| 665 | self assert: readSubKeys size = (subKeysCount + 1) |
| 666 | |
| 667 | " |
| 668 | self run:#testCreatingSubKeyNamed_Wow64_64_02 |
| 669 | self new testCreatingSubKeyNamed_Wow64_64_02 |
| 670 | " |
| 671 | |
| 672 | "Created: / 07-12-2018 / 15:59:50 / svestkap" |
| 673 | ! ! |
| 674 | |
| 675 | !Win32OperatingSystemTest methodsFor:'tests-UnicodeOpen'! |
| 676 | |
| 677 | testOpenSubKeyNamed_01 |
| 678 | "Testing if an old subKey is opened" |
| 679 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 680 | |
| 681 | readData := Unicode16String new. |
| 682 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 683 | readSubKeys := testingRegistryPath subKeys. |
| 684 | subKeysCount := readSubKeys size. |
| 685 | |
| 686 | self assert: subKeysCount = 3. |
| 687 | "/ trying to read already existing subKey |
| 688 | readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: nil createIfAbsent: false. |
| 689 | |
| 690 | "/ check if the existing |
| 691 | self assert: (readData path copyAfterLast: $\) = ' ルすしか'. |
| 692 | |
| 693 | " |
| 694 | self run:#testOpenSubKeyNamed_01 |
| 695 | self new testOpenSubKeyNamed_01 |
| 696 | " |
| 697 | |
| 698 | "Created: / 07-12-2018 / 15:34:21 / svestkap" |
| 699 | ! |
| 700 | |
| 701 | testOpenSubKeyNamed_02 |
| 702 | "Testing if an old subKey is opened" |
| 703 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 704 | |
| 705 | readData := Unicode16String new. |
| 706 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 707 | readSubKeys := testingRegistryPath subKeys. |
| 708 | subKeysCount := readSubKeys size. |
| 709 | |
| 710 | self assert: subKeysCount = 3. |
| 711 | "/ trying to read already existing subKey |
| 712 | readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: nil createIfAbsent: true. |
| 713 | |
| 714 | "/ check if the existing |
| 715 | self assert: (readData path copyAfterLast: $\) = ' ルすしか'. |
| 716 | |
| 717 | " |
| 718 | self run:#testOpenSubKeyNamed_02 |
| 719 | self new testOpenSubKeyNamed_02 |
| 720 | " |
| 721 | |
| 722 | "Created: / 07-12-2018 / 15:36:27 / svestkap" |
| 723 | ! |
| 724 | |
| 725 | testOpenSubKeyNamed_03 |
| 726 | "Testing if an old subKey is opened via subKeyNamed:" |
| 727 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 728 | |
| 729 | readData := Unicode16String new. |
| 730 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 731 | readSubKeys := testingRegistryPath subKeys. |
| 732 | subKeysCount := readSubKeys size. |
| 733 | |
| 734 | self assert: subKeysCount = 3. |
| 735 | "/ trying to read already existing subKey |
| 736 | readData := testingRegistryPath subKeyNamed: ' ルすしか'. |
| 737 | |
| 738 | "/ check if the existing |
| 739 | self assert: (readData path copyAfterLast: $\) = ' ルすしか'. |
| 740 | |
| 741 | " |
| 742 | self run:#testOpenSubKeyNamed_03 |
| 743 | self new testOpenSubKeyNamed_03 |
| 744 | " |
| 745 | |
| 746 | "Created: / 07-12-2018 / 15:47:59 / svestkap" |
| 747 | ! |
| 748 | |
| 749 | testOpenSubKeyNamed_04 |
| 750 | "Testing if an old subKey is opened via subKeyNamed:createIfAbsent:" |
| 751 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 752 | |
| 753 | readData := Unicode16String new. |
| 754 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 755 | readSubKeys := testingRegistryPath subKeys. |
| 756 | subKeysCount := readSubKeys size. |
| 757 | |
| 758 | self assert: subKeysCount = 3. |
| 759 | "/ trying to read already existing subKey |
| 760 | readData := testingRegistryPath subKeyNamed: ' ルすしか' createIfAbsent: true. |
| 761 | |
| 762 | "/ check if the existing |
| 763 | self assert: (readData path copyAfterLast: $\) = ' ルすしか'. |
| 764 | |
| 765 | " |
| 766 | self run:#testOpenSubKeyNamed_04 |
| 767 | self new testOpenSubKeyNamed_04 |
| 768 | " |
| 769 | |
| 770 | "Created: / 07-12-2018 / 15:51:52 / svestkap" |
| 771 | ! |
| 772 | |
| 773 | testOpenSubKeyNamed_Wow64_32_01 |
| 774 | "Testing if an old subKey is opened in Wow64_32 (32bit program reading 32bit registry)" |
| 775 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 776 | |
| 777 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 778 | |
| 779 | readData := Unicode16String new. |
| 780 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 781 | readSubKeys := testingRegistryPath subKeys. |
| 782 | subKeysCount := readSubKeys size. |
| 783 | |
| 784 | self assert: subKeysCount = 3. |
| 785 | "/ trying to read already existing subKey |
| 786 | readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: #KEY_WOW64_32KEY createIfAbsent: false. |
| 787 | |
| 788 | "/ check if the existing |
| 789 | self assert: (readData path copyAfterLast: $\) = ' ルすしか'. |
| 790 | |
| 791 | " |
| 792 | self run:#testOpenSubKeyNamed_Wow64_32_01 |
| 793 | self new testOpenSubKeyNamed_Wow64_32_01 |
| 794 | " |
| 795 | |
| 796 | "Created: / 07-12-2018 / 15:53:04 / svestkap" |
| 797 | ! |
| 798 | |
| 799 | testOpenSubKeyNamed_Wow64_32_02 |
| 800 | "Testing if an old subKey is opened in Wow64_32 (32bit program reading 32bit registry) via subKeyNamed:flags:" |
| 801 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 802 | |
| 803 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 804 | |
| 805 | readData := Unicode16String new. |
| 806 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 807 | readSubKeys := testingRegistryPath subKeys. |
| 808 | subKeysCount := readSubKeys size. |
| 809 | |
| 810 | self assert: subKeysCount = 3. |
| 811 | "/ trying to read already existing subKey |
| 812 | readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: #KEY_WOW64_32KEY. |
| 813 | |
| 814 | "/ check if the existing |
| 815 | self assert: (readData path copyAfterLast: $\) = ' ルすしか'. |
| 816 | |
| 817 | " |
| 818 | self run:#testOpenSubKeyNamed_Wow64_32_02 |
| 819 | self new testOpenSubKeyNamed_Wow64_32_02 |
| 820 | " |
| 821 | |
| 822 | "Created: / 07-12-2018 / 15:54:31 / svestkap" |
| 823 | ! |
| 824 | |
| 825 | testOpenSubKeyNamed_Wow64_64_01 |
| 826 | "Testing if an old subKey is opened in Wow64_64 (32bit program reading 64bit registry)" |
| 827 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 828 | |
| 829 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 830 | |
| 831 | readData := Unicode16String new. |
| 832 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 833 | readSubKeys := testingRegistryPath subKeys. |
| 834 | subKeysCount := readSubKeys size. |
| 835 | |
| 836 | self assert: subKeysCount = 3. |
| 837 | "/ trying to read already existing subKey |
| 838 | readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: #KEY_WOW64_64KEY createIfAbsent: false. |
| 839 | |
| 840 | "/ check if the existing |
| 841 | self assert: (readData path copyAfterLast: $\) = ' ルすしか'. |
| 842 | |
| 843 | " |
| 844 | self run:#testOpenSubKeyNamed_Wow64_64_01 |
| 845 | self new testOpenSubKeyNamed_Wow64_64_01 |
| 846 | " |
| 847 | |
| 848 | "Created: / 07-12-2018 / 15:53:34 / svestkap" |
| 849 | ! |
| 850 | |
| 851 | testOpenSubKeyNamed_Wow64_64_02 |
| 852 | "Testing if an old subKey is opened in Wow64_64 (32bit program reading 64bit registry) via subKeyNamed:flags:" |
| 853 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 854 | |
| 855 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 856 | |
| 857 | readData := Unicode16String new. |
| 858 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 859 | readSubKeys := testingRegistryPath subKeys. |
| 860 | subKeysCount := readSubKeys size. |
| 861 | |
| 862 | self assert: subKeysCount = 3. |
| 863 | "/ trying to read already existing subKey |
| 864 | readData := testingRegistryPath subKeyNamed: ' ルすしか' flags: #KEY_WOW64_64KEY. |
| 865 | |
| 866 | "/ check if the existing |
| 867 | self assert: (readData path copyAfterLast: $\) = ' ルすしか'. |
| 868 | |
| 869 | " |
| 870 | self run:#testOpenSubKeyNamed_Wow64_64_02 |
| 871 | self new testOpenSubKeyNamed_Wow64_64_02 |
| 872 | " |
| 873 | |
| 874 | "Created: / 07-12-2018 / 15:55:07 / svestkap" |
| 875 | ! |
| 876 | |
| 877 | testOpenSubKeyNamed_nonExistingWow64_32 |
| 878 | "Trying to read non-existing subKey in Wow64_32 (32bit program reading 32bit registry)" |
| 879 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 880 | |
| 881 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 882 | |
| 883 | readData := Unicode16String new. |
| 884 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 885 | readSubKeys := testingRegistryPath subKeys. |
| 886 | subKeysCount := readSubKeys size. |
| 887 | |
| 888 | self assert: subKeysCount = 3. |
| 889 | "/ trying to read non-existent subKey |
| 890 | readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: #KEY_WOW64_32KEY createIfAbsent: false. |
| 891 | "/ check if new path is with the subKeyNamed above |
| 892 | |
| 893 | self assert: readData isNil |
| 894 | |
| 895 | " |
| 896 | self run:#testOpenSubKeyNamed_nonExistingWow64_32 |
| 897 | self new testOpenSubKeyNamed_nonExistingWow64_32 |
| 898 | " |
| 899 | |
| 900 | "Created: / 07-12-2018 / 15:44:52 / svestkap" |
| 901 | ! |
| 902 | |
| 903 | testOpenSubKeyNamed_nonExistingWow64_64 |
| 904 | "Trying to read non-existing subKey in Wow64_32 (32bit program reading 64bit registry)" |
| 905 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 906 | |
| 907 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 908 | |
| 909 | readData := Unicode16String new. |
| 910 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 911 | readSubKeys := testingRegistryPath subKeys. |
| 912 | subKeysCount := readSubKeys size. |
| 913 | |
| 914 | self assert: subKeysCount = 3. |
| 915 | "/ trying to read non-existent subKey |
| 916 | readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: #KEY_WOW64_64KEY createIfAbsent: false. |
| 917 | "/ check if new path is with the subKeyNamed above |
| 918 | |
| 919 | self assert: readData isNil |
| 920 | |
| 921 | " |
| 922 | self run:#testOpenSubKeyNamed_nonExistingWow64_32 |
| 923 | self new testOpenSubKeyNamed_nonExistingWow64_32 |
| 924 | " |
| 925 | |
| 926 | "Created: / 07-12-2018 / 15:45:42 / svestkap" |
| 927 | ! |
| 928 | |
| 929 | testOpenSubKeyNamed_nonExisting_01 |
| 930 | "Trying to read non-existing subKey" |
| 931 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 932 | |
| 933 | readData := Unicode16String new. |
| 934 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 935 | readSubKeys := testingRegistryPath subKeys. |
| 936 | subKeysCount := readSubKeys size. |
| 937 | |
| 938 | self assert: subKeysCount = 3. |
| 939 | "/ trying to read non-existent subKey |
| 940 | readData := testingRegistryPath subKeyNamed: 'bledesu ル' flags: nil createIfAbsent: false. |
| 941 | "/ check if new path is with the subKeyNamed above |
| 942 | |
| 943 | self assert: readData isNil |
| 944 | |
| 945 | " |
| 946 | self run:#testOpenSubKeyNamed_nonExisting_01 |
| 947 | self new testOpenSubKeyNamed_nonExisting_01 |
| 948 | " |
| 949 | |
| 950 | "Created: / 07-12-2018 / 15:50:18 / svestkap" |
| 951 | ! |
| 952 | |
| 953 | testOpenSubKeyNamed_nonExisting_02 |
| 954 | "Trying to read non-existing subKey via subKeyNamed:" |
| 955 | | readData testingRegistryPath readSubKeys subKeysCount | |
| 956 | |
| 957 | readData := Unicode16String new. |
| 958 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 959 | readSubKeys := testingRegistryPath subKeys. |
| 960 | subKeysCount := readSubKeys size. |
| 961 | |
| 962 | self assert: subKeysCount = 3. |
| 963 | "/ trying to read non-existent subKey |
| 964 | readData := testingRegistryPath subKeyNamed: 'bledesu ル'. |
| 965 | "/ check if new path is with the subKeyNamed above |
| 966 | |
| 967 | self assert: readData isNil |
| 968 | |
| 969 | " |
| 970 | self run:#testOpenSubKeyNamed_nonExisting_02 |
| 971 | self new testOpenSubKeyNamed_nonExisting_02 |
| 972 | " |
| 973 | |
| 974 | "Created: / 07-12-2018 / 15:50:48 / svestkap" |
| 975 | ! ! |
| 976 | |
| 977 | !Win32OperatingSystemTest methodsFor:'tests-unicodeDelete'! |
| 978 | |
| 979 | testDeleteSubKeyNamed |
| 980 | "Testing deleting of empty subKey via deleteSubKeyNamed:" |
| 981 | |
| 982 | | returnValue testingRegistryPath | |
| 983 | |
| 984 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 985 | |
| 986 | "/ if successfully deteted -> true |
| 987 | returnValue := testingRegistryPath deleteSubKeyNamed: ' ルすしか_empty'. |
| 988 | self assert: returnValue |
| 989 | |
| 990 | " |
| 991 | self run:#testDeleteSubKeyNamed |
| 992 | self new testDeleteSubKeyNamed |
| 993 | " |
| 994 | |
| 995 | "Created: / 07-12-2018 / 09:49:44 / svestkap" |
| 996 | ! |
| 997 | |
| 998 | testDeleteSubKeyNamed_Wow64_32 |
| 999 | "Testing deleting of empty subKey via deleteSubKeyNamed: (only on x64 systems) |
| 1000 | Wow subsystem enables running 32bit applications on 64bit windows" |
| 1001 | | returnValue testingRegistryPath | |
| 1002 | |
| 1003 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 1004 | |
| 1005 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 1006 | |
| 1007 | "/ if successfully deteted -> true |
| 1008 | returnValue := testingRegistryPath deleteSubKeyNamed: ' ルすしか_empty' flags:#KEY_WOW64_32KEY. |
| 1009 | self assert: returnValue |
| 1010 | |
| 1011 | " |
| 1012 | self run:#testDeleteSubKeyNamed_Wow64_32 |
| 1013 | self new testDeleteSubKeyNamed_Wow64_32 |
| 1014 | " |
| 1015 | |
| 1016 | "Created: / 07-12-2018 / 14:56:39 / svestkap" |
| 1017 | ! |
| 1018 | |
| 1019 | testDeleteSubKeyNamed_Wow64_64 |
| 1020 | "Testing deleting of empty subKey via deleteSubKeyNamed: (only on x64 systems) |
| 1021 | Wow subsystem enables running 32bit applications on 64bit windows" |
| 1022 | | returnValue testingRegistryPath | |
| 1023 | |
| 1024 | self skipIf: (OperatingSystem getSystemInfo at: #architecture) ~= #x64 description: 'Test only for x64 architecture'. |
| 1025 | |
| 1026 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 1027 | |
| 1028 | "/ if successfully deteted -> true |
| 1029 | returnValue := testingRegistryPath deleteSubKeyNamed: ' ルすしか_empty' flags:#KEY_WOW64_64KEY. |
| 1030 | self assert: returnValue |
| 1031 | |
| 1032 | " |
| 1033 | self run:#testDeleteSubKeyNamed_Wow64_64 |
| 1034 | self new testDeleteSubKeyNamed_Wow64_64 |
| 1035 | " |
| 1036 | |
| 1037 | "Created: / 07-12-2018 / 14:55:03 / svestkap" |
| 1038 | ! |
| 1039 | |
| 1040 | testDeleteValueNamed_REG_BINARY |
| 1041 | "Testing if REG_BINARY value name is correctly deleted via deleteValueNamed:" |
| 1042 | |
| 1043 | | readData testingRegistryPath registryValueName deleteResult | |
| 1044 | |
| 1045 | readData := Unicode16String new. |
| 1046 | testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか'). |
| 1047 | registryValueName := 'non-zero'. |
| 1048 | |
| 1049 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1050 | self assert: readData notEmptyOrNil. |
| 1051 | |
| 1052 | deleteResult := testingRegistryPath deleteValueNamed: registryValueName. |
| 1053 | self assert: deleteResult. |
| 1054 | |
| 1055 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1056 | self assert: readData isEmptyOrNil |
| 1057 | |
| 1058 | " |
| 1059 | self run:#testDeleteValueNamed_REG_BINARY |
| 1060 | self new testDeleteValueNamed_REG_BINARY |
| 1061 | " |
| 1062 | |
| 1063 | "Created: / 06-12-2018 / 13:56:35 / svestkap" |
| 1064 | "Modified: / 07-12-2018 / 09:50:41 / svestkap" |
| 1065 | ! |
| 1066 | |
| 1067 | testDeleteValueNamed_REG_DWORD |
| 1068 | "Testing if REG_DWORD value name is correctly deleted via deleteValueNamed:" |
| 1069 | |
| 1070 | | readData testingRegistryPath registryValueName deleteResult | |
| 1071 | |
| 1072 | readData := Unicode16String new. |
| 1073 | testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか'). |
| 1074 | registryValueName := 'dword_value'. |
| 1075 | |
| 1076 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1077 | self assert: readData notEmptyOrNil. |
| 1078 | |
| 1079 | deleteResult := testingRegistryPath deleteValueNamed: registryValueName. |
| 1080 | self assert: deleteResult. |
| 1081 | |
| 1082 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1083 | self assert: readData isEmptyOrNil |
| 1084 | |
| 1085 | " |
| 1086 | self run:#testDeleteValueNamed_REG_DWORD |
| 1087 | self new testDeleteValueNamed_REG_DWORD |
| 1088 | " |
| 1089 | |
| 1090 | "Created: / 06-12-2018 / 09:09:24 / svestkap" |
| 1091 | "Modified: / 06-12-2018 / 13:59:57 / svestkap" |
| 1092 | ! |
| 1093 | |
| 1094 | testDeleteValueNamed_REG_EXPAND_SZ |
| 1095 | "Testing if REG_EXPAND_SZ value name is correctly deleted via deleteValueNamed:" |
| 1096 | |
| 1097 | | readData testingRegistryPath registryValueName deleteResult | |
| 1098 | |
| 1099 | readData := Unicode16String new. |
| 1100 | testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか'). |
| 1101 | registryValueName := ' č ルすしか'. |
| 1102 | |
| 1103 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1104 | self assert: readData notEmptyOrNil. |
| 1105 | |
| 1106 | deleteResult := testingRegistryPath deleteValueNamed: registryValueName. |
| 1107 | self assert: deleteResult. |
| 1108 | |
| 1109 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1110 | self assert: readData isEmptyOrNil |
| 1111 | |
| 1112 | " |
| 1113 | self run:#testDeleteValueNamed_REG_EXPAND_SZ |
| 1114 | self new testDeleteValueNamed_REG_EXPAND_SZ |
| 1115 | " |
| 1116 | |
| 1117 | "Created: / 06-12-2018 / 13:54:53 / svestkap" |
| 1118 | ! |
| 1119 | |
| 1120 | testDeleteValueNamed_REG_QWORD |
| 1121 | "Testing if REG_QWORD value name is correctly deleted via deleteValueNamed:" |
| 1122 | |
| 1123 | | readData testingRegistryPath registryValueName deleteResult | |
| 1124 | |
| 1125 | readData := Unicode16String new. |
| 1126 | testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか'). |
| 1127 | registryValueName := 'qword_max'. |
| 1128 | |
| 1129 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1130 | self assert: readData notEmptyOrNil. |
| 1131 | |
| 1132 | deleteResult := testingRegistryPath deleteValueNamed: registryValueName. |
| 1133 | self assert: deleteResult. |
| 1134 | |
| 1135 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1136 | self assert: readData isEmptyOrNil |
| 1137 | |
| 1138 | " |
| 1139 | self run:#testDeleteValueNamed_REG_QWORD |
| 1140 | self new testDeleteValueNamed_REG_QWORD |
| 1141 | " |
| 1142 | |
| 1143 | "Created: / 06-12-2018 / 13:55:46 / svestkap" |
| 1144 | ! |
| 1145 | |
| 1146 | testDeleteValueNamed_REG_SZ |
| 1147 | "Testing if REG_SZ value name is correctly deleted via deleteValueNamed:" |
| 1148 | |
| 1149 | | readData testingRegistryPath registryValueName deleteResult | |
| 1150 | |
| 1151 | readData := Unicode16String new. |
| 1152 | testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか'). |
| 1153 | registryValueName := ' ř ž č ル. '. |
| 1154 | |
| 1155 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1156 | self assert: readData notEmptyOrNil. |
| 1157 | |
| 1158 | deleteResult := testingRegistryPath deleteValueNamed: registryValueName. |
| 1159 | self assert: deleteResult. |
| 1160 | |
| 1161 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1162 | self assert: readData isEmptyOrNil |
| 1163 | |
| 1164 | " |
| 1165 | self run:#testDeleteValueNamed_REG_SZ |
| 1166 | self new testDeleteValueNamed_REG_SZ |
| 1167 | " |
| 1168 | |
| 1169 | "Created: / 06-12-2018 / 13:52:51 / svestkap" |
| 1170 | ! |
| 1171 | |
| 1172 | testDeleteValueNamed_defaultValue_01 |
| 1173 | "Testing if (Default) value gets correctly deleted via deleteValueNamed:" |
| 1174 | |
| 1175 | | readData registryValueName testingRegistryPath deleteResult| |
| 1176 | |
| 1177 | readData := Unicode16String new. |
| 1178 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 1179 | registryValueName := ''. |
| 1180 | |
| 1181 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1182 | self assert: readData notEmptyOrNil. |
| 1183 | self assert: readData = 'しか OMG'. |
| 1184 | |
| 1185 | deleteResult := testingRegistryPath deleteValueNamed: registryValueName. |
| 1186 | self assert: deleteResult. |
| 1187 | |
| 1188 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1189 | self assert: readData isEmptyOrNil |
| 1190 | |
| 1191 | " |
| 1192 | self run:#testDeleteValueNamed_defaultValue_01 |
| 1193 | self new testDeleteValueNamed_defaultValue_01 |
| 1194 | " |
| 1195 | |
| 1196 | "Created: / 06-12-2018 / 14:04:16 / svestkap" |
| 1197 | ! |
| 1198 | |
| 1199 | testDeleteValueNamed_defaultValue_02 |
| 1200 | "Testing if deleting (Default) empty gets false via deleteValueNamed:" |
| 1201 | |
| 1202 | | readData registryValueName testingRegistryPath deleteResult| |
| 1203 | |
| 1204 | readData := Unicode16String new. |
| 1205 | testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか'). |
| 1206 | registryValueName := ''. |
| 1207 | |
| 1208 | readData := testingRegistryPath valueNamed: registryValueName. |
| 1209 | self assert: readData isEmptyOrNil. |
| 1210 | |
| 1211 | deleteResult := testingRegistryPath deleteValueNamed: registryValueName. |
| 1212 | self assert: deleteResult not. |
| 1213 | |
| 1214 | " |
| 1215 | self run:#testDeleteValueNamed_defaultValue_02 |
| 1216 | self new testDeleteValueNamed_defaultValue_02 |
| 1217 | " |
| 1218 | |
| 1219 | "Created: / 06-12-2018 / 14:01:38 / svestkap" |
| 1220 | ! |
| 1221 | |
| 1222 | testDeleteValueNamed_nonStringVAlue |
| 1223 | "Testing if trying to delete a non-string value results into returning false |
| 1224 | and user should see in Transcript a warning message" |
| 1225 | |
| 1226 | | testingRegistryPath registryValueName | |
| 1227 | |
| 1228 | testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか'). |
| 1229 | registryValueName := 11. |
| 1230 | |
| 1231 | self should: [ testingRegistryPath deleteValueNamed: registryValueName ] raise: Error |
| 1232 | |
| 1233 | |
| 1234 | " |
| 1235 | self run:#testDeleteValueNamed_nonStringVAlue |
| 1236 | self new testDeleteValueNamed_nonStringVAlue |
| 1237 | " |
| 1238 | |
| 1239 | "Created: / 06-12-2018 / 14:10:18 / svestkap" |
| 1240 | "Modified: / 07-12-2018 / 09:34:38 / svestkap" |
| 1241 | ! ! |
| 1242 | |
| 1243 | !Win32OperatingSystemTest methodsFor:'tests-unicodeDeleteEnumeration'! |
| 1244 | |
| 1245 | testDeleteSubKeyNamed_deletingMultipleSubKeys |
| 1246 | "Testing deleting whole tree of subKeys based on subKey path size via deleteSubKeyNamed:" |
| 1247 | |
| 1248 | | readData returnValue testingRegistryPath | |
| 1249 | |
| 1250 | readData := OrderedDictionary new. |
| 1251 | testingRegistryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', ' ルすしか_testing_delete'). |
| 1252 | |
| 1253 | testingRegistryPath allSubKeysDo: [ :subEntry | |
| 1254 | readData at: subEntry path put: subEntry |
| 1255 | ]. |
| 1256 | |
| 1257 | "/ sorting based on path size |
| 1258 | readData sort: [ :firstRegistryPath :secondRegistryPath | |
| 1259 | firstRegistryPath size < secondRegistryPath size |
| 1260 | ]. |
| 1261 | |
| 1262 | "/ sorting the path size (max -> min) |
| 1263 | readData reverse. |
| 1264 | |
| 1265 | "/ deleting all the subKeys (even those that have some value names!!) |
| 1266 | readData valuesDo: [ :registryEntry | |
| 1267 | | tempRegistryEntry | |
| 1268 | tempRegistryEntry := Win32OperatingSystem registryEntry key: (registryEntry path copyUpToLast: $\). |
| 1269 | returnValue := tempRegistryEntry deleteSubKeyNamed: (registryEntry path copyAfterLast: $\). |
| 1270 | self assert: returnValue |
| 1271 | ]. |
| 1272 | |
| 1273 | "/ if successfully deteted -> true |
| 1274 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 1275 | returnValue := testingRegistryPath deleteSubKeyNamed: ' ルすしか_testing_delete'. |
| 1276 | self assert: returnValue |
| 1277 | |
| 1278 | " |
| 1279 | self run:#testDeleteSubKeyNamed |
| 1280 | self new testDeleteSubKeyNamed |
| 1281 | " |
| 1282 | |
| 1283 | "Created: / 07-12-2018 / 10:54:34 / svestkap" |
| 1284 | ! ! |
| 1285 | |
| 2093 | !Win32OperatingSystemTest methodsFor:'tests-unicodeWrite'! |
| 2094 | |
| 2095 | testDefaultValue |
| 2096 | "Testing if value can be stored (defaultValue:) and read (defaultValue) |
| 2097 | Note: the value is stored in (Default) value at the key" |
| 2098 | |
| 2099 | | testingRegistryPath readData | |
| 2100 | |
| 2101 | registryPath := registryPath, '\', ' ルすしか'. |
| 2102 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2103 | |
| 2104 | testingRegistryPath defaultValue: 'すし.ACE.OLEDB.16.0'. |
| 2105 | |
| 2106 | readData := testingRegistryPath defaultValue. |
| 2107 | |
| 2108 | self assert: readData = 'すし.ACE.OLEDB.16.0'. |
| 2109 | |
| 2110 | " |
| 2111 | self run:#testDefaultValue |
| 2112 | self new testDefaultValue |
| 2113 | " |
| 2114 | |
| 2115 | "Created: / 05-12-2018 / 12:46:03 / svestkap" |
| 2116 | ! |
| 2117 | |
| 2118 | testWriteValueNamedPut_REG_BINARY_01 |
| 2119 | "Testing if REG_BINARY zero value is written correctly via valueNamed:put: |
| 2120 | Data is written and read back again." |
| 2121 | |
| 2122 | | testingRegistryPath readData | |
| 2123 | |
| 2124 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2125 | testingRegistryPath valueNamed: 'non-zero' put: ByteArray new. |
| 2126 | |
| 2127 | readData := testingRegistryPath valueNamed: 'non-zero'. |
| 2128 | |
| 2129 | self assert: readData = ByteArray new. |
| 2130 | |
| 2131 | " |
| 2132 | self run:#testWriteValueNamedPut_REG_BINARY_01 |
| 2133 | self new testWriteValueNamedPut_REG_BINARY_01 |
| 2134 | " |
| 2135 | |
| 2136 | "Created: / 04-12-2018 / 11:52:46 / svestkap" |
| 2137 | "Modified (format): / 05-12-2018 / 12:45:43 / svestkap" |
| 2138 | ! |
| 2139 | |
| 2140 | testWriteValueNamedPut_REG_BINARY_02 |
| 2141 | "Testing if REG_BINARY values are written correctly via valueNamed:put: |
| 2142 | Data is written and read back again." |
| 2143 | |
| 2144 | | testingRegistryPath byteArray readData readDataHex | |
| 2145 | |
| 2146 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2147 | |
| 2148 | byteArray := ByteArray new: 5. |
| 2149 | "/ data to be written |
| 2150 | byteArray replaceElementsFrom: 1 to: 5 withArray: #[18 234 11 0 18] startingAt: 1. |
| 2151 | |
| 2152 | testingRegistryPath valueNamed: 'non-zero' put: byteArray. |
| 2153 | |
| 2154 | readData := testingRegistryPath valueNamed: 'non-zero'. |
| 2155 | readDataHex := readData hexPrintStringWithSeparator: $|. |
| 2156 | |
| 2157 | self assert: readData = #[18 234 11 0 18]. "/ ByteArray |
| 2158 | self assert: readDataHex = '12|EA|0B|00|12' "/ hex |
| 2159 | |
| 2160 | " |
| 2161 | self run:#testWriteValueNamedPut_REG_BINARY_02 |
| 2162 | self new testWriteValueNamedPut_REG_BINARY_02 |
| 2163 | " |
| 2164 | |
| 2165 | "Created: / 04-12-2018 / 12:04:18 / svestkap" |
| 2166 | "Modified (comment): / 04-12-2018 / 15:49:38 / svestkap" |
| 2167 | ! |
| 2168 | |
| 2169 | testWriteValueNamedPut_REG_BINARY_03 |
| 2170 | "Testing if new REG_BINARY value name is written correctly via valueNamed:put: |
| 2171 | Data is written and read back again." |
| 2172 | |
| 2173 | | testingRegistryPath byteArray readData readDataHex | |
| 2174 | |
| 2175 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2176 | |
| 2177 | byteArray := ByteArray new: 5. |
| 2178 | "/ data to be written |
| 2179 | byteArray replaceElementsFrom: 1 to: 5 withArray: #[18 234 11 0 18] startingAt: 1. |
| 2180 | |
| 2181 | testingRegistryPath valueNamed: 'Binaryル' put: byteArray. |
| 2182 | |
| 2183 | readData := testingRegistryPath valueNamed: 'Binaryル'. |
| 2184 | readDataHex := readData hexPrintStringWithSeparator: $|. |
| 2185 | |
| 2186 | self assert: readData = #[18 234 11 0 18]. "/ ByteArray |
| 2187 | self assert: readDataHex = '12|EA|0B|00|12' "/ hex |
| 2188 | |
| 2189 | " |
| 2190 | self run:#testWriteValueNamedPut_REG_BINARY_03 |
| 2191 | self new testWriteValueNamedPut_REG_BINARY_03 |
| 2192 | " |
| 2193 | |
| 2194 | "Created: / 07-12-2018 / 15:15:06 / svestkap" |
| 2195 | ! |
| 2196 | |
| 2197 | testWriteValueNamedPut_REG_DWORD_01 |
| 2198 | "Testing if REG_DWORD values are written correctly via valueNamed:put:" |
| 2199 | |
| 2200 | | readData testingRegistryPath | |
| 2201 | |
| 2202 | readData := Integer new. |
| 2203 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2204 | testingRegistryPath valueNamed: 'dword_value' put: 7337. |
| 2205 | readData := testingRegistryPath valueNamed: 'dword_value'. |
| 2206 | |
| 2207 | self assert: readData = 7337. |
| 2208 | |
| 2209 | " |
| 2210 | self run:#testWriteValueNamedPut_REG_DWORD_01 |
| 2211 | self new testWriteValueNamedPut_REG_DWORD_01 |
| 2212 | " |
| 2213 | |
| 2214 | "Created: / 05-12-2018 / 11:35:52 / svestkap" |
| 2215 | "Modified: / 07-12-2018 / 15:13:18 / svestkap" |
| 2216 | ! |
| 2217 | |
| 2218 | testWriteValueNamedPut_REG_DWORD_02 |
| 2219 | "Testing if max DWORD is accepted as REG_DWORD (written correctly via valueNamed:put:)" |
| 2220 | |
| 2221 | | readData testingRegistryPath | |
| 2222 | |
| 2223 | readData := Integer new. |
| 2224 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2225 | "/ max DWORD value 0xffffffff -> 4294967295 (which is on x64 SmallInteger) |
| 2226 | testingRegistryPath valueNamed: 'dword_value' put: 4294967295. |
| 2227 | readData := testingRegistryPath valueNamed: 'dword_value'. |
| 2228 | |
| 2229 | self assert: readData = 4294967295. |
| 2230 | |
| 2231 | " |
| 2232 | self run:#testWriteValueNamedPut_REG_DWORD_02 |
| 2233 | self new testWriteValueNamedPut_REG_DWORD_02 |
| 2234 | " |
| 2235 | |
| 2236 | "Created: / 05-12-2018 / 11:36:00 / svestkap" |
| 2237 | "Modified: / 07-12-2018 / 15:13:42 / svestkap" |
| 2238 | ! |
| 2239 | |
| 2240 | testWriteValueNamedPut_REG_DWORD_03 |
| 2241 | "Testing if REG_DWORD values are written correctly via valueNamed:put: |
| 2242 | Data is written and read back again." |
| 2243 | |
| 2244 | | readData testingRegistryPath | |
| 2245 | |
| 2246 | readData := Integer new. |
| 2247 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2248 | testingRegistryPath valueNamed: '11' put: 7337. |
| 2249 | readData := testingRegistryPath valueNamed: '11'. |
| 2250 | |
| 2251 | self assert: readData = 7337 |
| 2252 | |
| 2253 | " |
| 2254 | self run:#testWriteValueNamedPut_REG_DWORD_03 |
| 2255 | self new testWriteValueNamedPut_REG_DWORD_03 |
| 2256 | " |
| 2257 | |
| 2258 | "Created: / 05-12-2018 / 11:35:36 / svestkap" |
| 2259 | "Modified (format): / 07-12-2018 / 15:14:33 / svestkap" |
| 2260 | ! |
| 2261 | |
| 2262 | testWriteValueNamedPut_REG_DWORD_04 |
| 2263 | "Testing if REG_DWORD values are written correctly via valueNamed:put: |
| 2264 | Data is written and read back again." |
| 2265 | |
| 2266 | | readData testingRegistryPath | |
| 2267 | |
| 2268 | readData := Integer new. |
| 2269 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2270 | testingRegistryPath valueNamed: '11' put: 7337. |
| 2271 | readData := testingRegistryPath valueNamed: '11'. |
| 2272 | |
| 2273 | self assert: readData = 7337 |
| 2274 | |
| 2275 | " |
| 2276 | self run:#testWriteValueNamedPut_REG_DWORD_04 |
| 2277 | self new testWriteValueNamedPut_REG_DWORD_04 |
| 2278 | " |
| 2279 | |
| 2280 | "Created: / 05-12-2018 / 11:39:00 / svestkap" |
| 2281 | "Modified (format): / 07-12-2018 / 15:14:24 / svestkap" |
| 2282 | ! |
| 2283 | |
| 2284 | testWriteValueNamedPut_REG_DWORD_05 |
| 2285 | "Testing if REG_DWORD values are written correctly via valueNamed:put: |
| 2286 | Data is written and read back again. |
| 2287 | Note: user should see a warning message on Transcript" |
| 2288 | |
| 2289 | | readData testingRegistryPath | |
| 2290 | |
| 2291 | readData := Unicode16String new. |
| 2292 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2293 | |
| 2294 | readData := testingRegistryPath valueNamed: '11'. |
| 2295 | self assert: readData = 'A number name'. |
| 2296 | |
| 2297 | self should: [ testingRegistryPath valueNamed: 11 put: 7337] raise: Error. |
| 2298 | self assert: readData = 'A number name'. |
| 2299 | |
| 2300 | " |
| 2301 | self run:#testWriteValueNamedPut_REG_DWORD_05 |
| 2302 | self new testWriteValueNamedPut_REG_DWORD_05 |
| 2303 | " |
| 2304 | |
| 2305 | "Created: / 05-12-2018 / 12:29:06 / svestkap" |
| 2306 | "Modified (format): / 07-12-2018 / 09:36:30 / svestkap" |
| 2307 | ! |
| 2308 | |
| 2309 | testWriteValueNamedPut_REG_DWORD_06 |
| 2310 | "Testing if new REG_DWORD value name is written correctly via valueNamed:put: |
| 2311 | Data is written and read back again." |
| 2312 | |
| 2313 | | readData testingRegistryPath | |
| 2314 | |
| 2315 | readData := Integer new. |
| 2316 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2317 | testingRegistryPath valueNamed: '374657654ル' put: 7337. |
| 2318 | readData := testingRegistryPath valueNamed: '374657654ル'. |
| 2319 | |
| 2320 | self assert: readData = 7337 |
| 2321 | |
| 2322 | " |
| 2323 | self run:#testWriteValueNamedPut_REG_DWORD_06 |
| 2324 | self new testWriteValueNamedPut_REG_DWORD_06 |
| 2325 | " |
| 2326 | |
| 2327 | "Created: / 07-12-2018 / 15:10:24 / svestkap" |
| 2328 | ! |
| 2329 | |
| 2330 | testWriteValueNamedPut_REG_EXPAND_SZ_01 |
| 2331 | "Testing if REG_EXPAND_SZ values are written correctly via valueNamed:put: |
| 2332 | Data is written and read back again." |
| 2333 | |
| 2334 | | readData testingRegistryPath | |
| 2335 | |
| 2336 | readData := Unicode16String new. |
| 2337 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2338 | testingRegistryPath valueNamed: 'bledesu' put: '"%PATH%"' unexpandedReferences: true. |
| 2339 | readData := testingRegistryPath valueNamed: 'bledesu'. |
| 2340 | |
| 2341 | self assert: readData = '"%PATH%"' |
| 2342 | |
| 2343 | " |
| 2344 | self run:#testWriteValueNamedPut_REG_EXPAND_SZ_01 |
| 2345 | self new testWriteValueNamedPut_REG_EXPAND_SZ_01 |
| 2346 | " |
| 2347 | |
| 2348 | "Created: / 07-12-2018 / 15:08:50 / svestkap" |
| 2349 | ! |
| 2350 | |
| 2351 | testWriteValueNamedPut_REG_EXPAND_SZ_02 |
| 2352 | "Testing if new REG_EXPAND_SZ value name is written correctly via valueNamed:put: |
| 2353 | Data is written and read back again." |
| 2354 | |
| 2355 | | readData testingRegistryPath | |
| 2356 | |
| 2357 | readData := Unicode16String new. |
| 2358 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2359 | testingRegistryPath valueNamed: 'Yooooル' put: '"%PATH%"' unexpandedReferences: true. |
| 2360 | readData := testingRegistryPath valueNamed: 'Yooooル'. |
| 2361 | |
| 2362 | self assert: readData = '"%PATH%"' |
| 2363 | |
| 2364 | " |
| 2365 | self run:#testWriteValueNamedPut_REG_EXPAND_SZ_02 |
| 2366 | self new testWriteValueNamedPut_REG_EXPAND_SZ_02 |
| 2367 | " |
| 2368 | |
| 2369 | "Created: / 07-12-2018 / 15:09:14 / svestkap" |
| 2370 | ! |
| 2371 | |
| 2372 | testWriteValueNamedPut_REG_MULTI_SZ_01 |
| 2373 | "Testing if REG_MULTI_SZ values are write correctly via valueNamed:put:" |
| 2374 | |
| 2375 | | readData testingRegistryPath | |
| 2376 | |
| 2377 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2378 | testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold' put: #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'řeřicha - ルすしかき'). |
| 2379 | readData := testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold'. |
| 2380 | |
| 2381 | self assert: readData = #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'řeřicha - ルすしかき'). |
| 2382 | |
| 2383 | " |
| 2384 | self run:#testWriteValueNamedPut_REG_MULTI_SZ_01 |
| 2385 | self new testWriteValueNamedPut_REG_MULTI_SZ_01 |
| 2386 | " |
| 2387 | |
| 2388 | "Created: / 27-11-2018 / 09:29:57 / svestkap" |
| 2389 | "Modified (format): / 07-12-2018 / 15:17:03 / svestkap" |
| 2390 | ! |
| 2391 | |
| 2392 | testWriteValueNamedPut_REG_MULTI_SZ_02 |
| 2393 | "Testing if REG_MULTI_SZ values are write correctly via valueNamed:put: |
| 2394 | The value data could be up to available memory (in reality NOT recommended to go over 1MB). |
| 2395 | Testing here a 2^16 + 2 sized OrderedCollection (a reasonable compromize between size and speed)" |
| 2396 | |
| 2397 | | testingRegistryPath testData testDataArray readData | |
| 2398 | |
| 2399 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2400 | testData := OrderedCollection new. |
| 2401 | |
| 2402 | "/ testing 2^15 + 1 which should be |
| 2403 | "/ 2^15 + 1 timeRepeat -> testData OrderedCollection size should be: 2^16 + 1 (65538) |
| 2404 | 32769 timesRepeat: [ testData add: 'SEGOEUIB.TTF,Segoe UI Bold,110,82'. |
| 2405 | testData add: 'řeřicha - ルすしかき' |
| 2406 | ]. |
| 2407 | |
| 2408 | testDataArray := testData asArray. |
| 2409 | "/ storing the array |
| 2410 | testingRegistryPath valueNamed: 'ř ž č ルすしか' put: testDataArray. |
| 2411 | "/ reading the stored array back |
| 2412 | readData := testingRegistryPath valueNamed: 'ř ž č ルすしか'. |
| 2413 | |
| 2414 | self assert: readData = testDataArray. |
| 2415 | |
| 2416 | " |
| 2417 | self run:#testWriteValueNamedPut_REG_MULTI_SZ_02 |
| 2418 | self new testWriteValueNamedPut_REG_MULTI_SZ_02 |
| 2419 | " |
| 2420 | |
| 2421 | "Created: / 28-11-2018 / 14:46:55 / svestkap" |
| 2422 | "Modified (comment): / 03-12-2018 / 09:56:15 / svestkap" |
| 2423 | ! |
| 2424 | |
| 2425 | testWriteValueNamedPut_REG_MULTI_SZ_03 |
| 2426 | "Testing if REG_MULTI_SZ values are write correctly via valueNamed:put:" |
| 2427 | |
| 2428 | | readData testingRegistryPath | |
| 2429 | |
| 2430 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2431 | testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold' put: Array new. |
| 2432 | readData := testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold'. |
| 2433 | |
| 2434 | self assert: readData isEmpty. |
| 2435 | self assert: readData isArray. |
| 2436 | |
| 2437 | " |
| 2438 | self run:#testWriteValueNamedPut_REG_MULTI_SZ_03 |
| 2439 | self new testWriteValueNamedPut_REG_MULTI_SZ_03 |
| 2440 | " |
| 2441 | |
| 2442 | "Created: / 05-12-2018 / 11:54:05 / svestkap" |
| 2443 | "Modified (format): / 07-12-2018 / 15:17:15 / svestkap" |
| 2444 | ! |
| 2445 | |
| 2446 | testWriteValueNamedPut_REG_MULTI_SZ_04 |
| 2447 | "Testing if new REG_MULTI_SZ value name is written correctly via valueNamed:put:" |
| 2448 | |
| 2449 | | readData testingRegistryPath | |
| 2450 | |
| 2451 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2452 | testingRegistryPath valueNamed: 'new_reg_multiル' put: #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'řeřicha - ルすしかき'). |
| 2453 | readData := testingRegistryPath valueNamed: 'new_reg_multiル'. |
| 2454 | |
| 2455 | self assert: readData = #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'řeřicha - ルすしかき'). |
| 2456 | |
| 2457 | " |
| 2458 | self run:#testWriteValueNamedPut_REG_MULTI_SZ_04 |
| 2459 | self new testWriteValueNamedPut_REG_MULTI_SZ_04 |
| 2460 | " |
| 2461 | |
| 2462 | "Created: / 07-12-2018 / 15:08:03 / svestkap" |
| 2463 | ! |
| 2464 | |
| 2465 | testWriteValueNamedPut_REG_NONE_01 |
| 2466 | "Testing if REG_NONE values are written correctly via valueNamed:put: |
| 2467 | Data is written and read back again." |
| 2468 | |
| 2469 | | readData testingRegistryPath | |
| 2470 | |
| 2471 | readData := Unicode16String new. |
| 2472 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2473 | testingRegistryPath valueNamed: 'bledesu' put: nil. |
| 2474 | readData := testingRegistryPath valueNamed: 'bledesu'. |
| 2475 | |
| 2476 | self assert: readData isNil |
| 2477 | |
| 2478 | " |
| 2479 | self run:#testWriteValueNamedPut_REG_NONE_01 |
| 2480 | self new testWriteValueNamedPut_REG_NONE_01 |
| 2481 | " |
| 2482 | |
| 2483 | "Created: / 07-12-2018 / 15:06:08 / svestkap" |
| 2484 | ! |
| 2485 | |
| 2486 | testWriteValueNamedPut_REG_NONE_02 |
| 2487 | "Testing if new REG_NONE value name is written correctly via valueNamed:put: |
| 2488 | Data is written and read back again." |
| 2489 | |
| 2490 | | readData testingRegistryPath | |
| 2491 | |
| 2492 | readData := Unicode16String new. |
| 2493 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2494 | testingRegistryPath valueNamed: 'New nilル name' put: nil. |
| 2495 | readData := testingRegistryPath valueNamed: 'New nilル name'. |
| 2496 | |
| 2497 | self assert: readData isNil |
| 2498 | |
| 2499 | " |
| 2500 | self run:#testWriteValueNamedPut_REG_NONE_02 |
| 2501 | self new testWriteValueNamedPut_REG_NONE_02 |
| 2502 | " |
| 2503 | |
| 2504 | "Created: / 07-12-2018 / 15:06:48 / svestkap" |
| 2505 | ! |
| 2506 | |
| 2507 | testWriteValueNamedPut_REG_QWORD_01 |
| 2508 | "Testing if max QWORD value is written and read correctly from REG_QWORD (valueNamed:put: and valueNamed:) |
| 2509 | Storing maximum QWORD value (0xffffffffffffffff -> 18446744073709551615x64) " |
| 2510 | |
| 2511 | | readData testingRegistryPath | |
| 2512 | |
| 2513 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2514 | testingRegistryPath valueNamed: 'qword_max' put: 18446744073709551615. |
| 2515 | readData := testingRegistryPath valueNamed: 'qword_max'. |
| 2516 | |
| 2517 | self assert: readData = 18446744073709551615. |
| 2518 | |
| 2519 | " |
| 2520 | self run:#testReadValueNamed_REG_QWORD_01 |
| 2521 | self new testReadValueNamed_REG_QWORD_01 |
| 2522 | " |
| 2523 | |
| 2524 | "Created: / 26-11-2018 / 14:54:45 / svestkap" |
| 2525 | "Modified: / 07-12-2018 / 15:11:56 / svestkap" |
| 2526 | ! |
| 2527 | |
| 2528 | testWriteValueNamedPut_REG_QWORD_02 |
| 2529 | "Testing what happens if more then max value is stored in REG_QWORD registry type (valueNamed:put: and valueNamed:)" |
| 2530 | |
| 2531 | | readData testingRegistryPath | |
| 2532 | |
| 2533 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2534 | "/ max QWORD value is: 0xff-ff-ff-ff-ff-ff-ff-ff -> 18446744073709551615 (on x64 only) |
| 2535 | testingRegistryPath valueNamed: 'qword_max' put: 18446744073709551700. |
| 2536 | readData := testingRegistryPath valueNamed: 'qword_max'. |
| 2537 | |
| 2538 | self assert: readData ~= 18446744073709551700. |
| 2539 | "/ when you try to store more than maximum value you will get only the maximum losing the rest |
| 2540 | self assert: readData = 18446744073709551615. |
| 2541 | |
| 2542 | " |
| 2543 | self run:#testWriteValueNamedPut_REG_QWORD_02 |
| 2544 | self new testWriteValueNamedPut_REG_QWORD_02 |
| 2545 | " |
| 2546 | |
| 2547 | "Created: / 04-12-2018 / 11:02:20 / svestkap" |
| 2548 | "Modified: / 07-12-2018 / 15:12:12 / svestkap" |
| 2549 | ! |
| 2550 | |
| 2551 | testWriteValueNamedPut_REG_QWORD_03 |
| 2552 | "Testing if new QWORD value name is written and read correctly from REG_QWORD (valueNamed:put: and valueNamed:)" |
| 2553 | |
| 2554 | | readData testingRegistryPath | |
| 2555 | |
| 2556 | readData := Unicode16String new. |
| 2557 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2558 | testingRegistryPath valueNamed: 'qword_new_testingル' put: 18446744073709551101. |
| 2559 | readData := testingRegistryPath valueNamed: 'qword_new_testingル'. |
| 2560 | |
| 2561 | self assert: readData = 18446744073709551101. |
| 2562 | |
| 2563 | " |
| 2564 | self run:#testWriteValueNamedPut_REG_QWORD_03 |
| 2565 | self new testWriteValueNamedPut_REG_QWORD_03 |
| 2566 | " |
| 2567 | |
| 2568 | "Created: / 07-12-2018 / 15:05:48 / svestkap" |
| 2569 | ! |
| 2570 | |
| 2571 | testWriteValueNamedPut_REG_SZ_01 |
| 2572 | "Testing if REG_SZ values are written correctly via valueNamed:put: |
| 2573 | Data is written and read back again." |
| 2574 | |
| 2575 | | readData testingRegistryPath | |
| 2576 | |
| 2577 | readData := Unicode16String new. |
| 2578 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2579 | testingRegistryPath valueNamed: 'bledesu' put: 'řeřicha - ルすしかき'. |
| 2580 | readData := testingRegistryPath valueNamed: 'bledesu'. |
| 2581 | |
| 2582 | self assert: readData = 'řeřicha - ルすしかき'. |
| 2583 | |
| 2584 | " |
| 2585 | self run:#testWriteValueNamedPut_REG_SZ_01 |
| 2586 | self new testWriteValueNamedPut_REG_SZ_01 |
| 2587 | " |
| 2588 | |
| 2589 | "Created: / 26-11-2018 / 09:51:58 / svestkap" |
| 2590 | "Modified (format): / 07-12-2018 / 15:17:49 / svestkap" |
| 2591 | ! |
| 2592 | |
| 2593 | testWriteValueNamedPut_REG_SZ_02 |
| 2594 | "Testing if REG_SZ values are written correctly via valueNamed:put: |
| 2595 | Data is written and read back again. |
| 2596 | Note: this is testing Unicode with spaces - probably the worst combination" |
| 2597 | |
| 2598 | | readData testingRegistryPath | |
| 2599 | |
| 2600 | readData := Unicode16String new. |
| 2601 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2602 | testingRegistryPath valueNamed: 'しかき ' put: 'řeřicha - ルすしかき'. |
| 2603 | readData := testingRegistryPath valueNamed: 'しかき '. |
| 2604 | |
| 2605 | self assert: readData = 'řeřicha - ルすしかき'. |
| 2606 | |
| 2607 | " |
| 2608 | self run:#testReadValueNamed_REG_SZ_03 |
| 2609 | self new testReadValueNamed_REG_SZ_03 |
| 2610 | " |
| 2611 | |
| 2612 | "Created: / 26-11-2018 / 14:10:35 / svestkap" |
| 2613 | "Modified (format): / 07-12-2018 / 15:17:55 / svestkap" |
| 2614 | ! |
| 2615 | |
| 2616 | testWriteValueNamedPut_REG_SZ_03 |
| 2617 | "Testing if REG_SZ empty value is written correctly via valueNamed:put: |
| 2618 | Data is written and read back again. |
| 2619 | Note: this is testing Unicode with spaces - probably the worst combination" |
| 2620 | |
| 2621 | | readData testingRegistryPath | |
| 2622 | |
| 2623 | readData := Unicode16String new. |
| 2624 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2625 | testingRegistryPath valueNamed: 'しかき ' put: ''. |
| 2626 | readData := testingRegistryPath valueNamed: 'しかき '. |
| 2627 | |
| 2628 | self assert: readData = '' |
| 2629 | |
| 2630 | " |
| 2631 | self run:#testWriteValueNamedPut_REG_SZ_03 |
| 2632 | self new testWriteValueNamedPut_REG_SZ_03 |
| 2633 | " |
| 2634 | |
| 2635 | "Created: / 05-12-2018 / 10:16:59 / svestkap" |
| 2636 | "Modified (format): / 07-12-2018 / 15:17:59 / svestkap" |
| 2637 | ! |
| 2638 | |
| 2639 | testWriteValueNamedPut_REG_SZ_04 |
| 2640 | "Testing if REG_SZ empty value is written correctly via valueNamed:put: |
| 2641 | Data is written and read back again. |
| 2642 | Note: this is testing Unicode with spaces - probably the worst combination" |
| 2643 | |
| 2644 | | readData testingRegistryPath | |
| 2645 | |
| 2646 | readData := Unicode16String new. |
| 2647 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2648 | testingRegistryPath valueNamed: 'bledesu' put: ''. |
| 2649 | readData := testingRegistryPath valueNamed: 'bledesu'. |
| 2650 | |
| 2651 | self assert: readData = '' |
| 2652 | |
| 2653 | " |
| 2654 | self run:#testWriteValueNamedPut_REG_SZ_04 |
| 2655 | self new testWriteValueNamedPut_REG_SZ_04 |
| 2656 | " |
| 2657 | |
| 2658 | "Created: / 05-12-2018 / 10:22:39 / svestkap" |
| 2659 | "Modified (format): / 07-12-2018 / 15:18:04 / svestkap" |
| 2660 | ! |
| 2661 | |
| 2662 | testWriteValueNamedPut_REG_SZ_05 |
| 2663 | "Testing if REG_SZ completely new value is written correctly via valueNamed:put: |
| 2664 | Data is written and read back again." |
| 2665 | |
| 2666 | | readData testingRegistryPath | |
| 2667 | |
| 2668 | readData := Unicode16String new. |
| 2669 | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
| 2670 | testingRegistryPath valueNamed: 'Newル guy' put: 'Singルing'. |
| 2671 | readData := testingRegistryPath valueNamed: 'Newル guy'. |
| 2672 | |
| 2673 | self assert: readData = 'Singルing' |
| 2674 | |
| 2675 | " |
| 2676 | self run:#testWriteValueNamedPut_REG_SZ_05 |
| 2677 | self new testWriteValueNamedPut_REG_SZ_05 |
| 2678 | " |
| 2679 | |
| 2680 | "Created: / 07-12-2018 / 15:03:05 / svestkap" |
| 2681 | ! ! |
| 2682 | |