summaryrefslogtreecommitdiff
path: root/adb/sysdeps_win32_test.cpp
AgeCommit message (Collapse)Author
2020-10-22Migrate system/core/adb to packages/modules/adbBaligh Uddin
BUG: 167963357 Test: TH Change-Id: Ie1f82db2fb14e1bdd183bf8d3d93d5e9f974be5d Ignore-AOSP-First: Unable to Merge into aosp/master due to downstream conflicts, so working from bottom up.
2018-11-14switch to using android-base/file.h instead of android-base/test_utils.hMark Salyzyn
Test: compile Bug: 119313545 Change-Id: I4f7ad84743e974b4b4d1d7256088f6c8b749a237
2016-12-13adb: add script to trace adbd.Josh Gao
Bug: http://b/31289465 Test: sh trace.sh Change-Id: Id6e20e83742541aec6bfd9f4112adbdadc078f74
2016-12-05Revert "Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp.""Josh Gao
This reverts commit 43c02b27cd50a75f0fecb44e56a9bf32c6923aef. Test: mma Change-Id: I6b22ead8a4b964973ee2fdb8deba42bea74880cf
2016-12-05Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp."Josh Gao
This reverts commit 4fba3d2638ecec0f87fe8d8913490bfbd7234d19.
2016-11-30adb: move adb_strerror to sysdeps/win32/errno.cpp.Josh Gao
Bug: none Test: mma Change-Id: I9df4d6faf9883a78f50ca6b2b7c35f095d06ae20
2016-02-10adb: allow wine's output for sysdeps_win32 strerror test.Josh Gao
Change-Id: Ia5d04a2347df1bcd8c7efcc1da9cec9725007a58
2016-01-28adb: win32: handle incomplete UTF-8 in console output, other fixesSpencer Low
Previously, the various adb_printf, adb_fwrite, etc. functions did not correctly handle the case of the passed buffer ending with an incomplete UTF-8 sequence. This is fixed by buffering up incomplete UTF-8 sequences in g_console_output_buffer (protected by the mutex g_console_output_buffer) and outputting it later once the full sequence is available. A unittest for the main worker function, ParseCompleteUTF8(), was added to adb_test. Other fixes: - Fix the return value of number-of-chars written to be number of UTF-8 bytes instead of number of UTF-16 characters. - Don't overwrite errno in success cases of various adb_printf, etc. functions. This might be excessive, but might be useful in the case when these functions are used for debugging/tracing. - Add missing UTF-8 stdio functions that aren't currently used by adb, but might be in the future: vprintf, putc, putchar, puts. - stdin_raw_init: If we can't get the console handle, don't call SetConsoleMode(). Not a big deal, but this will prevent erroneous trace output. Change-Id: I8730e8af92882c42b884ad921b39a17b54465085 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2016-01-15Fix a couple sign-comparison warnings.Dan Albert
Bug: http://b/26523949 Change-Id: Id33146b5544147945fee3f14f7f72f39bae449f6
2015-12-04Track rename of base/ to android-base/.Elliott Hughes
Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
2015-11-02adb: create unix_isatty() function.David Pursell
Our Windows code has several different ways it checks whether an FD is a console or not, some of which aren't exactly correct as they may treat character devices (e.g. NUL) as consoles. This CL disallows using the builtin isatty() function and provides unix_isatty() instead which correctly checks these corner cases. Change-Id: I6d551c745dae691c7eb3446b585265d62c1e62fa
2015-10-18adb: win32: Improve Winsock error code mappings and stringsSpencer Low
Improved mapping of Winsock error codes to POSIX error codes, especially WSAECONNABORTED to EPIPE (which WriteFdExactly() looks for) when sending to a closed socket and WSAECONNRESET to ECONNRESET when the peer resets the connection. Use a macro to map strerror() to adb_strerror() which handles these POSIX error codes that the Windows C Runtime doesn't recognize. Also: * Unittest for adb_strerror(). * Don't trace when send() returns WSAEWOULDBLOCK because that is expected. Change-Id: If46aeb7b36de3eebfbbccf5478ff5b1bb087714b Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-09-11adb: win32: make adb_getenv() case-insensitiveSpencer Low
adb_getenv() should be case-insensitive just like the real getenv() on Windows. Added a unittest for adb_getenv(). In the process, made adb_test link with -municode so that the environment block is Unicode. Move wmain() from main.cpp to sysdeps_win32.cpp so that adb_test could also use it. Because wmain() moved, it wasn't as easy to do the runtime check to verify that -municode was used, so do that check in _ensure_env_setup() since adb_getenv() is called early in adb anyway. Added a utility ToLower() which is good enough for env vars whose keys are probably always ASCII to begin with. Change-Id: I082f7fdee9dfe2c7f76b878528d2f7863df6d8d1 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>