Skip to content

Commit

Permalink
Fix warnings when building CDPAgentTest
Browse files Browse the repository at this point in the history
Summary:
Was getting clang warning that the constexpr don't need to be captured,
but if I remove them then MSVC is unhappy. So capturing to a separate
variable name.

Reviewed By: mattbfb

Differential Revision: D54282269

fbshipit-source-id: 09646b66586a6b4ca4a81c852ee23321a243c1ed
  • Loading branch information
dannysu authored and facebook-github-bot committed Feb 28, 2024
1 parent 129cb3c commit 6bc872f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions unittests/API/CDPAgentTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2270,8 +2270,8 @@ TEST_F(CDPAgentTest, RuntimeConsoleLog) {
sendAndCheckResponse("Runtime.enable", msgId++);

// Generate message
waitFor<bool>([this, kTimestamp, kStringValue](auto promise) {
runtimeThread_->add([this, kTimestamp, kStringValue, promise]() {
waitFor<bool>([this, timestamp = kTimestamp, kStringValue](auto promise) {
runtimeThread_->add([this, timestamp, kStringValue, promise]() {
jsi::String arg0 = jsi::String::createFromAscii(*runtime_, kStringValue);

jsi::Object arg1 = jsi::Object(*runtime_);
Expand All @@ -2283,7 +2283,7 @@ TEST_F(CDPAgentTest, RuntimeConsoleLog) {
arg2.setProperty(*runtime_, "bool2", true);

ConsoleMessage message(
kTimestamp, ConsoleAPIType::kWarning, std::vector<jsi::Value>());
timestamp, ConsoleAPIType::kWarning, std::vector<jsi::Value>());
message.args.reserve(3);
message.args.push_back(std::move(arg0));
message.args.push_back(std::move(arg1));
Expand Down Expand Up @@ -2341,9 +2341,9 @@ TEST_F(CDPAgentTest, RuntimeConsoleBuffer) {
constexpr int kNumLogsToTest = kExpectedMaxBufferSize * 2;

// Generate console messages on the runtime thread
waitFor<bool>([this, kNumLogsToTest](auto promise) {
runtimeThread_->add([this, promise, kNumLogsToTest]() {
for (int i = 0; i < kNumLogsToTest; i++) {
waitFor<bool>([this, numLogs = kNumLogsToTest](auto promise) {
runtimeThread_->add([this, promise, numLogs]() {
for (int i = 0; i < numLogs; i++) {
jsi::Value value =
jsi::String::createFromUtf8(*runtime_, std::to_string(i));
std::vector<jsi::Value> args;
Expand Down

0 comments on commit 6bc872f

Please sign in to comment.