]> Cypherpunks repositories - gostls13.git/commit
runtime: tidy Windows callback test
authorAustin Clements <austin@google.com>
Sat, 17 Oct 2020 02:22:20 +0000 (22:22 -0400)
committerAustin Clements <austin@google.com>
Mon, 26 Oct 2020 14:50:37 +0000 (14:50 +0000)
commit614a8b7c8ad42ff8a9bc363f813af2aae046fd0c
tree6d037f259cb08b9df6526ef1a426f7740cf44a63
parentbda37a0b8a4e89318901a68492b79cf6531fa2ff
runtime: tidy Windows callback test

This simplifies the systematic test of Windows callbacks with
different signatures and prepares it for expanded coverage of function
signatures.

It now returns a result from the Go function and threads it back
through C. This simplifies things, but also previously the code could
have succeeded by simply not calling the callbacks at all (though
other tests would have caught that).

It bundles together the C function description and the Go function
it's intended to call. Now the test source generation and the test
running both loop over a single slice of test functions.

Since the C function and Go function are now bundled, it generates the
C function by reflectively inspecting the signature of the Go
function. For the moment, we keep the same test suite, which is
entirely functions with "uintptr" arguments, but we'll expand this
shortly.

It now use sub-tests. This way tests automatically get useful
diagnostic labels in failures and the tests don't have to catch panics
on their own.

It eliminates the DLL function argument. I honestly couldn't figure
out what the point of this was, and it added what appeared to be an
unnecessary loop level to the tests.

Change-Id: I120dfd4785057cc2c392bd2c821302f276bd128e
Reviewed-on: https://go-review.googlesource.com/c/go/+/263270
Trust: Austin Clements <austin@google.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/runtime/syscall_windows_test.go