From 3f333e189b716d61c054a7e3737cf2fed13ba5f2 Mon Sep 17 00:00:00 2001 From: saturneric Date: Thu, 24 Sep 2026 23:25:36 +0200 Subject: refactor(email): simplify crypto SDK test stubs - remove unused byte buffer duplication helper - update the crypto entry point section comment --- src/m_email/test/EMailCryptoSdkStubs.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'src') diff --git a/src/m_email/test/EMailCryptoSdkStubs.cpp b/src/m_email/test/EMailCryptoSdkStubs.cpp index 2553b7f..ba66d3e 100644 --- a/src/m_email/test/EMailCryptoSdkStubs.cpp +++ b/src/m_email/test/EMailCryptoSdkStubs.cpp @@ -141,23 +141,7 @@ auto AppText(GFHostContextRef) -> const char* { return "test"; } auto AppLocale(GFHostContextRef) -> char* { return StrDupNormal("en_US"); } auto AppZero(GFHostContextRef) -> int { return 0; } -// --- the four crypto entry points ------------------------------------------- -// -// Both forms are provided. The string forms mirror the real SDK exactly, -// truncation included, so a test can still demonstrate what the old boundary -// did; the N forms record the length they were given. - -namespace { -// Mirrors GFBytesDup on the host side: byte-exact, NUL-terminated one past the -// end, with the true length reported separately. -auto BytesOut(const QByteArray& b, size_t* size) -> char* { - auto* d = static_cast(MemAllocNormal(b.size() + 1)); - std::memcpy(d, b.constData(), b.size()); - d[b.size()] = '\0'; - if (size != nullptr) *size = static_cast(b.size()); - return d; -} -} // namespace +// --- the crypto entry points --------------------------------------------- auto GpgAnalyse(GFHostContextRef, int, int, uint32_t, const char* capsule_id, uint32_t, GFGpgAnalysis* out) -> int { -- cgit