[test] Move cctest/test-representation to unittests
... /objects/representation-unittest. Bug: v8:12781 Change-Id: I3ae39df619ac6920c5ff722ed481bed20b5a5c6d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3612669 Commit-Queue: 王澳 <wangao.james@bytedance.com> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/heads/main@{#80557}
This commit is contained in:
parent
3bfb0466ed
commit
37654f8fdd
@ -240,7 +240,6 @@ v8_source_set("cctest_sources") {
|
|||||||
"test-property-details.cc",
|
"test-property-details.cc",
|
||||||
"test-ptr-compr-cage.cc",
|
"test-ptr-compr-cage.cc",
|
||||||
"test-random-number-generator.cc",
|
"test-random-number-generator.cc",
|
||||||
"test-representation.cc",
|
|
||||||
"test-roots.cc",
|
"test-roots.cc",
|
||||||
"test-sampler-api.cc",
|
"test-sampler-api.cc",
|
||||||
"test-serialize.cc",
|
"test-serialize.cc",
|
||||||
|
@ -392,6 +392,7 @@ v8_source_set("unittests_sources") {
|
|||||||
"objects/elements-kind-unittest.cc",
|
"objects/elements-kind-unittest.cc",
|
||||||
"objects/modules-unittest.cc",
|
"objects/modules-unittest.cc",
|
||||||
"objects/object-unittest.cc",
|
"objects/object-unittest.cc",
|
||||||
|
"objects/representation-unittest.cc",
|
||||||
"objects/swiss-hash-table-helpers-unittest.cc",
|
"objects/swiss-hash-table-helpers-unittest.cc",
|
||||||
"objects/value-serializer-unittest.cc",
|
"objects/value-serializer-unittest.cc",
|
||||||
"objects/weakarraylist-unittest.cc",
|
"objects/weakarraylist-unittest.cc",
|
||||||
|
@ -25,26 +25,24 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "test/cctest/cctest.h"
|
|
||||||
|
|
||||||
#include "src/objects/property-details.h"
|
#include "src/objects/property-details.h"
|
||||||
|
#include "testing/gtest/include/gtest/gtest.h"
|
||||||
|
|
||||||
namespace v8 {
|
namespace v8 {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
|
using RepresentationTest = ::testing::Test;
|
||||||
void TestPairPositive(Representation more_general,
|
void TestPairPositive(Representation more_general,
|
||||||
Representation less_general) {
|
Representation less_general) {
|
||||||
CHECK(more_general.is_more_general_than(less_general));
|
CHECK(more_general.is_more_general_than(less_general));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestPairNegative(Representation more_general,
|
void TestPairNegative(Representation more_general,
|
||||||
Representation less_general) {
|
Representation less_general) {
|
||||||
CHECK(!more_general.is_more_general_than(less_general));
|
CHECK(!more_general.is_more_general_than(less_general));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(RepresentationTest, RepresentationMoreGeneralThan) {
|
||||||
TEST(RepresentationMoreGeneralThan) {
|
|
||||||
TestPairNegative(Representation::None(), Representation::None());
|
TestPairNegative(Representation::None(), Representation::None());
|
||||||
TestPairPositive(Representation::Smi(), Representation::None());
|
TestPairPositive(Representation::Smi(), Representation::None());
|
||||||
TestPairPositive(Representation::HeapObject(), Representation::None());
|
TestPairPositive(Representation::HeapObject(), Representation::None());
|
Loading…
Reference in New Issue
Block a user