[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:
jameslahm 2022-05-16 21:09:12 +08:00 committed by V8 LUCI CQ
parent 3bfb0466ed
commit 37654f8fdd
3 changed files with 6 additions and 8 deletions

View File

@ -240,7 +240,6 @@ v8_source_set("cctest_sources") {
"test-property-details.cc",
"test-ptr-compr-cage.cc",
"test-random-number-generator.cc",
"test-representation.cc",
"test-roots.cc",
"test-sampler-api.cc",
"test-serialize.cc",

View File

@ -392,6 +392,7 @@ v8_source_set("unittests_sources") {
"objects/elements-kind-unittest.cc",
"objects/modules-unittest.cc",
"objects/object-unittest.cc",
"objects/representation-unittest.cc",
"objects/swiss-hash-table-helpers-unittest.cc",
"objects/value-serializer-unittest.cc",
"objects/weakarraylist-unittest.cc",

View File

@ -25,26 +25,24 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "test/cctest/cctest.h"
#include "src/objects/property-details.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace v8 {
namespace internal {
using RepresentationTest = ::testing::Test;
void TestPairPositive(Representation more_general,
Representation less_general) {
CHECK(more_general.is_more_general_than(less_general));
}
void TestPairNegative(Representation more_general,
Representation less_general) {
CHECK(!more_general.is_more_general_than(less_general));
}
TEST(RepresentationMoreGeneralThan) {
TEST_F(RepresentationTest, RepresentationMoreGeneralThan) {
TestPairNegative(Representation::None(), Representation::None());
TestPairPositive(Representation::Smi(), Representation::None());
TestPairPositive(Representation::HeapObject(), Representation::None());