mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
5d1757358f
The string fields need to be padded with spaces, according to what PK11_MakeString does to find the end of the string. While here, factor all the string manipulations in the test module and use some C++ template magic to do the right thing. This changes the static asserts from (with clang): pkcs11testmodule.cpp:45:3: error: static_assert failed "TestManufacturerID too long - make it shorter" static_assert(sizeof(TestManufacturerID) <= sizeof(pInfo->manufacturerID), ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ to: pkcs11testmodule.cpp:46:3: error: static_assert failed "DestSize >= SrcSize - 1" static_assert(DestSize >= SrcSize - 1, "DestSize >= SrcSize - 1"); ^ ~~~~~~~~~~~~~~~~~~~~~~~ pkcs11testmodule.cpp:58:3: note: in instantiation of function template specialization 'CopyString<32, 63>' requested here CopyString(pInfo->manufacturerID, TestManufacturerID); ^ which actually gives more information than before: it gives the length of both buffers. |
||
---|---|---|
.. | ||
compiled | ||
gtest | ||
mochitest | ||
unit | ||
moz.build |