pepr
asked on
VC++ 8, CppUnit, Vista: How to do unit testing with elevated permissions?
unit tests fail when registering COM Dll components...
Hi experts,
My old unit tests fail when testing registration of COM Dll components on Windows Vista machine. The reason probably is more general. It may not be specific to the registering the component. I think the reason could be that the process does not get the elevated permissions. Can you share your experience with such cases? I am ready to add any details that you need to know for the answer.
I am using CppUnit for Windows from http://cppunit.sourceforge.net (I believe that it is version 1.12.0). It was integrated to VS 2005 C++ using the recommended way => the test is run automatically after building and its output is redirected to he Output window of the IDE. The IDE with C++ is started with elevated permissions.
Thanks,
Petr
Hi experts,
My old unit tests fail when testing registration of COM Dll components on Windows Vista machine. The reason probably is more general. It may not be specific to the registering the component. I think the reason could be that the process does not get the elevated permissions. Can you share your experience with such cases? I am ready to add any details that you need to know for the answer.
I am using CppUnit for Windows from http://cppunit.sourceforge.net (I believe that it is version 1.12.0). It was integrated to VS 2005 C++ using the recommended way => the test is run automatically after building and its output is redirected to he Output window of the IDE. The IDE with C++ is started with elevated permissions.
Thanks,
Petr
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for my delay. jkr, thanks for pointing out the MS document (sorry, I have not read it yet). I am very new to using manifests. The project already generates some manifest in the directory for the configuration (i.e. Debug, Release, ...). The executable is also generated there.
For example (I use only Debug configuration for the tests), Debug/testFunction.exe exists and I can find Debug/testFunctions.exe.em bed.manife st and Debug/testFunctions.exe.in termediate .manifest. I can also find Debug/testFunctions.exe.em bed.manife st.res there. However, the Debug directory is generated. This means that the files are also generated.
In Project -- testFunction Properties... (Alt+F7) I can find something related to manifests -- see the pictures below.
How should I modify the project properties to information related to application security requirements there? Is the manifest linked to the .exe or must it be always placed neare the .exe?
Thanks,
Petr
img1.png
img2.png
For example (I use only Debug configuration for the tests), Debug/testFunction.exe exists and I can find Debug/testFunctions.exe.em
In Project -- testFunction Properties... (Alt+F7) I can find something related to manifests -- see the pictures below.
How should I modify the project properties to information related to application security requirements there? Is the manifest linked to the .exe or must it be always placed neare the .exe?
Thanks,
Petr
img1.png
img2.png
Well, create a filecalled MyModule.dll.manifest and add that as a manifest resource.
ASKER
Still not able to get it. I have to do other things now, but I promis to try later.
ASKER
I do not know when I get to solve the problem (having other things to do now). Anyway, thanks for enlighting the problem. It seems I have new things to study ;)
http://msdn.microsoft.com/en-us/magazine/cc163486.aspx