Update tests.dat to include the various #include fixes.
gcc says that sizeof(long double)==12. Fix the detection of pragma packs to detect #include <...>. Generate ok("...\n") calls.
This commit is contained in:
parent
3707ed8b68
commit
56b63e85c3
|
@ -584,6 +584,7 @@ windef.h
|
||||||
|
|
||||||
%include
|
%include
|
||||||
|
|
||||||
|
ntstatus.h
|
||||||
windows.h
|
windows.h
|
||||||
|
|
||||||
%type
|
%type
|
||||||
|
@ -870,8 +871,11 @@ shlobj.h
|
||||||
|
|
||||||
stdarg.h
|
stdarg.h
|
||||||
windef.h
|
windef.h
|
||||||
|
winbase.h
|
||||||
wtypes.h
|
wtypes.h
|
||||||
shellapi.h
|
shellapi.h
|
||||||
|
winuser.h
|
||||||
|
wingdi.h
|
||||||
shlobj.h
|
shlobj.h
|
||||||
|
|
||||||
%type
|
%type
|
||||||
|
@ -941,8 +945,11 @@ shlwapi.h
|
||||||
|
|
||||||
%include
|
%include
|
||||||
|
|
||||||
|
stdarg.h
|
||||||
windef.h
|
windef.h
|
||||||
|
winbase.h
|
||||||
wtypes.h
|
wtypes.h
|
||||||
|
winreg.h
|
||||||
shlwapi.h
|
shlwapi.h
|
||||||
|
|
||||||
%type
|
%type
|
||||||
|
@ -972,7 +979,9 @@ urlmon.h
|
||||||
|
|
||||||
%include
|
%include
|
||||||
|
|
||||||
|
stdarg.h
|
||||||
windef.h
|
windef.h
|
||||||
|
winbase.h
|
||||||
urlmon.h
|
urlmon.h
|
||||||
|
|
||||||
%type
|
%type
|
||||||
|
|
|
@ -222,7 +222,7 @@ sub _find_align_kind_size {
|
||||||
} elsif (/^(?:long\s+double)$/) {
|
} elsif (/^(?:long\s+double)$/) {
|
||||||
$align = 4;
|
$align = 4;
|
||||||
$kind = "float";
|
$kind = "float";
|
||||||
$size = 10; # ???
|
$size = 12;
|
||||||
} elsif (/^H(?:DC|BITMAP|BRUSH|ICON|INSTANCE|MENU|METAFILE|WND)$/) {
|
} elsif (/^H(?:DC|BITMAP|BRUSH|ICON|INSTANCE|MENU|METAFILE|WND)$/) {
|
||||||
$align = 4;
|
$align = 4;
|
||||||
$kind = "unsigned";
|
$kind = "unsigned";
|
||||||
|
@ -368,11 +368,13 @@ foreach my $file (@files) {
|
||||||
my $begin_column = shift;
|
my $begin_column = shift;
|
||||||
my $preprocessor = shift;
|
my $preprocessor = shift;
|
||||||
|
|
||||||
local $_ = $preprocessor;
|
#print "found_preprocessor: $begin_line: [$_]\n";
|
||||||
if (/^\#\s*include\s+\"pshpack(\d+)\.h\"$/) {
|
if ($preprocessor =~ /^\#\s*include\s+[\"<]pshpack(\d+)\.h[\">]$/) {
|
||||||
push @packs, $1;
|
push @packs, $1;
|
||||||
} elsif(/^\#\s*include\s+\"poppack\.h\"$/) {
|
#print "found pack $1 on line $begin_line\n";
|
||||||
|
} elsif($preprocessor =~ /^\#\s*include\s+[\"<]poppack\.h[\">]$/) {
|
||||||
pop @packs;
|
pop @packs;
|
||||||
|
#print "found poppack on line $begin_line\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -515,7 +517,7 @@ sub output_header {
|
||||||
print OUT "#ifdef FIELD_ALIGNMENT\n";
|
print OUT "#ifdef FIELD_ALIGNMENT\n";
|
||||||
print OUT "# define TEST_FIELD_ALIGNMENT(type, field, align) \\\n";
|
print OUT "# define TEST_FIELD_ALIGNMENT(type, field, align) \\\n";
|
||||||
print OUT " ok(FIELD_ALIGNMENT(type, field) == align, \\\n";
|
print OUT " ok(FIELD_ALIGNMENT(type, field) == align, \\\n";
|
||||||
print OUT " \"FIELD_ALIGNMENT(\" #type \", \" #field \") == %d (expected \" #align \")\", \\\n";
|
print OUT " \"FIELD_ALIGNMENT(\" #type \", \" #field \") == %d (expected \" #align \")\\n\", \\\n";
|
||||||
print OUT " FIELD_ALIGNMENT(type, field))\n";
|
print OUT " FIELD_ALIGNMENT(type, field))\n";
|
||||||
print OUT "#else\n";
|
print OUT "#else\n";
|
||||||
print OUT "# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0)\n";
|
print OUT "# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0)\n";
|
||||||
|
@ -523,7 +525,7 @@ sub output_header {
|
||||||
print OUT "\n";
|
print OUT "\n";
|
||||||
print OUT "#define TEST_FIELD_OFFSET(type, field, offset) \\\n";
|
print OUT "#define TEST_FIELD_OFFSET(type, field, offset) \\\n";
|
||||||
print OUT " ok(FIELD_OFFSET(type, field) == offset, \\\n";
|
print OUT " ok(FIELD_OFFSET(type, field) == offset, \\\n";
|
||||||
print OUT " \"FIELD_OFFSET(\" #type \", \" #field \") == %ld (expected \" #offset \")\", \\\n";
|
print OUT " \"FIELD_OFFSET(\" #type \", \" #field \") == %ld (expected \" #offset \")\\n\", \\\n";
|
||||||
print OUT " FIELD_OFFSET(type, field))\n";
|
print OUT " FIELD_OFFSET(type, field))\n";
|
||||||
print OUT "\n";
|
print OUT "\n";
|
||||||
print OUT "#ifdef _TYPE_ALIGNMENT\n";
|
print OUT "#ifdef _TYPE_ALIGNMENT\n";
|
||||||
|
@ -535,13 +537,13 @@ sub output_header {
|
||||||
print OUT "\n";
|
print OUT "\n";
|
||||||
print OUT "#ifdef TYPE_ALIGNMENT\n";
|
print OUT "#ifdef TYPE_ALIGNMENT\n";
|
||||||
print OUT "#define TEST_TYPE_ALIGNMENT(type, align) \\\n";
|
print OUT "#define TEST_TYPE_ALIGNMENT(type, align) \\\n";
|
||||||
print OUT " ok(TYPE_ALIGNMENT(type) == align, \"TYPE_ALIGNMENT(\" #type \") == %d (expected \" #align \")\", TYPE_ALIGNMENT(type))\n";
|
print OUT " ok(TYPE_ALIGNMENT(type) == align, \"TYPE_ALIGNMENT(\" #type \") == %d (expected \" #align \")\\n\", TYPE_ALIGNMENT(type))\n";
|
||||||
print OUT "#else\n";
|
print OUT "#else\n";
|
||||||
print OUT "# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0)\n";
|
print OUT "# define TEST_TYPE_ALIGNMENT(type, align) do { } while (0)\n";
|
||||||
print OUT "#endif\n";
|
print OUT "#endif\n";
|
||||||
print OUT "\n";
|
print OUT "\n";
|
||||||
print OUT "#define TEST_TYPE_SIZE(type, size) \\\n";
|
print OUT "#define TEST_TYPE_SIZE(type, size) \\\n";
|
||||||
print OUT " ok(sizeof(type) == size, \"sizeof(\" #type \") == %d (expected \" #size \")\", sizeof(type))\n";
|
print OUT " ok(sizeof(type) == size, \"sizeof(\" #type \") == %d (expected \" #size \")\\n\", sizeof(type))\n";
|
||||||
print OUT "\n";
|
print OUT "\n";
|
||||||
print OUT "/***********************************************************************\n";
|
print OUT "/***********************************************************************\n";
|
||||||
print OUT " * Test macros\n";
|
print OUT " * Test macros\n";
|
||||||
|
@ -561,10 +563,10 @@ sub output_header {
|
||||||
print OUT " TEST_TYPE_SIZE(*(type)0, size)\n";
|
print OUT " TEST_TYPE_SIZE(*(type)0, size)\n";
|
||||||
print OUT "\n";
|
print OUT "\n";
|
||||||
print OUT "#define TEST_TYPE_SIGNED(type) \\\n";
|
print OUT "#define TEST_TYPE_SIGNED(type) \\\n";
|
||||||
print OUT " ok((type) -1 < 0, \"(\" #type \") -1 < 0\");\n";
|
print OUT " ok((type) -1 < 0, \"(\" #type \") -1 < 0\\n\");\n";
|
||||||
print OUT "\n";
|
print OUT "\n";
|
||||||
print OUT "#define TEST_TYPE_UNSIGNED(type) \\\n";
|
print OUT "#define TEST_TYPE_UNSIGNED(type) \\\n";
|
||||||
print OUT " ok((type) -1 > 0, \"(\" #type \") -1 > 0\");\n";
|
print OUT " ok((type) -1 > 0, \"(\" #type \") -1 > 0\\n\");\n";
|
||||||
print OUT "\n";
|
print OUT "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue