1 #include <gtest/gtest.h> 15 EXPECT_EQ(1, atomic_fibonacci.
next());
16 EXPECT_EQ(2, atomic_fibonacci.
next());
17 EXPECT_EQ(3, atomic_fibonacci.
next());
18 EXPECT_EQ(5, atomic_fibonacci.
next());
19 EXPECT_EQ(8, atomic_fibonacci.
next());
20 EXPECT_EQ(13, atomic_fibonacci.
next());
23 EXPECT_EQ(1, atomic_fibonacci.
next());
24 EXPECT_EQ(1, atomic_fibonacci.
next());
25 EXPECT_EQ(2, atomic_fibonacci.
next());
26 EXPECT_EQ(3, atomic_fibonacci.
next());
27 EXPECT_EQ(5, atomic_fibonacci.
next());
41 next = atomic_fibonacci_next.
next();
42 next = atomic_fibonacci_next.
next();
43 nextNext = atomic_fibonacci_nextNext.
nextNext();
45 EXPECT_EQ(2, nextNext);
46 EXPECT_EQ(next, nextNext);
48 next = atomic_fibonacci_next.
next();
49 next = atomic_fibonacci_next.
next();
50 nextNext = atomic_fibonacci_nextNext.
nextNext();
52 EXPECT_EQ(5, nextNext);
53 EXPECT_EQ(next, nextNext);
56 next = atomic_fibonacci_next.
next();
57 next = atomic_fibonacci_next.
next();
58 nextNext = atomic_fibonacci_nextNext.
nextNext();
60 EXPECT_EQ(1, nextNext);
61 EXPECT_EQ(next, nextNext);
63 next = atomic_fibonacci_next.
next();
64 next = atomic_fibonacci_next.
next();
65 nextNext = atomic_fibonacci_nextNext.
nextNext();
67 EXPECT_EQ(2, nextNext);
68 EXPECT_EQ(next, nextNext);
70 next = atomic_fibonacci_next.
next();
71 next = atomic_fibonacci_next.
next();
72 nextNext = atomic_fibonacci_nextNext.
nextNext();
74 EXPECT_EQ(5, nextNext);
75 EXPECT_EQ(next, nextNext);
87 EXPECT_EQ(29, default_constructed.
next());
88 EXPECT_EQ(1, default_constructed.
nextNext());
89 EXPECT_EQ(2, default_constructed.
next());
92 EXPECT_EQ(5, shared_pointer->next());
std::shared_ptr< AtomicFibonacci > AtomicFibonacciPtr
TEST(AtomicFibonacci, next)