From 280bad5b424833c7ec4d2a68c59c71c7fbaf3b74 Mon Sep 17 00:00:00 2001 From: JinmingHu Date: Fri, 8 Jan 2021 12:03:11 +0800 Subject: [PATCH] Fix ut crash issue introduced in PR#1274 (#1286) # Pull Request Checklist Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly: See the detailed list in the [contributing guide](https://github.com/Azure/azure-sdk-for-cpp/blob/master/CONTRIBUTING.md#pull-requests). - [x] [C++ Guidelines](https://azure.github.io/azure-sdk/cpp_introduction.html) - [x] Doxygen docs - [x] Unit tests - [x] No unwanted commits/changes - [x] Descriptive title/description - [x] PR is single purpose - [x] Related issue listed - [x] Comments in source - [x] No typos - [x] Update changelog - [x] Not work-in-progress - [x] External references or docs updated - [x] Self review of PR done - [x] Any breaking changes? --- .../test/blob_container_client_test.cpp | 8 ++++---- .../azure-storage-blobs/test/blob_service_client_test.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/storage/azure-storage-blobs/test/blob_container_client_test.cpp b/sdk/storage/azure-storage-blobs/test/blob_container_client_test.cpp index 0b1f2de88..3d29b24aa 100644 --- a/sdk/storage/azure-storage-blobs/test/blob_container_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/blob_container_client_test.cpp @@ -208,7 +208,7 @@ namespace Azure { namespace Storage { namespace Test { } listBlobs.insert(blob.Name); } - } while (!options.ContinuationToken.GetValue().empty()); + } while (options.ContinuationToken.HasValue()); EXPECT_TRUE( std::includes(listBlobs.begin(), listBlobs.end(), p1p2Blobs.begin(), p1p2Blobs.end())); @@ -222,7 +222,7 @@ namespace Azure { namespace Storage { namespace Test { { listBlobs.insert(blob.Name); } - } while (!options.ContinuationToken.GetValue().empty()); + } while (options.ContinuationToken.HasValue()); EXPECT_TRUE(std::includes(listBlobs.begin(), listBlobs.end(), p1Blobs.begin(), p1Blobs.end())); } @@ -356,7 +356,7 @@ namespace Azure { namespace Storage { namespace Test { foundMetadata = true; } } - } while (!options.ContinuationToken.GetValue().empty()); + } while (options.ContinuationToken.HasValue()); EXPECT_TRUE(foundSnapshot); EXPECT_TRUE(foundVersions); EXPECT_TRUE(foundCurrentVersion); @@ -717,7 +717,7 @@ namespace Azure { namespace Storage { namespace Test { break; } } - } while (!options.ContinuationToken.GetValue().empty()); + } while (options.ContinuationToken.HasValue()); } EXPECT_EQ(deletedContainerItem.Name, containerName); EXPECT_TRUE(deletedContainerItem.IsDeleted); diff --git a/sdk/storage/azure-storage-blobs/test/blob_service_client_test.cpp b/sdk/storage/azure-storage-blobs/test/blob_service_client_test.cpp index 928b32ea8..03377d587 100644 --- a/sdk/storage/azure-storage-blobs/test/blob_service_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/blob_service_client_test.cpp @@ -122,7 +122,7 @@ namespace Azure { namespace Storage { namespace Test { { listContainers.insert(container.Name); } - } while (!options.ContinuationToken.GetValue().empty()); + } while (options.ContinuationToken.HasValue()); EXPECT_TRUE(std::includes( listContainers.begin(), listContainers.end(), @@ -153,7 +153,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_FALSE(container.PreventEncryptionScopeOverride); listContainers.insert(container.Name); } - } while (!options.ContinuationToken.GetValue().empty()); + } while (options.ContinuationToken.HasValue()); EXPECT_TRUE(std::includes( listContainers.begin(), listContainers.end(), p1Containers.begin(), p1Containers.end()));