summaryrefslogtreecommitdiff
path: root/adb/adb_utils_test.cpp
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2019-02-26 20:55:19 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-02-26 20:55:19 +0000
commit216d158daf88edfd954dc03c65b339698319f63d (patch)
treef925f4c4dec9a8e1c25943920c0ad882dd8e5b47 /adb/adb_utils_test.cpp
parent1706eb08fe8a7600d4698566b3d779b97bd1e279 (diff)
parent43f3805950d69f9da87664ada214d5af0e02753f (diff)
Merge changes I86c3ec0f,I57d1a30a,Ib50d289b,I791a4f82,I316a8799, ...
* changes: adb: switch sockets.cpp to ConsumePrefix. adbd: switch abb to ConsumePrefix. adb: increment server version. adb: wait for device to disconnect upon `adb root`. adb: implement wait-for-disconnect. adb: tell the client what transport it received. adbd: switch daemon/services to ConsumePrefix. adb: switch host_service_to_socket to string_view. adb: switch handle_host_request to string_view. adb: switch adb_io.h to string_view. adb: add helper to consume a prefix on a string_view. adb: make ParseUint reject garbage at the end by default.
Diffstat (limited to 'adb/adb_utils_test.cpp')
-rw-r--r--adb/adb_utils_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/adb/adb_utils_test.cpp b/adb/adb_utils_test.cpp
index 8518e17825..bd676c2deb 100644
--- a/adb/adb_utils_test.cpp
+++ b/adb/adb_utils_test.cpp
@@ -206,6 +206,14 @@ void TestParseUint(std::string_view string, bool expected_success, uint32_t expe
EXPECT_EQ(remaining, "foo");
}
}
+
+ // With trailing text, without remaining.
+ {
+ std::string text = std::string(string) + "foo";
+ uint32_t value;
+ bool success = ParseUint(&value, text, nullptr);
+ EXPECT_EQ(success, false);
+ }
}
TEST(adb_utils, ParseUint) {