Changeset b19b362 for tests


Ignore:
Timestamp:
May 3, 2026, 8:25:27 AM (6 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
c136863
Parents:
efa8439a
Message:

add quote output manipulator for printing char, char *, string surrounded by quote characters

Location:
tests
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • tests/io/.expect/manipulatorsOutput1.arm64.txt

    refa8439a rb19b362  
    3838
    3939char
    40 a  a     a a     141 0141 61 0x61     0x61     0X61 a               a
    41 a  a     a a     141 0141 61 0x61     0x61     0X61 a               a
     40a'a' ' '       a     'a'    aa   
     41a'a' ' '       a     'a'    aa   
     42141 0141      141 0141     61 0x61       61 0x61   
     43141 0141      141 0141     61 0X61       61 0x61     1100001 0B1100001      1100001 0b1100001
    4244
    43 string
    44 abcd     abcd   abcd abcd   
    45 abcd     abcd   abcd abcd   
    46 
    47 binary string
    48 0b110000 0b1100001 0b1100010 0b1100011 0b1100100 0141 0142 0143 0144 0x61 0x62 0x63 0x64
    49 110000 1100001 1100010 1100011 1100100 141 142 143 144 61 62 63 64
    50   110000  1100001  1100010  1100011  1100100  141  142  143  144  61  62  63  64
     45char *
     46abcd "abcd"     abcd   "abcd"   abcd abcd     "abcd" 
     47abcd "abcd"     abcd   "abcd"   abcd abcd     "abcd" 
     48141 142 143 144 0141 0142 0143 0144      141      142      143      144 0141     0142     0143     0144   
     4961 62 63 64 0X61 0X62 0X63 0X64       61       62       63       64 0x61     0x62     0x63     0x64   
     501100001 1100010 1100011 1100100 0B1100001 0B1100010 0B1100011 0B1100100      1100001      1100010      1100011      1100100 0b1100001 0b1100010 0b1100011 0b1100100
  • tests/io/.expect/manipulatorsOutput1.x64.txt

    refa8439a rb19b362  
    3838
    3939char
    40 a  a     a a     141 0141 61 0x61     0x61     0X61 a               a
    41 a  a     a a     141 0141 61 0x61     0x61     0X61 a               a
     40a'a' ' '       a     'a'    aa   
     41a'a' ' '       a     'a'    aa   
     42141 0141      141 0141     61 0x61       61 0x61   
     43141 0141      141 0141     61 0X61       61 0x61     1100001 0B1100001      1100001 0b1100001
    4244
    43 string
    44 abcd     abcd   abcd abcd   
    45 abcd     abcd   abcd abcd   
    46 
    47 binary string
    48 0b110000 0b1100001 0b1100010 0b1100011 0b1100100 0141 0142 0143 0144 0x61 0x62 0x63 0x64
    49 110000 1100001 1100010 1100011 1100100 141 142 143 144 61 62 63 64
    50   110000  1100001  1100010  1100011  1100100  141  142  143  144  61  62  63  64
     45char *
     46abcd "abcd"     abcd   "abcd"   abcd abcd     "abcd" 
     47abcd "abcd"     abcd   "abcd"   abcd abcd     "abcd" 
     48141 142 143 144 0141 0142 0143 0144      141      142      143      144 0141     0142     0143     0144   
     4961 62 63 64 0X61 0X62 0X63 0X64       61       62       63       64 0x61     0x62     0x63     0x64   
     501100001 1100010 1100011 1100100 0B1100001 0B1100010 0B1100011 0B1100100      1100001      1100010      1100011      1100100 0b1100001 0b1100010 0b1100011 0b1100100
  • tests/io/.expect/manipulatorsOutput1.x86.txt

    refa8439a rb19b362  
    3838
    3939char
    40 a  a     a a     141 0141 61 0x61     0x61     0X61 a               a
    41 a  a     a a     141 0141 61 0x61     0x61     0X61 a               a
     40a'a' ' '       a     'a'    aa   
     41a'a' ' '       a     'a'    aa   
     42141 0141      141 0141     61 0x61       61 0x61   
     43141 0141      141 0141     61 0X61       61 0x61     1100001 0B1100001      1100001 0b1100001
    4244
    43 string
    44 abcd     abcd   abcd abcd   
    45 abcd     abcd   abcd abcd   
     45char *
     46abcd "abcd"     abcd   "abcd"   abcd abcd     "abcd" 
     47abcd "abcd"     abcd   "abcd"   abcd abcd     "abcd" 
     48141 142 143 144 0141 0142 0143 0144      141      142      143      144 0141     0142     0143     0144   
     4961 62 63 64 0X61 0X62 0X63 0X64       61       62       63       64 0x61     0x62     0x63     0x64   
     501100001 1100010 1100011 1100100 0B1100001 0B1100010 0B1100011 0B1100100      1100001      1100010      1100011      1100100 0b1100001 0b1100010 0b1100011 0b1100100
    4651
    47 binary string
    48 0b110000 0b1100001 0b1100010 0b1100011 0b1100100 0141 0142 0143 0144 0x61 0x62 0x63 0x64
    49 110000 1100001 1100010 1100011 1100100 141 142 143 144 61 62 63 64
    50   110000  1100001  1100010  1100011  1100100  141  142  143  144  61  62  63  64
  • tests/io/manipulatorsOutput1.cfa

    refa8439a rb19b362  
    77// Created On       : Sat Jun  8 18:04:11 2019
    88// Last Modified By : Peter A. Buhr
    9 // Last Modified On : Sat Apr 10 08:42:15 2021
    10 // Update Count     : 18
     9// Last Modified On : Sat May  2 18:50:48 2026
     10// Update Count     : 65
    1111//
    1212
     
    100100
    101101        sout | nl | "char";
    102         char c = 'a';
    103         printf( "%c %2c %5c %-5c %hho %#hho %hhx %#hhx %#8hhx %#8hhX %-8c %8c\n", c, c, c, c, c, c, c, c, c, c, c, c );
    104         sout | c | ' ' | wd(2,c) | wd(5,c) | left(wd(5,c)) | nobase(oct(c)) | oct(c) | nonl;
    105         sout | nobase(hex(c)) | hex(c) | wd(8,hex(c)) | upcase(wd(8,hex(c))) | left(wd(8,c)) | wd(8,c);
     102        char c = 'a', * qc = "'a'";
     103        printf( "%c%s%c'%c'%8c%8s%5c%-5c\n", c, qc, ' ', ' ', c, qc, c, c );
     104        sout | c | quote(c) | ' ' | quote(' ') | wd(8,c) | quote( wd(8,c) ) | wd(5,c) | left(wd(5,c));
     105        printf( "%hho %#hho %8hho %#-8hho %hhx %#hhx %8hhx %#-8hhx\n", c, c, c, c, c, c, c, c );
     106        sout | nobase(oct(c)) | upcase(oct(c)) | nobase(wd(8,oct(c))) | left(wd(-8,oct(c))) | nonl;
     107        sout | nobase(hex(c)) | upcase(hex(c)) | nobase(wd(8,hex(c))) | left(wd(-8,hex(c))) | nonl;
     108        sout | nobase(bin(c)) | upcase(bin(c)) | nobase(wd(12,bin(c))) | left(wd(-12,bin(c)));
    106109
    107         sout | nl | "string";
    108         const char * s = "abcd";
    109         printf( "%s %8s %6.8s %-8s\n", s, s, s, s );
    110         sout | s | wd(8,s) | wd(6,8,s) | left(wd(8,s));
    111 
    112         sout | nl | "binary string";
    113         sout | bin("0") | bin(s) | oct(s) | hex(s);
    114         sout | nobase(bin("0")) | nobase(bin(s)) | nobase(oct(s)) | nobase(hex(s));
    115         sout | nobase(wd(8,bin("0"))) | nobase(wd(8,bin(s))) | nobase(wd(4,oct(s))) | nobase(wd(3,hex(s)));
     110        sout | nl | "char *";
     111        const char * s = "abcd", * qs = "\"abcd\"";
     112        printf( "%s %s %8s %8s %6.8s %-8s %-8s\n", s, qs, s, qs, s, s, qs );
     113        sout | s | quote( s ) | wd(8,s) | quote(wd(8,s)) | wd(6,8,s) | left(wd(8,s)) | quote(left(wd(8,s)));
     114        sout | nobase(oct(s)) | upcase(oct(s)) | nobase(wd(8,oct(s))) | left(wd(-8,oct(s)));
     115        sout | nobase(hex(s)) | upcase(hex(s)) | nobase(wd(8,hex(s))) | left(wd(-8,hex(s)));
     116        sout | nobase(bin(s)) | upcase(bin(s)) | nobase(wd(12,bin(s))) | left(wd(-12,bin(s)));
    116117}
    117118
Note: See TracChangeset for help on using the changeset viewer.