521 | | "Created: / 05-12-2018 / 12:40:21 / svestkap" |
522 | | ! |
523 | | |
524 | | testReadValueNamed_REG_BINARY_01 |
525 | | "Testing if REG_BINARY values are read correctly via valueNamed:" |
526 | | |
527 | | | readData testingRegistryPath | |
528 | | |
529 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
530 | | |
531 | | readData := testingRegistryPath valueNamed: 'zero'. |
532 | | |
533 | | self assert: readData = ByteArray new. |
534 | | |
535 | | " |
536 | | self run:#testReadValueNamed_REG_BINARY_01 |
537 | | self new testReadValueNamed_REG_BINARY_01 |
538 | | " |
539 | | |
540 | | "Created: / 16-11-2018 / 12:37:50 / svestkap" |
541 | | ! |
542 | | |
543 | | testReadValueNamed_REG_BINARY_02 |
544 | | "Testing if REG_BINARY values are read correctly via valueNamed:" |
545 | | |
546 | | | testingRegistryPath readData readDataHex | |
547 | | |
548 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
549 | | |
550 | | readData := testingRegistryPath valueNamed: 'non-zero'. |
551 | | readDataHex := readData hexPrintStringWithSeparator: $|. |
552 | | |
553 | | self assert: readData = #[17 16]. "/ ByteArray |
554 | | self assert: readDataHex = '11|10' "/ hex |
555 | | |
556 | | " |
557 | | self run:#testReadValueNamed_REG_BINARY_02 |
558 | | self new testReadValueNamed_REG_BINARY_02 |
559 | | " |
560 | | |
561 | | "Created: / 16-11-2018 / 12:39:33 / svestkap" |
562 | | ! |
563 | | |
564 | | testReadValueNamed_REG_DWORD_01 |
565 | | "Testing if REG_DWORD values are read correctly via valueNamed:" |
566 | | |
567 | | | readData testingRegistryPath | |
568 | | |
569 | | readData := Unicode16String new. |
570 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
571 | | |
572 | | readData := testingRegistryPath valueNamed: 'dword_value'. |
573 | | |
574 | | self assert: readData = 9135. |
575 | | |
576 | | " |
577 | | self run:#testReadValueNamed_REG_DWORD_01 |
578 | | self new testReadValueNamed_REG_DWORD_01 |
579 | | " |
580 | | |
581 | | "Created: / 16-11-2018 / 12:24:26 / svestkap" |
582 | | ! |
583 | | |
584 | | testReadValueNamed_REG_DWORD_02 |
585 | | "Testing if REG_DWORD values are read correctly via valueNamed:" |
586 | | |
587 | | | readData testingRegistryPath | |
588 | | |
589 | | readData := Unicode16String new. |
590 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
591 | | |
592 | | readData := testingRegistryPath valueNamed: 'き'. |
593 | | |
594 | | self assert: readData = 591541423. |
595 | | |
596 | | " |
597 | | self run:#testReadValueNamed_REG_DWORD_02 |
598 | | self new testReadValueNamed_REG_DWORD_02 |
599 | | " |
600 | | |
601 | | "Created: / 16-11-2018 / 12:24:43 / svestkap" |
| 487 | "Created: / 11-12-2018 / 14:54:37 / svestkap" |
604 | | testReadValueNamed_REG_EXPAND_SZ_01 |
605 | | "Testing if REG_EXPAND_SZ values are read correctly via valueNamed:" |
606 | | |
607 | | | readData testingRegistryPath | |
608 | | |
609 | | readData := Unicode16String new. |
610 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
611 | | |
612 | | readData := testingRegistryPath valueNamed: ' č ルすしか'. |
613 | | |
614 | | self assert: readData = '''Testing Unicode chars ř ž č ルすしかき''). '. |
615 | | |
616 | | " |
617 | | self run:#testReadValueNamed_REG_EXPAND_SZ_01 |
618 | | self new testReadValueNamed_REG_EXPAND_SZ_01 |
619 | | " |
620 | | |
621 | | "Created: / 16-11-2018 / 12:27:58 / svestkap" |
622 | | ! |
623 | | |
624 | | testReadValueNamed_REG_EXPAND_SZ_02 |
625 | | "Testing if REG_EXPAND_SZ values are read correctly via valueNamed:" |
626 | | |
627 | | | readData testingRegistryPath | |
628 | | |
629 | | readData := Unicode16String new. |
630 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
631 | | |
632 | | readData := testingRegistryPath valueNamed: 'Ugh'. |
633 | | |
634 | | self assert: readData = '''Testing Unicode chars ř ž č ルすしかき''). '. |
635 | | |
636 | | " |
637 | | self run:#testReadValueNamed_REG_EXPAND_SZ_02 |
638 | | self new testReadValueNamed_REG_EXPAND_SZ_02 |
639 | | " |
640 | | |
641 | | "Created: / 16-11-2018 / 12:29:52 / svestkap" |
642 | | ! |
643 | | |
644 | | testReadValueNamed_REG_MULTI_SZ_01 |
645 | | "Testing if REG_MULTI_SZ values are read correctly via valueNamed:" |
646 | | |
647 | | | readData testingRegistryPath | |
648 | | |
649 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
650 | | |
651 | | readData := testingRegistryPath valueNamed: 'Font_Leelawadee UI Bold'. |
652 | | |
653 | | self assert: readData = #('SEGOEUIB.TTF,Segoe UI Bold,110,82' 'SEGOEUIB.TTF,Segoe UI Bold' 'MEIRYOB.TTC,Meiryo UI Bold,120,96' |
654 | | 'MEIRYOB.TTC,Meiryo UI Bold' 'MSJHBD.TTC,Microsoft JhengHei UI Bold,120,96' 'MSJHBD.TTC,Microsoft JhengHei UI Bold' |
655 | | 'MSYHBD.TTC,Microsoft YaHei UI Bold,128,96' 'MSYHBD.TTC,Microsoft YaHei UI Bold' 'MALGUNBD.TTF,Malgun Gothic Bold,118,96' |
656 | | 'MALGUNBD.TTF,Malgun Gothic Bold' 'YUGOTHB.TTC,Yu Gothic UI Bold,128,96' 'YUGOTHB.TTC,Yu Gothic UI Bold' 'SEGUISYM.TTF,Segoe UI Symbol') |
657 | | |
658 | | " |
659 | | self run:#testReadValueNamed_REG_MULTI_SZ_01 |
660 | | self new testReadValueNamed_REG_MULTI_SZ_01 |
661 | | " |
662 | | |
663 | | "Created: / 16-11-2018 / 12:30:24 / svestkap" |
664 | | ! |
665 | | |
666 | | testReadValueNamed_REG_MULTI_SZ_02 |
667 | | "Testing if REG_MULTI_SZ values are read correctly via valueNamed:" |
668 | | |
669 | | | readData testingRegistryPath | |
670 | | |
671 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
672 | | |
673 | | readData := testingRegistryPath valueNamed: 'ř ž č ルすしか'. |
674 | | |
675 | | self assert: readData = #('''Testing Unicode chars ř ž č ルすしかき'')' |
676 | | 'SEGOEUIB.TTF,Segoe UI Bold,110,82' 'SEGOEUIB.TTF,Segoe UI Bold' 'MEIRYOB.TTC,Meiryo UI Bold,120,96' |
677 | | 'MEIRYOB.TTC,Meiryo UI Bold' 'MSJHBD.TTC,Microsoft JhengHei UI Bold,120,96' 'MSJHBD.TTC,Microsoft JhengHei UI Bold' |
678 | | 'MSYHBD.TTC,Microsoft YaHei UI Bold,128,96' 'MSYHBD.TTC,Microsoft YaHei UI Bold' 'MALGUNBD.TTF,Malgun Gothic Bold,118,96' |
679 | | 'MALGUNBD.TTF,Malgun Gothic Bold' 'YUGOTHB.TTC,Yu Gothic UI Bold,128,96' 'YUGOTHB.TTC,Yu Gothic UI Bold' 'SEGUISYM.TTF,Segoe UI Symbol') |
680 | | |
681 | | " |
682 | | self run:#testReadValueNamed_REG_MULTI_SZ_02 |
683 | | self new testReadValueNamed_REG_MULTI_SZ_02 |
684 | | " |
685 | | |
686 | | "Created: / 16-11-2018 / 12:35:57 / svestkap" |
687 | | ! |
688 | | |
689 | | testReadValueNamed_REG_MULTI_SZ_03 |
690 | | "Testing if empty REG_MULTI_SZ value is read correctly via valueNamed:" |
| 490 | testReadValueNameAtIndex_02 |
| 491 | "Reading values (#valueNameAtIndex:) at certain index - non-existent value" |
722 | | self run:#testReadValueNamed_REG_QWORD_01 |
723 | | self new testReadValueNamed_REG_QWORD_01 |
724 | | " |
725 | | |
726 | | "Created: / 16-11-2018 / 12:25:47 / svestkap" |
727 | | "Modified (comment): / 05-12-2018 / 12:38:09 / svestkap" |
728 | | ! |
729 | | |
730 | | testReadValueNamed_REG_QWORD_02 |
731 | | "Testing if REG_QWORD values are read correctly via valueNamed:" |
732 | | |
733 | | | readData testingRegistryPath | |
734 | | |
735 | | readData := Unicode16String new. |
736 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
737 | | |
738 | | readData := testingRegistryPath valueNamed: 'qwordvalue'. |
739 | | |
740 | | self assert: readData = 8751636011737964973. |
741 | | |
742 | | " |
743 | | self run:#testReadValueNamed_REG_QWORD_02 |
744 | | self new testReadValueNamed_REG_QWORD_02 |
745 | | " |
746 | | |
747 | | "Created: / 16-11-2018 / 12:26:23 / svestkap" |
748 | | ! |
749 | | |
750 | | testReadValueNamed_REG_QWORD_03 |
751 | | "Testing if REG_QWORD values are read correctly via valueNamed:" |
752 | | |
753 | | | readData testingRegistryPath | |
754 | | |
755 | | readData := Unicode16String new. |
756 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
757 | | |
758 | | readData := testingRegistryPath valueNamed: 'すし'. |
759 | | |
760 | | self assert: readData asSmallInteger = 44527. |
761 | | |
762 | | " |
763 | | self run:#testReadValueNamed_REG_QWORD_03 |
764 | | self new testReadValueNamed_REG_QWORD_03 |
| 503 | self run:#testReadValueNameAtIndex_02 |
| 504 | self new testReadValueNameAtIndex_02 |
767 | | "Created: / 16-11-2018 / 12:27:17 / svestkap" |
768 | | "Modified: / 20-11-2018 / 12:25:05 / svestkap" |
769 | | ! |
770 | | |
771 | | testReadValueNamed_REG_SZ_01 |
772 | | "Testing if REG_SZ values are read correctly via valueNamed:" |
773 | | |
774 | | | readData testingRegistryPath | |
775 | | |
776 | | readData := Unicode16String new. |
777 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
778 | | |
779 | | readData := testingRegistryPath valueNamed: 'bledesu'. |
780 | | |
781 | | self assert: readData = '''Testing Unicode chars ř ž č ルすしかき''). '. |
782 | | |
783 | | " |
784 | | self run:#testReadValueNamed_REG_SZ_01 |
785 | | self new testReadValueNamed_REG_SZ_01 |
786 | | " |
787 | | |
788 | | "Created: / 16-11-2018 / 12:14:59 / svestkap" |
789 | | ! |
790 | | |
791 | | testReadValueNamed_REG_SZ_02 |
792 | | "Testing if REG_SZ values are read correctly via valueNamed:" |
793 | | |
794 | | | readData testingRegistryPath | |
795 | | |
796 | | readData := Unicode16String new. |
797 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
798 | | |
799 | | readData := testingRegistryPath valueNamed: ' ř ž č ル. '. |
800 | | |
801 | | self assert: readData = 'Testing Unicode chars ř ž č ルすしかき'. |
802 | | |
803 | | " |
804 | | self run:#testReadValueNamed_REG_SZ_02 |
805 | | self new testReadValueNamed_REG_SZ_02 |
806 | | " |
807 | | |
808 | | "Created: / 16-11-2018 / 12:15:17 / svestkap" |
809 | | ! |
810 | | |
811 | | testReadValueNamed_REG_SZ_03 |
812 | | "Testing if REG_SZ values are read correctly via valueNamed:" |
813 | | |
814 | | | readData testingRegistryPath | |
815 | | |
816 | | readData := Unicode16String new. |
817 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
818 | | |
819 | | readData := testingRegistryPath valueNamed: 'しかき '. |
820 | | |
821 | | self assert: readData = 'Testus gradus'. |
822 | | |
823 | | " |
824 | | self run:#testReadValueNamed_REG_SZ_03 |
825 | | self new testReadValueNamed_REG_SZ_03 |
826 | | " |
827 | | |
828 | | "Created: / 16-11-2018 / 12:21:59 / svestkap" |
829 | | ! |
830 | | |
831 | | testReadValueNamed_REG_SZ_04 |
832 | | "Testing if empty REG_SZ value is read correctly via valueNamed:" |
833 | | |
834 | | | readData testingRegistryPath | |
835 | | |
836 | | readData := Unicode16String new. |
837 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
838 | | |
839 | | readData := testingRegistryPath valueNamed: 'emptyToTest'. |
840 | | |
841 | | self assert: readData isEmpty. |
842 | | |
843 | | " |
844 | | self run:#testReadValueNamed_REG_SZ_04 |
845 | | self new testReadValueNamed_REG_SZ_04 |
846 | | " |
847 | | |
848 | | "Created: / 03-12-2018 / 10:56:11 / svestkap" |
849 | | ! |
850 | | |
851 | | testReadValueNamed_nonStringValue |
852 | | "Testing reading non-string value from Registry via valueNamed |
853 | | User should see a warning message in Transcript" |
854 | | |
855 | | | testingRegistryPath | |
856 | | |
857 | | testingRegistryPath := Win32OperatingSystem registryEntry key: registryPath. |
858 | | |
859 | | self should: [ testingRegistryPath valueNamed: 11 ] raise: Error |
860 | | |
861 | | " |
862 | | self run:#testReadValueNamed_nonStringValue |
863 | | self new testReadValueNamed_nonStringValue |
864 | | " |
865 | | |
866 | | "Created: / 05-12-2018 / 12:40:31 / svestkap" |
867 | | "Modified: / 10-12-2018 / 15:47:37 / svestkap" |
| 507 | "Created: / 11-12-2018 / 14:54:29 / svestkap" |