diff options
author | Tom Cherry <tomcherry@google.com> | 2017-04-11 13:53:37 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2017-04-14 10:23:52 -0700 |
commit | e3e48214b718d5c6bb76d50c56344b222a23a234 (patch) | |
tree | 17a260d247cd0b2d5f2c1f5c238c8fdb5896358e /init/devices_test.cpp | |
parent | e771b69e72ad464c511c504cc9e9da2ada790873 (diff) | |
download | core-e3e48214b718d5c6bb76d50c56344b222a23a234.tar.gz core-e3e48214b718d5c6bb76d50c56344b222a23a234.tar.bz2 core-e3e48214b718d5c6bb76d50c56344b222a23a234.zip |
ueventd: replace char* with std::string in struct uevent
Bug: 36250207
Test: Boot bullhead
Test: Boot sailfish, observe no boot time regression
Test: init unit tests
Change-Id: Ib82833bea56bdafbe1d7a045126aaa91a8725d98
Diffstat (limited to 'init/devices_test.cpp')
-rw-r--r-- | init/devices_test.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/init/devices_test.cpp b/init/devices_test.cpp index 5be0d8888..b6b4b8209 100644 --- a/init/devices_test.cpp +++ b/init/devices_test.cpp @@ -127,7 +127,7 @@ TEST(devices, get_block_device_symlinks_success_platform) { const char* platform_device = "/devices/soc.0/f9824900.sdhci"; uevent uevent = { .path = "/devices/soc.0/f9824900.sdhci/mmc_host/mmc0/mmc0:0001/block/mmcblk0", - .partition_name = nullptr, + .partition_name = "", .partition_num = -1, }; std::vector<std::string> expected_result{"/dev/block/platform/soc.0/f9824900.sdhci/mmcblk0"}; @@ -156,7 +156,7 @@ TEST(devices, get_block_device_symlinks_success_platform_with_partition_only_num const char* platform_device = "/devices/soc.0/f9824900.sdhci"; uevent uevent = { .path = "/devices/soc.0/f9824900.sdhci/mmc_host/mmc0/mmc0:0001/block/mmcblk0p1", - .partition_name = nullptr, + .partition_name = "", .partition_num = 1, }; std::vector<std::string> expected_result{ @@ -185,9 +185,7 @@ TEST(devices, get_block_device_symlinks_success_platform_with_partition_only_nam TEST(devices, get_block_device_symlinks_success_pci) { const char* platform_device = "/devices/do/not/match"; uevent uevent = { - .path = "/devices/pci0000:00/0000:00:1f.2/mmcblk0", - .partition_name = nullptr, - .partition_num = -1, + .path = "/devices/pci0000:00/0000:00:1f.2/mmcblk0", .partition_name = "", .partition_num = -1, }; std::vector<std::string> expected_result{"/dev/block/pci/pci0000:00/0000:00:1f.2/mmcblk0"}; @@ -197,7 +195,7 @@ TEST(devices, get_block_device_symlinks_success_pci) { TEST(devices, get_block_device_symlinks_pci_bad_format) { const char* platform_device = "/devices/do/not/match"; uevent uevent = { - .path = "/devices/pci//mmcblk0", .partition_name = nullptr, .partition_num = -1, + .path = "/devices/pci//mmcblk0", .partition_name = "", .partition_num = -1, }; std::vector<std::string> expected_result{}; @@ -207,7 +205,7 @@ TEST(devices, get_block_device_symlinks_pci_bad_format) { TEST(devices, get_block_device_symlinks_success_vbd) { const char* platform_device = "/devices/do/not/match"; uevent uevent = { - .path = "/devices/vbd-1234/mmcblk0", .partition_name = nullptr, .partition_num = -1, + .path = "/devices/vbd-1234/mmcblk0", .partition_name = "", .partition_num = -1, }; std::vector<std::string> expected_result{"/dev/block/vbd/1234/mmcblk0"}; @@ -217,7 +215,7 @@ TEST(devices, get_block_device_symlinks_success_vbd) { TEST(devices, get_block_device_symlinks_vbd_bad_format) { const char* platform_device = "/devices/do/not/match"; uevent uevent = { - .path = "/devices/vbd-/mmcblk0", .partition_name = nullptr, .partition_num = -1, + .path = "/devices/vbd-/mmcblk0", .partition_name = "", .partition_num = -1, }; std::vector<std::string> expected_result{}; @@ -228,7 +226,7 @@ TEST(devices, get_block_device_symlinks_no_matches) { const char* platform_device = "/devices/soc.0/f9824900.sdhci"; uevent uevent = { .path = "/devices/soc.0/not_the_device/mmc_host/mmc0/mmc0:0001/block/mmcblk0p1", - .partition_name = nullptr, + .partition_name = "", .partition_num = -1, }; std::vector<std::string> expected_result; |