Search code examples
c++visual-studio-2005windows-ce

How to use UnitTest++ on Windows CE Environment?


The UnitTest++ library directly states: "the following platforms are supported:

Win32
Linux
Mac OS X"

However, has anyone tried it out on Win CE environment?

I am getting various compiler errors related to Win APIs. e.g.

BOOL GetProcessAffinityMask( HANDLE hProcess, PDWORD_PTR lpProcessAffinityMask, PDWORD_PTR lpSystemAffinityMask );

DWORD_PTR SetThreadAffinityMask( HANDLE hThread, DWORD_PTR dwThreadAffinityMask );

etc.


Solution

  • All(or most of) the Win32 APIs used in UnitTest++ were related to timer, and if we ignore those API using preprocessor directives(for Win CE Environment), it gets compiled successfully.

    Now while executing the Test, we came across another issue that printf function doesn't give output on WinCE terminal. So we replaced all printf function with OutputDebugString() and were able to execute test and see result on terminal like PuTTY. However the timing tests wouldn't work anymore, which wasn't the requirement for us right now.