From 1b1097de1d9b610b1ba2eccb8faf2d4286286e28 Mon Sep 17 00:00:00 2001 From: Neil Dhar Date: Tue, 1 Aug 2023 16:12:50 -0700 Subject: [PATCH] Run JSI tests in Hermes CMake build (#38659) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38659 Run JSI tests against all the Hermes implementations exposed by `APITestFactory`. To build with the older version of gtest available in Hermes, the test needed to be slightly modified. Changelog: [Internal] Reviewed By: avp Differential Revision: D47373805 fbshipit-source-id: 58958b4a60dac25f1b7defa490b888f21a665b0c --- packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp b/packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp index 2c1c3ae5bc7..1aa1ba2a377 100644 --- a/packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp +++ b/packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp @@ -754,7 +754,7 @@ TEST_P(JSITest, HostFunctionTest) { .utf8(rt), "A cat was called with std::function::target"); EXPECT_TRUE(callable.isHostFunction(rt)); - EXPECT_NE(callable.getHostFunction(rt).target(), nullptr); + EXPECT_TRUE(callable.getHostFunction(rt).target() != nullptr); std::string strval = "strval1"; auto getter = Object(rt); @@ -1245,7 +1245,7 @@ TEST_P(JSITest, MultiDecoratorTest) { 0, [](Runtime& rt, const Value& thisVal, const Value* args, size_t count) { MultiRuntime* funcmrt = dynamic_cast(&rt); - EXPECT_NE(funcmrt, nullptr); + EXPECT_TRUE(funcmrt != nullptr); EXPECT_EQ(funcmrt->count(), 3); EXPECT_EQ(funcmrt->nest(), 1); return Value::undefined(); @@ -1439,7 +1439,7 @@ TEST_P(JSITest, MultilevelDecoratedHostObject) { EXPECT_EQ(1, RD2::numGets); } -INSTANTIATE_TEST_SUITE_P( +INSTANTIATE_TEST_CASE_P( Runtimes, JSITest, ::testing::ValuesIn(runtimeGenerators()));