• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Plug-in Unit Test with GoogleTest fails with RTLCompatibleNewDelegate build error

New Here ,
May 11, 2022 May 11, 2022

Copy link to clipboard

Copied

Hi C++ plug-in developers!

I've tried to implement a unit test for my plug-in using GoogleTest.

To build the plug-in I'm using CMake and to add the testing framework I've added a subfolder to my plug-in project and downloaded it with FetchContent (see https://google.github.io/googletest/quickstart-cmake.html)

This works nicely for my own code.

But when I try to test code with Adobe's header files included I get an unknown type error. So I included the same directories and precompiled headers to my test executable as I ded for my plug-in target. This way I got rid of the unknown type errors but ended up with:

undefined symbols for architecture x86_64:

"K2Memory::RTLCompatibleNewDelegate(unsigned long)", referenced from:
testing::internal::TypedExpectation<int (bool, double)>& testing::internal::TypedExpectation<int (bool, double)>::WillOnce<void>(testing::Action<int (bool, double)>) in Test.o
...
"K2Memory::RTLCompatibleDeleteDelegate(void*)", referenced from:
Dummy_foobar_Test::~Dummy_foobar_Test() in Test.o
TeaBreakTest_MorningTea_Test::~TeaBreakTest_MorningTea_Test() in Test.o

...

 

Has anybody managed to implement a unit test with GoogleTest including an Adobe header like WideString.h or PMString.h? Is it possible at all?

 

There's an entry for the second error message in this forum (see https://community.adobe.com/t5/indesign-discussions/trackallocation-asserts-why-how-to-get-rid-of-it...) saying that the RTLCompatibleDeleteDelegate error means that the delete operator is not properly overloaded and/or that an Adobe SDK library is missing. I haven't found out which library I might have missed.

 

I hope someone can help me, best regards

 Lars

TOPICS
Feature request , SDK

Views

153

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 25, 2022 May 25, 2022

I've been working in the background to get you an answer. 

 

One option is to use the Dev Support. It's not a free service unfortunately.

If you do get to use this service do let us know how you are getting on and keep in touch.

https://helpx.adobe.com/support/programs/cc-exchange-developer-support.html

 

Thanks

Likes

Translate

Translate
Community Expert ,
May 24, 2022 May 24, 2022

Copy link to clipboard

Copied

Hi @lbergerVJ,

This seems more of a C++ issue than an Adobe SDK issue. The thing is not a lot of us on this forum dab in SDK development so getting reponse on this one would be largely in vain. I suggest you try posting on Stackoverflow as well. There atleast you would get ideas to try. 

-Manan

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 25, 2022 May 25, 2022

Copy link to clipboard

Copied

I've been working in the background to get you an answer. 

 

One option is to use the Dev Support. It's not a free service unfortunately.

If you do get to use this service do let us know how you are getting on and keep in touch.

https://helpx.adobe.com/support/programs/cc-exchange-developer-support.html

 

Thanks

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 30, 2022 May 30, 2022

Copy link to clipboard

Copied

LATEST

InDesign plug-ins rely on a ton of shared libraries that are part of the InDesign application. PMRuntimeLib, ObjectModelLib, PublicLib etc.

Of course adding these libraries to a standalone project does not solve the real problem. If you intend to run your plug-in without InDesign, you'd have to mock decades worth of code to get similar behaviour.

A realistic approach would be to turn your testing framework into another plug-in (maybe start from snippetrunner), add some UI or scripting support and let everything run from within InDesign.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines