adb_test/libbase_test: win32: get some tests working

adb_test:

* Fix adb_utils directory_exists test for Windows. The test actually
fails because directory_exists() is not aware of junctions or symlinks,
but I'm not really sure if that is a bad thing (since these are rare on
Windows to begin with).

* Fix crash during transport tests due to mutex not being initialized.

* io tests fail for various reasons (see adb_io_test.cpp for more info).

libbase_test:

* Get it building on Win32 by implementing mkstemp() and mkdtemp().

* Run StringPrintf %z test on Windows because it passes because we build
with __USE_MINGW_ANSI_STDIO which implements %z.

* I didn't fixup the logging tests: some logging tests fail because when
abort() is called on Windows, by default it pops up UI asking whether a
crash dump should be sent to Microsoft. To some degree this makes sense,
as I think LOG(FATAL) does crash dumping in Chromium. This should be
revisited in the future.

Change-Id: Iaa2433e5294ff162e0b2aa9fe6e4ec09a6893f7a
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
diff --git a/adb/adb_io_test.cpp b/adb/adb_io_test.cpp
index 0ae21db..f637073 100644
--- a/adb/adb_io_test.cpp
+++ b/adb/adb_io_test.cpp
@@ -30,6 +30,12 @@
 #include "base/file.h"
 #include "base/test_utils.h"
 
+// All of these tests fail on Windows because they use the C Runtime open(),
+// but the adb_io APIs expect file descriptors from adb_open(). Also, the
+// android::base file APIs use the C Runtime which uses CR/LF translation by
+// default (changeable with _setmode()), but the adb_io APIs use adb_read()
+// and adb_write() which do no translation.
+
 TEST(io, ReadFdExactly_whole) {
   const char expected[] = "Foobar";
   TemporaryFile tf;