mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 10:43:24 +00:00
6786219e1f
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. |
||
---|---|---|
.. | ||
apps | ||
certverifier | ||
manager | ||
nss | ||
patches | ||
pkix | ||
sandbox |