Skip to content

Commit

Permalink
Merge 05fec68 into 9f7f6e3
Browse files Browse the repository at this point in the history
  • Loading branch information
berryzplus authored Apr 19, 2020
2 parents 9f7f6e3 + 05fec68 commit ef22bc9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/unittests/test-cnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ TEST(CNativeW, ConstructWithStringWithLength)
CNativeW value(sz, cch);
ASSERT_STREQ(sz, value.GetStringPtr());
EXPECT_EQ(cch, value.GetStringLength());
EXPECT_LT(cch + 1, value.capacity());
EXPECT_LE(cch + 1, value.capacity());
}

/*!
Expand All @@ -70,7 +70,7 @@ TEST(CNativeW, ConstructWithString)
CNativeW value(sz);
ASSERT_STREQ(sz, value.GetStringPtr());
EXPECT_EQ(cch, value.GetStringLength());
EXPECT_LT(cch + 1, value.capacity());
EXPECT_LE(cch + 1, value.capacity());
}

/*!
Expand All @@ -83,7 +83,7 @@ TEST(CNativeW, ConstructWithStringEmpty)
CNativeW value(sz);
ASSERT_STREQ(sz, value.GetStringPtr());
EXPECT_EQ(0, value.GetStringLength());
EXPECT_LT(1, value.capacity());
EXPECT_LE(1, value.capacity());
}

/*!
Expand Down Expand Up @@ -133,7 +133,7 @@ TEST(CNativeW, ConstructFromOtherByMove)
CNativeW value(std::move(other));
ASSERT_STREQ(sz, value.GetStringPtr());
EXPECT_EQ(cch, value.GetStringLength());
EXPECT_LT(cch + 1, value.capacity());
EXPECT_LE(cch + 1, value.capacity());

// ムーブ元は抜け殻になる
ASSERT_EQ(NULL, other.GetStringPtr());
Expand All @@ -157,7 +157,7 @@ TEST(CNativeW, CopyFromOther)
value = other;
ASSERT_STREQ(sz, value.GetStringPtr());
EXPECT_EQ(cch, value.GetStringLength());
EXPECT_LT(cch + 1, value.capacity());
EXPECT_LE(cch + 1, value.capacity());

// コピー元バッファとは別に新しいバッファが確保される
ASSERT_NE(other.GetStringPtr(), value.GetStringPtr());
Expand All @@ -179,7 +179,7 @@ TEST(CNativeW, MoveFromOther)
value = std::move(other);
ASSERT_STREQ(sz, value.GetStringPtr());
EXPECT_EQ(cch, value.GetStringLength());
EXPECT_LT(cch + 1, value.capacity());
EXPECT_LE(cch + 1, value.capacity());

// ムーブ元は抜け殻になる
ASSERT_EQ(NULL, other.GetStringPtr());
Expand Down Expand Up @@ -220,7 +220,7 @@ TEST(CNativeW, AssignString)
value = sz;
ASSERT_STREQ(sz, value.GetStringPtr());
EXPECT_EQ(cch, value.GetStringLength());
EXPECT_LT(cch + 1, value.capacity());
EXPECT_LE(cch + 1, value.capacity());
}

/*!
Expand Down Expand Up @@ -263,7 +263,7 @@ TEST(CNativeW, AppendChar)
value += sz[0];
ASSERT_STREQ(sz, value.GetStringPtr());
EXPECT_EQ(1, value.GetStringLength());
EXPECT_LT(1 + 1, value.capacity());
EXPECT_LE(1 + 1, value.capacity());
}

/*!
Expand All @@ -280,7 +280,7 @@ TEST(CNativeW, AppendString)
value += sz;
ASSERT_STREQ(sz, value.GetStringPtr());
EXPECT_EQ(cch, value.GetStringLength());
EXPECT_LT(cch + 1, value.capacity());
EXPECT_LE(cch + 1, value.capacity());
}

/*!
Expand Down Expand Up @@ -548,7 +548,7 @@ TEST(CNativeW, ReplaceOfNullString)
value.Replace(L"置換前", L"置換後");
ASSERT_STREQ(L"", value.GetStringPtr());
EXPECT_EQ(0, value.GetStringLength());
EXPECT_LT(1, value.capacity());
EXPECT_LE(1, value.capacity());
}

/*!
Expand Down

0 comments on commit ef22bc9

Please sign in to comment.