Hi Vlad,
I'm having trouble building gtest for WinCE. One problem was due to WinCE not supporting localtime() which is required for the timestamp feature you added. Maybe that could be wrapped in an ifdef GTEST_OS_WINDOWS_MOBILE?
The other problem I'm still working through. Windows is expecting _tmain or wmain instead of main when UNICODE is defined.
-Kevin
Hi Vlad,Here's a patch for localtime() on WinCE. I opted to make use of an open source lib http://time.codeplex.com/ (not mine) rather than disabling the feature. The lib is not included but a reference is in the code. The lib unfortunately does not support setting the timezone so the tests were disabled for WinCE.There's also a small change at the end of gtest_unittest.cc to compile on windows. Toss it if you don't want it. Maybe it's not needed in a cmake env. Cmake doesn't work for WinCE although patches have been submitted.Let me know if you need me to sign a contributor's agreement.You might want to run dos2unix after applying the patch.-Kevin
Hi Vlad,My apologies, I overlooked your suggested patch when I came back to this problem. It works fine against WinCE 6. I added some changes to gtest_unittest.cc so the relevant tests would pass.Testing on Win 7 fails for me. I tried using the WinCE code instead of the tzset code but that didn't work either. I think it has something to do with process privileges but I don't have a fix for it. Does it pass for you?Here's sample code for windows mentioning process privileges: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724944(v=vs.85).aspx-Kevin
Hi Vlad,Please accept the WinCE patch as is. The Win7 suggestion you make is good but won't work for WinCE because it doesn't have SystemTimeToTzSpecificLocalTime(). That's ok because WinCE doesn't have the problem with permissions. I'll work the Win7 patch in after the WinCE patch is in.
Oh, I did have a problem using namespace internal {...} in gtest.cc. I guess because it's already used in that file, it caused it to not compile (at least in MSVC). I used a different namespace and it compiled but it didn't run as expected. I'll work on it some more when I get a chance.-Kevin
Hi Vlad,Here's the requested patch. CLA has been faxed.This patch uses native api's for windows and WinCE to support the timestamp feature. WinCE had a problem with this feature when it was using the unsupported localtime() call. Windows does support localtime() but the unit tests were failing due to a lack of required permissions to set the timezone. So the native api calls were used for that platform too, which allowed us to get the local time for a given timezone rather than what the system was set to.Please let me know if you need an issue to file this against.-Kevin
Hi Vlad,It was built on Win7 using Microsoft Visual Studio 8\VC\PlatformSDK. I don't have VS2010 to check against. It doesn't seem strange to me that an api call might require permissions but I'm no authority on it.
-Kevin