Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Plugins example code for SetPointerPlugin #47

Open
keith-at-spacee opened this issue Jan 28, 2021 · 0 comments
Open

Clean up Plugins example code for SetPointerPlugin #47

keith-at-spacee opened this issue Jan 28, 2021 · 0 comments

Comments

@keith-at-spacee
Copy link

I'm having a problem compiling AllTests.cpp after adding the setup code which seems to be recommended in Plugin Manual re: SetPointerPlugin . My AllTests.cpp looks like this:

#include "CppUTest/CommandLineTestRunner.h"

int main(int ac, char** av)
{
    TestRegistry* r = TestRegistry::getCurrentRegistry();
    SetPointerPlugin ps("PointerStore");
    r->installPlugin(&ps);

    return CommandLineTestRunner::RunAllTests(ac, av);
}

but when I compile it (gcc:10), I get an error:

$ make ./test-obj/1/2/tests/AllTests.o
compiling AllTests.cpp
tests/AllTests.cpp: In function ‘int main(int, char**)’:
tests/AllTests.cpp:11:34: error: incomplete type ‘TestRegistry’ used in nested name specifier
   11 |  TestRegistry* r = TestRegistry::getCurrentRegistry();
      |                                  ^~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
make: *** [/home/keith/e2_studio/Ranger/CppUTest/build/MakefileWorker.mk:511: test-obj/1/2/tests/AllTests.o] Error 1

After searching for SetPointerPlugin in the CppUTest source files, in function int CommandLineTestRunner::runAllTestsMain() the SetPointerPlugin is installed in the registry by default, with no extra setup code being needed in main(). So it seems that the setup code shown for installing it should be removed from Plugin Manual re: SetPointerPlugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant