diff options
| author | Josh Gao <jmgao@google.com> | 2016-12-05 13:24:48 -0800 |
|---|---|---|
| committer | Josh Gao <jmgao@google.com> | 2016-12-05 17:38:30 -0800 |
| commit | a3577e1ac558d83428c492e806549e278e5dc8fb (patch) | |
| tree | 8068ad366d73c51c08fc64f2d4dea5722fbf0a8b /adb/sysdeps_win32_test.cpp | |
| parent | 431e272251914e15fa37f3d31a41f6e7fa803cdf (diff) | |
Revert "Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp.""
This reverts commit 43c02b27cd50a75f0fecb44e56a9bf32c6923aef.
Test: mma
Change-Id: I6b22ead8a4b964973ee2fdb8deba42bea74880cf
Diffstat (limited to 'adb/sysdeps_win32_test.cpp')
| -rwxr-xr-x | adb/sysdeps_win32_test.cpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/adb/sysdeps_win32_test.cpp b/adb/sysdeps_win32_test.cpp index c3a3fd7c17..529b21215a 100755 --- a/adb/sysdeps_win32_test.cpp +++ b/adb/sysdeps_win32_test.cpp @@ -70,36 +70,6 @@ TEST(sysdeps_win32, adb_getenv) { } } -void TestAdbStrError(int err, const char* expected) { - errno = 12345; - const char* result = adb_strerror(err); - // Check that errno is not overwritten. - EXPECT_EQ(12345, errno); - EXPECT_STREQ(expected, result); -} - -TEST(sysdeps_win32, adb_strerror) { - // Test an error code that should not have a mapped string. Use an error - // code that is not used by the internal implementation of adb_strerror(). - TestAdbStrError(-2, "Unknown error"); - // adb_strerror() uses -1 internally, so test that it can still be passed - // as a parameter. - TestAdbStrError(-1, "Unknown error"); - // Test very big, positive unknown error. - TestAdbStrError(1000000, "Unknown error"); - - // Test success case. - // Wine returns "Success" for strerror(0), Windows returns "No error", so accept both. - std::string success = adb_strerror(0); - EXPECT_TRUE(success == "Success" || success == "No error") << "strerror(0) = " << success; - - // Test error that regular strerror() should have a string for. - TestAdbStrError(EPERM, "Operation not permitted"); - // Test error that regular strerror() doesn't have a string for, but that - // adb_strerror() returns. - TestAdbStrError(ECONNRESET, "Connection reset by peer"); -} - TEST(sysdeps_win32, unix_isatty) { // stdin and stdout should be consoles. Use CONIN$ and CONOUT$ special files // so that we can test this even if stdin/stdout have been redirected. Read |
