Merge changes I7790dde8,I065907a5,Id2e82024 into main

* changes:
  Add missing <assert.h> include
  Add missing <functional> and <vector> includes
  snapuserd_test: don't discard result of std::async
This commit is contained in:
Ryan Prichard 2023-09-22 19:42:45 +00:00 committed by Gerrit Code Review
commit 532a608f58
3 changed files with 9 additions and 2 deletions

View file

@ -714,10 +714,12 @@ TEST_F(SnapuserdTest, Snapshot_MERGE_IO_TEST) {
} }
ASSERT_NO_FATAL_FAILURE(SetupDefault()); ASSERT_NO_FATAL_FAILURE(SetupDefault());
// Issue I/O before merge begins // Issue I/O before merge begins
std::async(std::launch::async, &SnapuserdTest::ReadSnapshotDeviceAndValidate, this); auto read_future =
std::async(std::launch::async, &SnapuserdTest::ReadSnapshotDeviceAndValidate, this);
// Start the merge // Start the merge
ASSERT_TRUE(Merge()); ASSERT_TRUE(Merge());
ValidateMerge(); ValidateMerge();
read_future.wait();
} }
TEST_F(SnapuserdTest, Snapshot_MERGE_IO_TEST_1) { TEST_F(SnapuserdTest, Snapshot_MERGE_IO_TEST_1) {
@ -728,9 +730,11 @@ TEST_F(SnapuserdTest, Snapshot_MERGE_IO_TEST_1) {
// Start the merge // Start the merge
ASSERT_TRUE(StartMerge()); ASSERT_TRUE(StartMerge());
// Issue I/O in parallel when merge is in-progress // Issue I/O in parallel when merge is in-progress
std::async(std::launch::async, &SnapuserdTest::ReadSnapshotDeviceAndValidate, this); auto read_future =
std::async(std::launch::async, &SnapuserdTest::ReadSnapshotDeviceAndValidate, this);
CheckMergeCompletion(); CheckMergeCompletion();
ValidateMerge(); ValidateMerge();
read_future.wait();
} }
TEST_F(SnapuserdTest, Snapshot_Merge_Resume) { TEST_F(SnapuserdTest, Snapshot_Merge_Resume) {

View file

@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <functional>
#include <iostream> #include <iostream>
#include <vector>
#include "fuzzer/FuzzedDataProvider.h" #include "fuzzer/FuzzedDataProvider.h"
#include "utils/String16.h" #include "utils/String16.h"

View file

@ -19,6 +19,7 @@
#include <BufferAllocator/BufferAllocator.h> #include <BufferAllocator/BufferAllocator.h>
#include <android-base/logging.h> #include <android-base/logging.h>
#include <android-base/unique_fd.h> #include <android-base/unique_fd.h>
#include <assert.h>
#include <fcntl.h> #include <fcntl.h>
#include <getopt.h> #include <getopt.h>
#include <stdbool.h> #include <stdbool.h>