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

57

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
no replies

Have something to add?

Join the conversation