Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9e88c81

Browse files
Ink Open Sourcecopybara-github
Ink Open Source
authored andcommitted
Add some missing test coverage to brush code
PiperOrigin-RevId: 788575668
1 parent249fb04 commit9e88c81

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

‎ink/brush/brush_coat_test.cc‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include"ink/brush/brush_coat.h"
1616

17+
#include<string>
18+
1719
#include"gmock/gmock.h"
1820
#include"gtest/gtest.h"
1921
#include"fuzztest/fuzztest.h"

‎ink/brush/brush_paint_test.cc‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,12 @@ TEST(BrushPaintTest, StringifyBlendMode) {
281281
EXPECT_EQ(absl::StrCat(BrushPaint::BlendMode::kSrcAtop),"kSrcAtop");
282282
EXPECT_EQ(absl::StrCat(BrushPaint::BlendMode::kSrcIn),"kSrcIn");
283283
EXPECT_EQ(absl::StrCat(BrushPaint::BlendMode::kSrcOver),"kSrcOver");
284+
EXPECT_EQ(absl::StrCat(BrushPaint::BlendMode::kDstOver),"kDstOver");
284285
EXPECT_EQ(absl::StrCat(BrushPaint::BlendMode::kSrc),"kSrc");
286+
EXPECT_EQ(absl::StrCat(BrushPaint::BlendMode::kDst),"kDst");
287+
EXPECT_EQ(absl::StrCat(BrushPaint::BlendMode::kSrcOut),"kSrcOut");
288+
EXPECT_EQ(absl::StrCat(BrushPaint::BlendMode::kDstAtop),"kDstAtop");
289+
EXPECT_EQ(absl::StrCat(BrushPaint::BlendMode::kXor),"kXor");
285290
EXPECT_EQ(absl::StrCat(static_cast<BrushPaint::BlendMode>(99)),
286291
"BlendMode(99)");
287292
}

‎ink/brush/easing_function_test.cc‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ TEST(EasingFunctionTest, StringifySteps) {
7171
"Steps{3, StepPosition(99)}");
7272
}
7373

74+
TEST(EasingFunctionTest, StringifyStepPosition) {
75+
EXPECT_EQ(absl::StrCat(EasingFunction::StepPosition::kJumpEnd),"kJumpEnd");
76+
EXPECT_EQ(absl::StrCat(EasingFunction::StepPosition::kJumpStart),
77+
"kJumpStart");
78+
EXPECT_EQ(absl::StrCat(EasingFunction::StepPosition::kJumpNone),"kJumpNone");
79+
EXPECT_EQ(absl::StrCat(EasingFunction::StepPosition::kJumpBoth),"kJumpBoth");
80+
EXPECT_EQ(absl::StrCat(static_cast<EasingFunction::StepPosition>(99)),
81+
"StepPosition(99)");
82+
}
83+
7484
TEST(EasingFunctionTest, StringifyEasingFunction) {
7585
EXPECT_EQ(absl::StrCat(EasingFunction{}),"kLinear");
7686
EXPECT_EQ(absl::StrCat(EasingFunction{EasingFunction::Predefined::kEaseIn}),

‎ink/brush/fuzz_domains.cc‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include<cmath>
2020
#include<cstdint>
2121
#include<limits>
22+
#include<string>
2223
#include<tuple>
2324
#include<utility>
2425
#include<vector>
@@ -522,7 +523,7 @@ Domain<BrushCoat> ValidBrushCoat(DomainVariant variant) {
522523

523524
Domain<BrushFamily>ValidBrushFamily(DomainVariant variant) {
524525
returnMap(
525-
[](absl::Span<const BrushCoat> coats,const std::string id,
526+
[](absl::Span<const BrushCoat> coats,const std::string& id,
526527
const BrushFamily::InputModel& input_model) {
527528
returnBrushFamily::Create(coats, id, input_model).value();
528529
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp