desktop/qa/desktop_lib/test_desktop_lib.cxx |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 868a683138308727496f53b43aa145a0a4e03c83
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Thu Dec 13 13:30:24 2018 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Thu Dec 13 13:58:21 2018 +0200

    Un-revert the addition of more ABI checks for LibreOfficeKitClass
    
    Change-Id: Idf2ebb552065fa600a4010e83a24a0f13651c029

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 74e2c09bb5af..e7694905747e 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2463,6 +2463,11 @@ void DesktopLOKTest::testInsertCertificatePEM()
 
 namespace {
 
+constexpr size_t classOffset(int i)
+{
+    return sizeof(static_cast<struct _LibreOfficeKitClass*>(nullptr)->nSize) + 
i * sizeof(void*);
+}
+
 constexpr size_t documentClassOffset(int i)
 {
     return sizeof(static_cast<struct 
_LibreOfficeKitDocumentClass*>(nullptr)->nSize) + i * sizeof(void*);
@@ -2473,6 +2478,18 @@ constexpr size_t documentClassOffset(int i)
 void DesktopLOKTest::testABI()
 {
     // STABLE ABI, NEVER CHANGE (unless there's a very good reason, agreed by 
ESC, etc.)
+    CPPUNIT_ASSERT_EQUAL(classOffset(0), offsetof(struct _LibreOfficeKitClass, 
destroy));
+    CPPUNIT_ASSERT_EQUAL(classOffset(1), offsetof(struct _LibreOfficeKitClass, 
documentLoad));
+    CPPUNIT_ASSERT_EQUAL(classOffset(2), offsetof(struct _LibreOfficeKitClass, 
getError));
+    CPPUNIT_ASSERT_EQUAL(classOffset(3), offsetof(struct _LibreOfficeKitClass, 
documentLoadWithOptions));
+    CPPUNIT_ASSERT_EQUAL(classOffset(4), offsetof(struct _LibreOfficeKitClass, 
freeError));
+    CPPUNIT_ASSERT_EQUAL(classOffset(5), offsetof(struct _LibreOfficeKitClass, 
registerCallback));
+    CPPUNIT_ASSERT_EQUAL(classOffset(6), offsetof(struct _LibreOfficeKitClass, 
getFilterTypes));
+    CPPUNIT_ASSERT_EQUAL(classOffset(7), offsetof(struct _LibreOfficeKitClass, 
setOptionalFeatures));
+    CPPUNIT_ASSERT_EQUAL(classOffset(8), offsetof(struct _LibreOfficeKitClass, 
setDocumentPassword));
+    CPPUNIT_ASSERT_EQUAL(classOffset(9), offsetof(struct _LibreOfficeKitClass, 
getVersionInfo));
+    CPPUNIT_ASSERT_EQUAL(classOffset(10), offsetof(struct 
_LibreOfficeKitClass, runMacro));
+
     CPPUNIT_ASSERT_EQUAL(documentClassOffset(0), offsetof(struct 
_LibreOfficeKitDocumentClass, destroy));
     CPPUNIT_ASSERT_EQUAL(documentClassOffset(1), offsetof(struct 
_LibreOfficeKitDocumentClass, saveAs));
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to