[unittest] Rename last to prev
`last` indicates that it's the last element of the list but in reality this supposed to indicate the previous entry in the list. Rename this to something more clearer. Change-Id: I26c9a1fca02cf6b10d0447768da694d590a43932 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2637229 Reviewed-by: Camillo Bruni <cbruni@chromium.org> Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#72167}
This commit is contained in:
parent
7de37e9666
commit
b6708f7227
@ -57,7 +57,7 @@ TEST(Object, InstanceTypeList) {
|
||||
|
||||
TEST(Object, InstanceTypeListOrder) {
|
||||
int current = 0;
|
||||
int last = -1;
|
||||
int prev = -1;
|
||||
InstanceType current_type = static_cast<InstanceType>(current);
|
||||
EXPECT_EQ(current_type, InstanceType::FIRST_TYPE);
|
||||
EXPECT_EQ(current_type, InstanceType::INTERNALIZED_STRING_TYPE);
|
||||
@ -65,12 +65,12 @@ TEST(Object, InstanceTypeListOrder) {
|
||||
current_type = InstanceType::type; \
|
||||
current = static_cast<int>(current_type); \
|
||||
if (current > static_cast<int>(LAST_NAME_TYPE)) { \
|
||||
EXPECT_LE(last + 1, current); \
|
||||
EXPECT_LE(prev + 1, current); \
|
||||
} \
|
||||
EXPECT_LT(last, current) << " INSTANCE_TYPE_LIST is not ordered: " \
|
||||
<< "last = " << static_cast<InstanceType>(last) \
|
||||
EXPECT_LT(prev, current) << " INSTANCE_TYPE_LIST is not ordered: " \
|
||||
<< "last = " << static_cast<InstanceType>(prev) \
|
||||
<< " vs. current = " << current_type; \
|
||||
last = current;
|
||||
prev = current;
|
||||
|
||||
// Only test hand-written portion of instance type list. The generated portion
|
||||
// doesn't run the same risk of getting out of order, and it does emit type
|
||||
@ -83,17 +83,17 @@ TEST(Object, InstanceTypeListOrder) {
|
||||
|
||||
TEST(Object, StructListOrder) {
|
||||
int current = static_cast<int>(InstanceType::FIRST_STRUCT_TYPE);
|
||||
int last = current - 1;
|
||||
ASSERT_LT(0, last);
|
||||
int prev = current - 1;
|
||||
ASSERT_LT(0, prev);
|
||||
InstanceType current_type = static_cast<InstanceType>(current);
|
||||
#define TEST_STRUCT(TYPE, class, name) \
|
||||
current_type = InstanceType::TYPE; \
|
||||
current = static_cast<int>(current_type); \
|
||||
EXPECT_LE(last + 1, current) \
|
||||
EXPECT_LE(prev + 1, current) \
|
||||
<< " STRUCT_LIST is not ordered: " \
|
||||
<< " last = " << static_cast<InstanceType>(last) \
|
||||
<< " last = " << static_cast<InstanceType>(prev) \
|
||||
<< " vs. current = " << current_type; \
|
||||
last = current;
|
||||
prev = current;
|
||||
|
||||
// Only test the _BASE portion (the hand-coded part). Note that the values are
|
||||
// not necessarily consecutive because some Structs that need special
|
||||
|
Loading…
Reference in New Issue
Block a user