diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-07-18 05:11:00 +0200 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-07-18 05:11:00 +0200 |
commit | 8013f50b03d9ca6424747abddf1657aa4e61dc34 (patch) | |
tree | 5bf35c6deefe6bcaeca33b371719f570a0b1147d /tests | |
parent | Snap for 4894319 from 399efe580621fb5c22aa163982af4b00122fa4ef to qt-release (diff) | |
parent | Merge "Fix the arguments passed to getopt_long(3)." am: 29932e7bcc am: 2f9d61ad25 (diff) | |
download | android_bootable_recovery-8013f50b03d9ca6424747abddf1657aa4e61dc34.tar android_bootable_recovery-8013f50b03d9ca6424747abddf1657aa4e61dc34.tar.gz android_bootable_recovery-8013f50b03d9ca6424747abddf1657aa4e61dc34.tar.bz2 android_bootable_recovery-8013f50b03d9ca6424747abddf1657aa4e61dc34.tar.lz android_bootable_recovery-8013f50b03d9ca6424747abddf1657aa4e61dc34.tar.xz android_bootable_recovery-8013f50b03d9ca6424747abddf1657aa4e61dc34.tar.zst android_bootable_recovery-8013f50b03d9ca6424747abddf1657aa4e61dc34.zip |
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/sysutil_test.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/sysutil_test.cpp b/tests/unit/sysutil_test.cpp index 19fa4c59e..de8ff7065 100644 --- a/tests/unit/sysutil_test.cpp +++ b/tests/unit/sysutil_test.cpp @@ -127,3 +127,13 @@ TEST(SysUtilTest, MapFileBlockMapInvalidBlockMap) { ASSERT_TRUE(android::base::WriteStringToFile("/doesntexist\n4096 4096\n1\n0 1\n", temp_file.path)); ASSERT_FALSE(mapping.MapFile(filename)); } + +TEST(SysUtilTest, StringVectorToNullTerminatedArray) { + std::vector<std::string> args{ "foo", "bar", "baz" }; + auto args_with_nullptr = StringVectorToNullTerminatedArray(args); + ASSERT_EQ(4, args_with_nullptr.size()); + ASSERT_STREQ("foo", args_with_nullptr[0]); + ASSERT_STREQ("bar", args_with_nullptr[1]); + ASSERT_STREQ("baz", args_with_nullptr[2]); + ASSERT_EQ(nullptr, args_with_nullptr[3]); +} |