3 # Copyright 2002 Patrik Stridvall
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 $0 =~ m%^(.*?/?tools)/winapi/winapi_test$%;
24 require "$1/winapi/setup.pm";
28 file_type files_skip files_filter
29 $current_dir $wine_dir $winapi_dir
31 use output qw($output);
32 use winapi_test_options qw($options);
34 if($options->progress) {
35 $output->enable_progress;
37 $output->disable_progress;
43 use util qw(replace_file);
55 foreach my $test (@tests) {
56 my @test_dirs = $tests->get_test_dirs($test);
57 foreach my $test_dir (@test_dirs) {
58 my @headers = $tests->get_section($test_dir, $test, "header");
59 foreach my $header (@headers) {
60 $files{"include/$header"} = 1;
65 foreach my $test (@tests) {
66 my @test_dirs = $tests->get_test_dirs($test);
67 foreach my $test_dir (@test_dirs) {
68 my @headers = $tests->get_section($test_dir, $test, "header");
69 foreach my $header (@headers) {
70 if($files{"include/$header"}) {
71 push @files, "include/$header";
72 $files{"include/$header"} = 0;
80 my $file = "tests.dat";
82 $file .= "2"; # FIXME: For tests
84 open(OUT, "> $winapi_dir/$file") || die "Error: Can't open $winapi_dir/$file: $!\n";
87 my @test_dirs = $tests->get_test_dirs();
88 foreach my $test_dir (@test_dirs) {
89 print OUT "\n" if $x++;
90 print OUT "%%%$test_dir\n";
94 my @tests = $tests->get_tests($test_dir);
95 foreach my $test (@tests) {
96 print OUT "\n" if $y++;
97 print OUT "%%$test\n";
103 my @sections = $tests->get_sections($test_dir, $test);
104 foreach my $section (@sections) {
105 my @lines = $tests->get_section($test_dir, $test, $section);
107 if ($section =~ /^(?:struct|type)$/) {
108 foreach my $line (@lines) {
114 print OUT "\n" if $z++;
115 print OUT "%$section\n";
117 foreach my $line (@lines) {
122 @types = sort { $x = $a; $y = $b; $x =~ s/^!//; $y =~ s/^!//; $x cmp $y } @types;
124 print OUT "\n" if $z++;
127 foreach my $type (@types) {
141 my $progress_current = 0;
142 my $progress_max = scalar(@files);
144 ########################################################################
150 "ANYSIZE_ARRAY" => 1,
151 "CCHDEVICENAME" => 32,
152 "CCHILDREN_TITLEBAR+1" => 6,
153 "ELF_VENDOR_SIZE" => 4,
154 "EXCEPTION_MAXIMUM_PARAMETERS" => 15,
155 "HW_PROFILE_GUIDLEN" => 39,
156 "IMAGE_NUMBEROF_DIRECTORY_ENTRIES" => 16,
157 "IMAGE_SIZEOF_SHORT_NAME" => 8,
159 "LF_FULLFACESIZE" => 64,
160 "MAXIMUM_SUPPORTED_EXTENSION" => 512,
161 "MAX_GOPHER_DISPLAY_TEXT + 1" => 129,
162 "MAX_GOPHER_LOCATOR_LENGTH + 1" => 654,
164 "MAX_PROFILE_LEN" => 80,
166 "OFS_MAXPATHNAME" => 128,
167 "SIZE_OF_80387_REGISTERS" => 80,
168 "TOKEN_SOURCE_LENGTH" => 8,
171 my %align_kludge_reported = ("FILETIME" => 1, "LARGE_INTEGER" => 1);
172 my %size_kludge_reported = ("FILETIME" => 1, "LARGE_INTEGER" => 1);
173 my %size_parse_reported;
175 sub _find_align_kind_size($) {
176 my $type_name = shift;
178 local $_ = $type_name;
189 } elsif(/^(?:(signed|unsigned)\s+)?(?:__int8|char|byte)$/) {
191 $kind = defined($1) ? $1 : "signed";
193 } elsif (/^(?:(signed|unsigned)\s+)?(?:__int16|short(?:\s+int)?)$/) {
195 $kind = defined($1) ? $1 : "signed";
197 } elsif (/^(?:wchar_t)$/) {
201 } elsif (/^(signed|unsigned)$/) {
203 $kind = defined($1) ? $1 : "signed";
205 } elsif (/^(?:(signed|unsigned)\s+)?(?:__int32|int|long(?:\s+int)?)$/) {
207 $kind = defined($1) ? $1 : "signed";
209 } elsif (/^(?:float)$/) {
213 } elsif (/^(?:(signed|unsigned)\s+)?__int64$/) {
215 $kind = defined($1) ? $1 : "signed";
217 } elsif (/^(?:double|DOUBLE|DATE)$/) {
221 } elsif (/^(?:long\s+double)$/) {
225 } elsif (/^H(?:DC|BITMAP|BRUSH|ICON|INSTANCE|KEY|MENU|METAFILE|RESULT|WND)$/) {
229 } elsif (/^LP(?:BYTE|CSTR|CWSTR|DWORD|STR|VOID|WSTR)$/) {
233 } elsif (/^(?:FILETIME)$/) {
241 } elsif (/^(?:VOID)$/) {
245 } elsif (/^(?:SHORT)$/) {
249 } elsif (/^(?:BYTE)$/) {
253 } elsif (/^(?:DWORD)$/) {
257 } elsif (/^(?:WORD)$/) {
261 } elsif (/^(?:INT64|LONG64|LONGLONG)$/) {
265 } elsif (/^(?:UINT64|ULONG64|DWORD64|ULONGLONG|DWORDLONG)$/) {
269 } elsif (/^(?:LARGE_INTEGER)$/) {
273 } elsif (/^(?:POINTS)$/) {
277 } elsif (/^(struct|union)$/) {
279 if (!$size_parse_reported{$_}) {
280 $output->write("$type_name: can't parse type\n");
281 $size_parse_reported{$_} = 1;
283 } elsif (/^\w+\s*\((?:\s*CALLBACK|\s*NTAPI|\s*WINAPI)?\s*\*\s*\)\s*\(.*?\)$/) {
290 if (defined(my $type = $type_name2type{$_})) {
291 $align2 = $type->align;
294 if (!defined($align)) {
296 } elsif (defined($align2) && !$align_kludge_reported{$_}) {
297 $align_kludge_reported{$_} = 1;
298 $output->write("$type_name: type needn't be kludged\n");
301 if (!defined($align)) {
302 # $output->write("$type_name: can't find type\n");
306 if (defined(my $type = $type_name2type{$_})) {
307 $size2 = $type->size;
310 if (!defined($size)) {
312 } elsif (defined($size2) && !$size_kludge_reported{$_}) {
313 $size_kludge_reported{$_} = 1;
314 $output->write("$type_name: type needn't be kludged\n");
317 return ($align, $kind, $size);
321 my $type_name = shift;
322 (my $align, my $kind, my $size) = _find_align_kind_size($type_name);
327 my $type_name = shift;
328 (my $align, my $kind, my $size) = _find_align_kind_size($type_name);
334 my $type_name = shift;
335 (my $align, my $kind, my $size) = _find_align_kind_size($type_name);
341 return $defines{$count};
344 foreach my $file (@files) {
348 open(IN, "< $wine_dir/$file") || die "Error: Can't open $wine_dir/$file: $!\n";
357 while(s/^.*?\n//) { $max_line++; }
358 if($_) { $max_line++; }
361 my $parser = new c_parser($file);
367 my $update_output = sub {
371 $progress .= "$file (file $progress_current of $progress_max)";
372 $prefix .= "$file: ";
375 $progress .= ": line $line of $max_line";
378 $output->progress($progress);
379 $output->prefix($prefix);
384 my $found_line = sub {
389 $parser->set_found_line_callback($found_line);
391 my $found_preprocessor = sub {
392 my $begin_line = shift;
393 my $begin_column = shift;
394 my $preprocessor = shift;
396 #print "found_preprocessor: $begin_line: [$_]\n";
397 if ($preprocessor =~ /^\#\s*include\s+[\"<]pshpack(\d+)\.h[\">]$/) {
399 #print "found pack $1 on line $begin_line\n";
400 } elsif($preprocessor =~ /^\#\s*include\s+[\"<]poppack\.h[\">]$/) {
402 #print "found poppack on line $begin_line\n";
407 $parser->set_found_preprocessor_callback($found_preprocessor);
409 my $found_type = sub {
414 my $name = $type->name;
415 $file2types{$file}{$name} = $type;
417 $type->set_find_align_callback(\&find_align);
418 $type->set_find_kind_callback(\&find_kind);
419 $type->set_find_size_callback(\&find_size);
420 $type->set_find_count_callback(\&find_count);
422 my $pack = $packs[$#packs];
423 if (!defined($type->pack) && $type->kind =~ /^(?:struct|union)$/) {
426 my $size = $type->size();
427 if (defined($size)) {
428 my $max_field_base_size = 0;
430 foreach my $field ($type->fields()) {
431 my $field_type_name = $field->type_name;
432 my $field_name = $field->name;
433 my $field_size = $field->size;
434 my $field_base_size = $field->base_size;
435 my $field_offset = $field->offset;
436 my $field_align = $field->align;
438 # $output->write("$name: $field_type_name: $field_name: $field_offset: $field_size($field_base_size): $field_align\n");
440 # $output->write("$name: $size\n");
442 $type_name2type{$name} = $type;
444 # $output->write("$name: can't find size\n");
449 $parser->set_found_type_callback($found_type);
454 if(!$parser->parse_c_file(\$_, \$line, \$column)) {
455 $output->write("can't parse file\n");
462 ########################################################################
465 sub output_header($$$) {
468 my $test_dir = shift;
469 my @tests = @{(shift)};
471 print OUT "/* File generated automatically from tools/winapi/tests.dat; do not edit! */\n";
472 print OUT "/* This file can be copied, modified and distributed without restriction. */\n";
476 foreach my $test (@tests) {
477 my @description = $tests->get_section($test_dir, $test, "description");
478 foreach my $description (@description) {
479 print OUT " * $description\n";
485 print OUT "#define WINVER 0x0501\n";
486 print OUT "#define _WIN32_IE 0x0501\n";
487 print OUT "#define _WIN32_WINNT 0x0501\n";
489 print OUT "#define WINE_NOWINSOCK\n";
491 foreach my $test (@tests) {
492 my @includes = $tests->get_section($test_dir, $test, "include");
493 foreach my $include (@includes) {
494 print OUT "#include $include\n";
498 print OUT "#include \"wine/test.h\"\n";
501 print OUT "/***********************************************************************\n";
502 print OUT " * Compatibility macros\n";
505 print OUT "#define DWORD_PTR UINT_PTR\n";
506 print OUT "#define LONG_PTR INT_PTR\n";
507 print OUT "#define ULONG_PTR UINT_PTR\n";
510 print OUT "/***********************************************************************\n";
511 print OUT " * Windows API extension\n";
514 print OUT "#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)\n";
515 print OUT "# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field)\n";
516 print OUT "#elif defined(__GNUC__)\n";
517 print OUT "# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field)\n";
519 print OUT "/* FIXME: Not sure if is possible to do without compiler extension */\n";
520 print OUT "#endif\n";
522 print OUT "#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)\n";
523 print OUT "# define _TYPE_ALIGNMENT(type) __alignof(type)\n";
524 print OUT "#elif defined(__GNUC__)\n";
525 print OUT "# define _TYPE_ALIGNMENT(type) __alignof__(type)\n";
528 print OUT " * FIXME: Not sure if is possible to do without compiler extension\n";
529 print OUT " * (if type is not just a name that is, if so the normal)\n";
530 print OUT " * TYPE_ALIGNMENT can be used)\n";
532 print OUT "#endif\n";
534 print OUT "#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)\n";
535 print OUT "#pragma warning(disable:4116)\n";
536 print OUT "#endif\n";
538 print OUT "#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)\n";
539 print OUT "# define TYPE_ALIGNMENT _TYPE_ALIGNMENT\n";
540 print OUT "#endif\n";
543 print OUT "/***********************************************************************\n";
544 print OUT " * Test helper macros\n";
547 print OUT "#ifdef FIELD_ALIGNMENT\n";
548 print OUT "# define TEST_FIELD_ALIGNMENT(type, field, align) \\\n";
549 print OUT " ok(FIELD_ALIGNMENT(type, field) == align, \\\n";
550 print OUT " \"FIELD_ALIGNMENT(\" #type \", \" #field \") == %d (expected \" #align \")\\n\", \\\n";
551 print OUT " (int)FIELD_ALIGNMENT(type, field))\n";
553 print OUT "# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0)\n";
554 print OUT "#endif\n";
556 print OUT "#define TEST_FIELD_OFFSET(type, field, offset) \\\n";
557 print OUT " ok(FIELD_OFFSET(type, field) == offset, \\\n";
558 print OUT " \"FIELD_OFFSET(\" #type \", \" #field \") == %ld (expected \" #offset \")\\n\", \\\n";
559 print OUT " (long int)FIELD_OFFSET(type, field))\n";
561 print OUT "#ifdef _TYPE_ALIGNMENT\n";
562 print OUT "#define TEST__TYPE_ALIGNMENT(type, align) \\\n";
563 print OUT " ok(_TYPE_ALIGNMENT(type) == align, \"TYPE_ALIGNMENT(\" #type \") == %d (expected \" #align \")\\n\", (int)_TYPE_ALIGNMENT(type))\n";
565 print OUT "# define TEST__TYPE_ALIGNMENT(type, align) do { } while (0)\n";
566 print OUT "#endif\n";
568 print OUT "#ifdef TYPE_ALIGNMENT\n";
569 print OUT "#define TEST_TYPE_ALIGNMENT(type, align) \\\n";
570 print OUT " ok(TYPE_ALIGNMENT(type) == align, \"TYPE_ALIGNMENT(\" #type \") == %d (expected \" #align \")\\n\", (int)TYPE_ALIGNMENT(type))\n";
572 print OUT "# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0)\n";
573 print OUT "#endif\n";
575 print OUT "#define TEST_TYPE_SIZE(type, size) \\\n";
576 print OUT " ok(sizeof(type) == size, \"sizeof(\" #type \") == %d (expected \" #size \")\\n\", ((int) sizeof(type)))\n";
578 print OUT "/***********************************************************************\n";
579 print OUT " * Test macros\n";
582 print OUT "#define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \\\n";
583 print OUT " TEST_TYPE_SIZE(field_type, field_size); \\\n";
584 print OUT " TEST_FIELD_ALIGNMENT(type, field_name, field_align); \\\n";
585 print OUT " TEST_FIELD_OFFSET(type, field_name, field_offset); \\\n";
587 print OUT "#define TEST_TYPE(type, size, align) \\\n";
588 print OUT " TEST_TYPE_ALIGNMENT(type, align); \\\n";
589 print OUT " TEST_TYPE_SIZE(type, size)\n";
591 print OUT "#define TEST_TYPE_POINTER(type, size, align) \\\n";
592 print OUT " TEST__TYPE_ALIGNMENT(*(type)0, align); \\\n";
593 print OUT " TEST_TYPE_SIZE(*(type)0, size)\n";
595 print OUT "#define TEST_TYPE_SIGNED(type) \\\n";
596 print OUT " ok((type) -1 < 0, \"(\" #type \") -1 < 0\\n\");\n";
598 print OUT "#define TEST_TYPE_UNSIGNED(type) \\\n";
599 print OUT " ok((type) -1 > 0, \"(\" #type \") -1 > 0\\n\");\n";
603 ########################################################################
606 sub output_footer($$$) {
609 my $test_dir = shift;
610 my @tests = @{(shift)};
612 print OUT "START_TEST(generated)\n";
614 foreach my $test (@tests) {
615 print OUT " test_$test();\n";
620 ########################################################################
621 # output_test_pack_type
623 sub output_test_pack_type($$$$$$) {
626 my $type_name2type = shift;
627 my $type_name2optional = shift;
628 my $type_name2optional_fields = shift;
629 my $type_name = shift;
632 my $optional_fields = $$type_name2optional_fields{$type_name};
634 my $type_align = $type->align;
635 my $type_pack = $type->pack;
636 my $type_size = $type->size;
637 my $type_kind = $type->kind;
639 if (defined($type_pack)) {
640 print OUT " /* $type_name (pack $type_pack) */\n";
642 print OUT " /* $type_name */\n";
645 if (!scalar(keys(%$optional_fields)) && defined($type_align) && defined($type_size)) {
646 print OUT " TEST_TYPE($type_name, $type_size, $type_align);\n";
649 if ($type_kind eq "float") {
651 } elsif ($type_kind eq "pointer") {
652 my $dereference_type;
653 $dereference_type = sub {
656 my @fields = $type->fields;
657 my $type_name2 =$fields[0]->type_name;
659 if ($type_name2 =~ s/\s*\*$//) {
660 my $type2 = $$type_name2type{$type_name2};
661 if (defined($type2)) {
664 if ($type_name2 !~ /^(?:PVOID|VOID|void)$/) {
665 $output->write("$type_name2: warning: type not found 1\n");
669 } elsif ($type_name2 =~ /^\w+$/) {
670 my $type2 = $$type_name2type{$type_name2};
671 if (defined($type2)) {
672 return &$dereference_type($type2);
674 $output->write("$type_name2: warning: type not found\n");
677 } elsif ($type_name2 =~ /^\w+\s*\((?:\s*CALLBACK|\s*NTAPI|\s*WINAPI)?\s*\*\s*\)\s*\(.*?\)$/) {
680 $output->write("$type_name2: warning: type can't be parsed\n");
685 my $type2 = &$dereference_type($type);
686 if (defined($type2)) {
687 my $type_name2 = $type2->name;
688 my $type_align2 = $type2->align;
689 my $type_size2 = $type2->size;
691 my $optional = $$type_name2optional{$type_name};
692 my $optional_fields2 = $$type_name2optional_fields{$type_name2};
694 if (!$optional && !scalar(keys(%$optional_fields2)) && defined($type_align2) && defined($type_size2)) {
695 print OUT " TEST_TYPE_POINTER($type_name, $type_size2, $type_align2);\n";
697 # $output->write("$type_name: warning: type size not found\n");
700 } elsif ($type_kind eq "signed") {
701 print OUT " TEST_TYPE_SIGNED($type_name);\n";
702 } elsif ($type_kind eq "unsigned") {
703 print OUT " TEST_TYPE_UNSIGNED($type_name);\n";
707 sub output_test_pack_fields($$$$$$$);
708 sub output_test_pack_fields($$$$$$$) {
711 my $type_name2type = shift;
712 my $type_name2optional = shift;
713 my $type_name2optional_fields = shift;
714 my $type_name = shift;
718 my $optional_fields = $$type_name2optional_fields{$type_name};
720 foreach my $field ($type->fields()) {
721 my $field_type_name = $field->type_name;
722 $field_type_name =~ s/\s+DECLSPEC_ALIGN\(\d+\)//;
723 my $field_name = $field->name;
724 my $field_size = $field->size;
725 my $field_offset = $field->offset;
726 my $field_align = $field->align;
728 next if $field_name eq "" || (defined($field_size) && $field_size < 0);
729 # We cannot take the address of a bitfield with MSVC
730 next if ($field_type_name =~ /:/);
732 if ($$optional_fields{$field_name}) {
734 } elsif (defined($field_size) && defined($field_offset)) {
735 $field_offset += $offset;
736 if ($field_name eq "DUMMYSTRUCTNAME") {
737 print OUT "#ifdef NONAMELESSSTRUCT\n";
738 print OUT " TEST_FIELD($type_name, $field_type_name, $field_name, ";
739 print OUT "$field_offset, $field_size, $field_align);\n";
741 output_test_pack_fields(\*OUT, $type_name2type, $type_name2optional, $type_name2optional_fields,
742 $type_name, $$type_name2type{$field_type_name}, $field_offset);
743 print OUT "#endif\n";
745 print OUT " TEST_FIELD($type_name, $field_type_name, $field_name, ";
746 print OUT "$field_offset, $field_size, $field_align);\n";
749 # $output->write("$type_name: $field_type_name: $field_name: test not generated (offset not defined)\n");
754 ########################################################################
757 sub output_test_pack($$$$) {
760 my $test_dir = shift;
763 my $type_names_used = shift;
765 $output->prefix("$test_dir: $test: ");
767 my @headers = $tests->get_section($test_dir, $test, "header");
768 my @type_names = $tests->get_section($test_dir, $test, "type");
770 my %type_name2optional;
771 my %type_name2optional_fields;
773 foreach my $_type_name (@type_names) {
774 my $type_name = $_type_name;
776 if ($type_name =~ s/^!//) {
777 $type_name2optional{$type_name}++;
780 my $optional_fields = {};
781 if ($type_name =~ s/:\s*(.*?)$//) {
782 my @fields = split /\s+/, $1;
783 foreach my $field (@fields) {
784 if ($field =~ s/^!//) {
785 $$optional_fields{$field}++;
790 $type_name2optional_fields{$type_name} = $optional_fields;
793 foreach my $header (@headers) {
794 my $type_name2type = $file2types{"include/$header"};
796 foreach my $_type_name (@type_names) {
797 my $type_name = $_type_name;
799 my $skip = ($type_name =~ s/^!//);
800 $type_name =~ s/:.*?$//;
801 my $type = $$type_name2type{$type_name};
802 if (!defined($type)) {
805 $$type_names_used{$type_name} = $skip ? -1 : 1;
808 print OUT "static void test_${test}_$type_name(void)\n";
810 output_test_pack_type(\*OUT, $type_name2type, \%type_name2optional, \%type_name2optional_fields,
812 output_test_pack_fields(\*OUT, $type_name2type, \%type_name2optional, \%type_name2optional_fields,
813 $type_name, $type, 0);
821 ########################################################################
824 sub output_file($$$$) {
827 my $test_dir = shift;
828 my @tests = @{(shift)};
830 my $type_names_used = shift;
832 output_header(\*OUT, $test_dir, \@tests);
834 foreach my $test (@tests) {
835 my %type_names_used2;
837 if ($test eq "pack") {
838 output_test_pack(\*OUT, $test_dir, $test, \%type_names_used2);
840 die "no such test ($test)\n";
843 print OUT "static void test_$test(void)\n";
845 foreach my $type_name (sort(keys(%type_names_used2))) {
846 $$type_names_used{$type_name} = $type_names_used2{$type_name};
847 if ($type_names_used2{$type_name} > 0) {
848 print OUT " test_${test}_$type_name();\n";
855 output_footer(\*OUT, $test_dir, \@tests);
860 ########################################################################
863 my %type_names_used = ();
865 my @test_dirs = $tests->get_test_dirs();
866 foreach my $test_dir (@test_dirs) {
867 my $file = "$wine_dir/$test_dir/generated.c";
868 replace_file($file, \&output_file, $test_dir, \@tests, \%type_names_used);
871 foreach my $header (sort(keys(%file2types))) {
872 $output->prefix("$header: ");
873 $header =~ s%^include/%%;
874 my $type_name2type = $file2types{"include/$header"};
875 foreach my $_type_name (sort(keys(%$type_name2type))) {
876 my $type_name = $_type_name;
878 if (!exists($type_names_used{$type_name})) {
879 $output->write("$type_name: type not used\n");
884 $output->prefix("$winapi_dir/tests.dat: ");
885 foreach my $type_name (sort(keys(%type_names_used))) {
887 foreach my $header (sort(keys(%file2types))) {
888 my $type_name2type = $file2types{"include/$header"};
889 if (exists($type_name2type{$type_name})) {
895 $output->write("$type_name: type not used\n");