OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 { | 83 { |
84 EXPECT_EQ(-10, toAnimatableDouble(AnimatableValue::add(AnimatableDouble::cre
ate(-2).get(), AnimatableDouble::create(-8).get()).get())->toDouble()); | 84 EXPECT_EQ(-10, toAnimatableDouble(AnimatableValue::add(AnimatableDouble::cre
ate(-2).get(), AnimatableDouble::create(-8).get()).get())->toDouble()); |
85 EXPECT_EQ(0, toAnimatableDouble(AnimatableValue::add(AnimatableDouble::creat
e(50).get(), AnimatableDouble::create(-50).get()).get())->toDouble()); | 85 EXPECT_EQ(0, toAnimatableDouble(AnimatableValue::add(AnimatableDouble::creat
e(50).get(), AnimatableDouble::create(-50).get()).get())->toDouble()); |
86 EXPECT_EQ(10, toAnimatableDouble(AnimatableValue::add(AnimatableDouble::crea
te(4).get(), AnimatableDouble::create(6).get()).get())->toDouble()); | 86 EXPECT_EQ(10, toAnimatableDouble(AnimatableValue::add(AnimatableDouble::crea
te(4).get(), AnimatableDouble::create(6).get()).get())->toDouble()); |
87 EXPECT_EQ(20, toAnimatableDouble(AnimatableValue::add(AnimatableDouble::crea
te(0).get(), AnimatableDouble::create(20).get()).get())->toDouble()); | 87 EXPECT_EQ(20, toAnimatableDouble(AnimatableValue::add(AnimatableDouble::crea
te(0).get(), AnimatableDouble::create(20).get()).get())->toDouble()); |
88 EXPECT_EQ(30, toAnimatableDouble(AnimatableValue::add(AnimatableDouble::crea
te(30).get(), AnimatableDouble::create(0).get()).get())->toDouble()); | 88 EXPECT_EQ(30, toAnimatableDouble(AnimatableValue::add(AnimatableDouble::crea
te(30).get(), AnimatableDouble::create(0).get()).get())->toDouble()); |
89 } | 89 } |
90 | 90 |
91 TEST(AnimationAnimatableDoubleTest, Distance) | 91 TEST(AnimationAnimatableDoubleTest, Distance) |
92 { | 92 { |
93 RefPtrWillBeRawPtr<AnimatableDouble> first = AnimatableDouble::create(-1.5); | 93 RefPtr<AnimatableDouble> first = AnimatableDouble::create(-1.5); |
94 RefPtrWillBeRawPtr<AnimatableDouble> second = AnimatableDouble::create(2.25)
; | 94 RefPtr<AnimatableDouble> second = AnimatableDouble::create(2.25); |
95 RefPtrWillBeRawPtr<AnimatableDouble> third = AnimatableDouble::create(3); | 95 RefPtr<AnimatableDouble> third = AnimatableDouble::create(3); |
96 | 96 |
97 EXPECT_DOUBLE_EQ(3.75, AnimatableValue::distance(first.get(), second.get()))
; | 97 EXPECT_DOUBLE_EQ(3.75, AnimatableValue::distance(first.get(), second.get()))
; |
98 EXPECT_DOUBLE_EQ(0.75, AnimatableValue::distance(second.get(), third.get()))
; | 98 EXPECT_DOUBLE_EQ(0.75, AnimatableValue::distance(second.get(), third.get()))
; |
99 EXPECT_DOUBLE_EQ(4.5, AnimatableValue::distance(third.get(), first.get())); | 99 EXPECT_DOUBLE_EQ(4.5, AnimatableValue::distance(third.get(), first.get())); |
100 } | 100 } |
101 | 101 |
102 } | 102 } |
OLD | NEW |