MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/xstudio / TEST

Function TEST

src/timeline/test/clip_test.cpp:11–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace xstudio::timeline;
10
11TEST(ClipTest, Test) {
12 Clip c;
13
14 // check uuid copied
15 EXPECT_EQ(c.item().uuid(), c.uuid());
16 EXPECT_FALSE(c.item().uuid().is_null());
17
18 // check type
19 EXPECT_EQ(c.item().item_type(), ItemType::IT_CLIP);
20
21 // check initial value
22 EXPECT_EQ(c.item().trimmed_range().duration(), timebase::k_flicks_zero_seconds);
23
24 EXPECT_EQ(c.item().top_left().first, 0);
25 EXPECT_EQ(c.item().top_left().second, 0);
26
27 EXPECT_EQ(c.item().bottom_right().first, 0);
28 EXPECT_EQ(c.item().bottom_right().second, 1);
29
30 c.item().set_available_range(FrameRange(
31 FrameRateDuration(1, timebase::k_flicks_24fps),
32 FrameRateDuration(10, timebase::k_flicks_24fps)));
33
34 EXPECT_EQ(c.item().top_left().first, 0);
35 EXPECT_EQ(c.item().top_left().second, 0);
36
37 EXPECT_EQ(c.item().bottom_right().first, 10);
38 EXPECT_EQ(c.item().bottom_right().second, 1);
39
40
41 Clip c2(c.serialise());
42 EXPECT_EQ(c2.item().uuid(), c.uuid());
43}

Callers

nothing calls this directly

Calls 12

itemMethod · 0.80
item_typeMethod · 0.80
top_leftMethod · 0.80
bottom_rightMethod · 0.80
set_available_rangeMethod · 0.80
FrameRangeClass · 0.50
FrameRateDurationClass · 0.50
uuidMethod · 0.45
is_nullMethod · 0.45
durationMethod · 0.45
trimmed_rangeMethod · 0.45
serialiseMethod · 0.45

Tested by

no test coverage detected