|
Scroom 0.14-49-gb7ae7a6d
|
#include <gtest/gtest.h>#include <scroom/gtk-helpers.hh>#include <scroom/linearsegment.hh>#include <scroom/rectangle.hh>
Classes | |
| class | RectangleHorizontalTestScaffold |
| class | RectangleVerticalTestScaffold |
| class | Rectangle_and_Segment_TypedTests< ScaffoldT > |
Typedefs | |
| using | ScaffoldTypes = ::testing::Types< Segment< int >, RectangleHorizontalTestScaffold, RectangleVerticalTestScaffold > |
Functions | |
| template<class Scaffold > | |
| void | containedSegmentEqualsIntersection (const Scaffold &container, const Scaffold &contained) |
| template<class Scaffold > | |
| void | intersectsImpliesNonEmptyIntersection (const Scaffold &a, const Scaffold &b) |
| TYPED_TEST_SUITE (Rectangle_and_Segment_TypedTests, ScaffoldTypes) | |
| Scaffold | s2 (2, 5) |
| Scaffold | s4 (2, 5) |
| Scaffold | s5 (3, 5) |
| Scaffold | s6 (2, 6) |
| Scaffold | s7 (7, -5) |
| EXPECT_TRUE (s1.isEmpty()) | |
| EXPECT_EQ (0, s1.getSize()) | |
| EXPECT_FALSE (s2.isEmpty()) | |
| EXPECT_TRUE (s3.isEmpty()) | |
| EXPECT_FALSE (s4.isEmpty()) | |
| EXPECT_FALSE (s5.isEmpty()) | |
| EXPECT_FALSE (s6.isEmpty()) | |
| EXPECT_EQ (2, s2.getStart()) | |
| EXPECT_EQ (5, s2.getSize()) | |
| EXPECT_EQ (7, s2.getEnd()) | |
| EXPECT_TRUE (s1==s3) | |
| EXPECT_TRUE (s2==s4) | |
| EXPECT_TRUE (s1 !=s2) | |
| EXPECT_TRUE (s2 !=s5) | |
| EXPECT_EQ (2, s7.getStart()) | |
| EXPECT_EQ (5, s7.getSize()) | |
| EXPECT_EQ (7, s7.getEnd()) | |
| EXPECT_EQ (s2, s7) | |
| Scaffold | orig (2, 5) |
| EXPECT_FALSE (s.isEmpty()) | |
| EXPECT_EQ (5, s.getStart()) | |
| EXPECT_EQ (10, s.getEnd()) | |
| Scaffold | s (2, 10) |
| s | reduceSizeToMultipleOf (5) |
| EXPECT_EQ (2, s.getStart()) | |
| s | reduceSizeToMultipleOf (3) |
| EXPECT_EQ (9, s.getSize()) | |
| EXPECT_FALSE (s1.contains(0)) | |
| EXPECT_FALSE (s2.contains(0)) | |
| EXPECT_TRUE (s2.contains(2)) | |
| EXPECT_TRUE (s2.contains(6)) | |
| EXPECT_FALSE (s2.contains(7)) | |
| EXPECT_FALSE (s2.contains(8)) | |
| Scaffold | s2 (-1, 3) |
| Scaffold | s3 (-3, 2) |
| Scaffold | s4 (-2, 2) |
| Scaffold | s5 (-1, 2) |
| Scaffold | s6 (0, 2) |
| Scaffold | s7 (1, 2) |
| Scaffold | s8 (2, 2) |
| EXPECT_FALSE (s1.contains(s2)) | |
| containedSegmentEqualsIntersection (s1, s2) | |
| EXPECT_FALSE (s1.contains(s3)) | |
| containedSegmentEqualsIntersection (s1, s3) | |
| EXPECT_FALSE (s1.contains(s4)) | |
| containedSegmentEqualsIntersection (s1, s4) | |
| EXPECT_FALSE (s1.contains(s5)) | |
| containedSegmentEqualsIntersection (s1, s5) | |
| EXPECT_FALSE (s1.contains(s6)) | |
| containedSegmentEqualsIntersection (s1, s6) | |
| EXPECT_FALSE (s1.contains(s7)) | |
| containedSegmentEqualsIntersection (s1, s7) | |
| EXPECT_FALSE (s1.contains(s8)) | |
| containedSegmentEqualsIntersection (s1, s8) | |
| EXPECT_TRUE (s2.contains(s1)) | |
| containedSegmentEqualsIntersection (s2, s1) | |
| EXPECT_FALSE (s2.contains(s3)) | |
| containedSegmentEqualsIntersection (s2, s3) | |
| EXPECT_FALSE (s2.contains(s4)) | |
| containedSegmentEqualsIntersection (s2, s4) | |
| EXPECT_TRUE (s2.contains(s5)) | |
| containedSegmentEqualsIntersection (s2, s5) | |
| EXPECT_TRUE (s2.contains(s6)) | |
| containedSegmentEqualsIntersection (s2, s6) | |
| EXPECT_FALSE (s2.contains(s7)) | |
| containedSegmentEqualsIntersection (s2, s7) | |
| EXPECT_FALSE (s2.contains(s8)) | |
| containedSegmentEqualsIntersection (s2, s8) | |
| intersectsImpliesNonEmptyIntersection (s1, s2) | |
| intersectsImpliesNonEmptyIntersection (s1, s3) | |
| intersectsImpliesNonEmptyIntersection (s1, s4) | |
| intersectsImpliesNonEmptyIntersection (s1, s5) | |
| intersectsImpliesNonEmptyIntersection (s1, s6) | |
| intersectsImpliesNonEmptyIntersection (s1, s7) | |
| intersectsImpliesNonEmptyIntersection (s1, s8) | |
| EXPECT_FALSE (s2.intersects(s1)) | |
| intersectsImpliesNonEmptyIntersection (s2, s1) | |
| intersectsImpliesNonEmptyIntersection (s2, s3) | |
| EXPECT_TRUE (s2.intersects(s4)) | |
| intersectsImpliesNonEmptyIntersection (s2, s4) | |
| intersectsImpliesNonEmptyIntersection (s2, s5) | |
| intersectsImpliesNonEmptyIntersection (s2, s6) | |
| EXPECT_TRUE (s2.intersects(s7)) | |
| intersectsImpliesNonEmptyIntersection (s2, s7) | |
| intersectsImpliesNonEmptyIntersection (s2, s8) | |
| EXPECT_TRUE (s1.intersection(s2).isEmpty()) | |
| EXPECT_TRUE (s1.intersection(s3).isEmpty()) | |
| EXPECT_TRUE (s1.intersection(s4).isEmpty()) | |
| EXPECT_TRUE (s1.intersection(s5).isEmpty()) | |
| EXPECT_TRUE (s1.intersection(s6).isEmpty()) | |
| EXPECT_TRUE (s1.intersection(s7).isEmpty()) | |
| EXPECT_TRUE (s1.intersection(s8).isEmpty()) | |
| EXPECT_TRUE (s2.intersection(s1).isEmpty()) | |
| EXPECT_TRUE (s2.intersection(s3).isEmpty()) | |
| EXPECT_EQ (Scaffold(-1, 1), s2.intersection(s4)) | |
| EXPECT_EQ (s5, s2.intersection(s5)) | |
| EXPECT_EQ (s6, s2.intersection(s6)) | |
| EXPECT_EQ (Scaffold(1, 1), s2.intersection(s7)) | |
| EXPECT_TRUE (s2.intersection(s8).isEmpty()) | |
| EXPECT_EQ (make_segment(1, 3), r.getHorizontally()) | |
| EXPECT_EQ (make_segment(2, 4), r.getVertically()) | |
| EXPECT_EQ (make_rect(1, 2, 3, 4), rect) | |
| EXPECT_EQ (original, grect) | |
| EXPECT_EQ (make_point(1, 2), rect.getTopLeft()) | |
| EXPECT_EQ (make_point(4, 2), rect.getTopRight()) | |
| EXPECT_EQ (make_point(1, 6), rect.getBottomLeft()) | |
| EXPECT_EQ (make_point(4, 6), rect.getBottomRight()) | |
| EXPECT_EQ (make_point(4, 6) - make_point(1, 2), make_point(3, 4)) | |
| EXPECT_EQ (make_point(2, 4), make_point(1, 2) *2) | |
| EXPECT_EQ (make_rect(6, 8, 3, 4), make_point(5, 6)+make_rect(1, 2, 3, 4)) | |
| EXPECT_EQ (make_rect(6, 8, 3, 4) - make_point(5, 6), make_rect(1, 2, 3, 4)) | |
| EXPECT_NEAR (0.5, result.getLeft(), 1e-6) | |
| EXPECT_NEAR (2.5, result.getWidth(), 1e-6) | |
| EXPECT_NEAR (1.5, result.getTop(), 1e-6) | |
| EXPECT_NEAR (3.5, result.getHeight(), 1e-6) | |
| EXPECT_TRUE (original.leftOf(5).isEmpty()) | |
| EXPECT_EQ (original, original.leftOf(40)) | |
| EXPECT_EQ (Rectangle< int >(10, 20, 10, 40), original.leftOf(20)) | |
| EXPECT_TRUE (original.rightOf(40).isEmpty()) | |
| EXPECT_EQ (original, original.rightOf(5)) | |
| EXPECT_EQ (Rectangle< int >(20, 20, 20, 40), original.rightOf(20)) | |
| EXPECT_EQ (original, original.above(60)) | |
| EXPECT_EQ (Rectangle< int >(10, 20, 30, 20), original.above(40)) | |
| EXPECT_TRUE (original.below(60).isEmpty()) | |
| EXPECT_EQ (original, original.below(20)) | |
| EXPECT_EQ (Rectangle< int >(10, 40, 30, 20), original.below(40)) | |
| EXPECT_EQ (Rectangle< int >(10, 30, 5, 5), original.leftOf(Rectangle< int >(15, 30, 10, 5))) | |
| EXPECT_EQ (Rectangle< int >(10, 20, 10, 40), original.above(Rectangle< int >(0, 100, 20, 10))) | |
| EXPECT_EQ (expected, result) | |
| Segment< int > const | expected (-3, 3) |
| Segment< int > const | expected (35, 15) |
| Segment< int > const | expected (3, 2) |
Variables | |
| Scaffold | s1 |
| Scaffold | s3 |
| Scaffold | s = orig.moveTo(5) |
| const auto | rect = Rectangle<int>(original) |
| const GdkRectangle | grect = rect.toGdkRectangle() |
| auto | result = 0.5 * make_rect(1, 3, 5, 7) |
| Segment< int > const | expected (12, 3) |
| Segment< int > const | right (3, 7) |
| using ScaffoldTypes = ::testing::Types<Segment<int>, RectangleHorizontalTestScaffold, RectangleVerticalTestScaffold> |
| void containedSegmentEqualsIntersection | ( | const Scaffold & | container, |
| const Scaffold & | contained | ||
| ) |
| EXPECT_EQ | ( | 0 | , |
| s1. | getSize() | ||
| ) |
Referenced by containedSegmentEqualsIntersection(), and intersectsImpliesNonEmptyIntersection().

| EXPECT_EQ | ( | 10 | , |
| s. | getEnd() | ||
| ) |
| EXPECT_EQ | ( | 2 | , |
| s. | getStart() | ||
| ) |
| EXPECT_EQ | ( | 2 | , |
| s2. | getStart() | ||
| ) |
| EXPECT_EQ | ( | 2 | , |
| s7. | getStart() | ||
| ) |
| EXPECT_EQ | ( | 5 | , |
| s. | getStart() | ||
| ) |
| EXPECT_EQ | ( | 5 | , |
| s2. | getSize() | ||
| ) |
| EXPECT_EQ | ( | 5 | , |
| s7. | getSize() | ||
| ) |
| EXPECT_EQ | ( | 7 | , |
| s2. | getEnd() | ||
| ) |
| EXPECT_EQ | ( | 7 | , |
| s7. | getEnd() | ||
| ) |
| EXPECT_EQ | ( | 9 | , |
| s. | getSize() | ||
| ) |
| EXPECT_EQ | ( | make_point(1, 2) | , |
| rect. | getTopLeft() | ||
| ) |
| EXPECT_EQ | ( | make_point(1, 6) | , |
| rect. | getBottomLeft() | ||
| ) |
| EXPECT_EQ | ( | make_point(2, 4) | , |
| make_point(1, 2) * | 2 | ||
| ) |
| EXPECT_EQ | ( | make_point(4, 2) | , |
| rect. | getTopRight() | ||
| ) |
| EXPECT_EQ | ( | make_point(4, 6) - make_point(1, 2) | , |
| make_point(3, 4) | |||
| ) |
| EXPECT_EQ | ( | make_point(4, 6) | , |
| rect. | getBottomRight() | ||
| ) |
| EXPECT_EQ | ( | make_rect(1, 2, 3, 4) | , |
| rect | |||
| ) |
| EXPECT_EQ | ( | make_rect(6, 8, 3, 4) - make_point(5, 6) | , |
| make_rect(1, 2, 3, 4) | |||
| ) |
| EXPECT_EQ | ( | make_rect(6, 8, 3, 4) | , |
| make_point(5, 6)+make_rect(1, 2, 3, 4) | |||
| ) |
| EXPECT_EQ | ( | make_segment(1, 3) | , |
| r. | getHorizontally() | ||
| ) |
| EXPECT_EQ | ( | make_segment(2, 4) | , |
| r. | getVertically() | ||
| ) |
| EXPECT_EQ | ( | original | , |
| grect | |||
| ) |
| EXPECT_EQ | ( | original | , |
| original. | above60 | ||
| ) |
| EXPECT_EQ | ( | original | , |
| original. | below20 | ||
| ) |
| EXPECT_EQ | ( | original | , |
| original. | leftOf40 | ||
| ) |
| EXPECT_EQ | ( | original | , |
| original. | rightOf5 | ||
| ) |
| EXPECT_EQ | ( | Rectangle< int > | 10, 20, 10, 40, |
| original. | aboveRectangle< int >(0, 100, 20, 10) | ||
| ) |
| EXPECT_EQ | ( | Rectangle< int > | 10, 20, 10, 40, |
| original. | leftOf20 | ||
| ) |
| EXPECT_EQ | ( | Rectangle< int > | 10, 20, 30, 20, |
| original. | above40 | ||
| ) |
| EXPECT_EQ | ( | Rectangle< int > | 10, 30, 5, 5, |
| original. | leftOfRectangle< int >(15, 30, 10, 5) | ||
| ) |
| EXPECT_EQ | ( | Rectangle< int > | 10, 40, 30, 20, |
| original. | below40 | ||
| ) |
| EXPECT_EQ | ( | Rectangle< int > | 20, 20, 20, 40, |
| original. | rightOf20 | ||
| ) |
| EXPECT_EQ | ( | s5 | , |
| s2. | intersections5 | ||
| ) |
| EXPECT_EQ | ( | s6 | , |
| s2. | intersections6 | ||
| ) |
| EXPECT_EQ | ( | Scaffold(-1, 1) | , |
| s2. | intersections4 | ||
| ) |
| EXPECT_EQ | ( | Scaffold(1, 1) | , |
| s2. | intersections7 | ||
| ) |
| EXPECT_FALSE | ( | s. | isEmpty() | ) |
| EXPECT_FALSE | ( | s1. | contains0 | ) |
| EXPECT_FALSE | ( | s1. | containss2 | ) |
| EXPECT_FALSE | ( | s1. | containss3 | ) |
| EXPECT_FALSE | ( | s1. | containss4 | ) |
| EXPECT_FALSE | ( | s1. | containss5 | ) |
| EXPECT_FALSE | ( | s1. | containss6 | ) |
| EXPECT_FALSE | ( | s1. | containss7 | ) |
| EXPECT_FALSE | ( | s1. | containss8 | ) |
| EXPECT_FALSE | ( | s2. | contains0 | ) |
| EXPECT_FALSE | ( | s2. | contains7 | ) |
| EXPECT_FALSE | ( | s2. | contains8 | ) |
| EXPECT_FALSE | ( | s2. | containss3 | ) |
| EXPECT_FALSE | ( | s2. | containss4 | ) |
| EXPECT_FALSE | ( | s2. | containss7 | ) |
| EXPECT_FALSE | ( | s2. | containss8 | ) |
| EXPECT_FALSE | ( | s2. | intersectss1 | ) |
| EXPECT_FALSE | ( | s2. | isEmpty() | ) |
| EXPECT_FALSE | ( | s4. | isEmpty() | ) |
| EXPECT_FALSE | ( | s5. | isEmpty() | ) |
| EXPECT_FALSE | ( | s6. | isEmpty() | ) |
| EXPECT_NEAR | ( | 0. | 5, |
| result. | getLeft(), | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | 1. | 5, |
| result. | getTop(), | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | 2. | 5, |
| result. | getWidth(), | ||
| 1e- | 6 | ||
| ) |
| EXPECT_NEAR | ( | 3. | 5, |
| result. | getHeight(), | ||
| 1e- | 6 | ||
| ) |
| EXPECT_TRUE | ( | original. | below60).isEmpty( | ) |
| EXPECT_TRUE | ( | original. | leftOf5).isEmpty( | ) |
| EXPECT_TRUE | ( | original. | rightOf40).isEmpty( | ) |
| EXPECT_TRUE | ( | s1. | intersections2).isEmpty( | ) |
| EXPECT_TRUE | ( | s1. | intersections3).isEmpty( | ) |
| EXPECT_TRUE | ( | s1. | intersections4).isEmpty( | ) |
| EXPECT_TRUE | ( | s1. | intersections5).isEmpty( | ) |
| EXPECT_TRUE | ( | s1. | intersections6).isEmpty( | ) |
| EXPECT_TRUE | ( | s1. | intersections7).isEmpty( | ) |
| EXPECT_TRUE | ( | s1. | intersections8).isEmpty( | ) |
| EXPECT_TRUE | ( | s1. | isEmpty() | ) |
| EXPECT_TRUE | ( | s2. | contains2 | ) |
| EXPECT_TRUE | ( | s2. | contains6 | ) |
| EXPECT_TRUE | ( | s2. | containss1 | ) |
| EXPECT_TRUE | ( | s2. | containss5 | ) |
| EXPECT_TRUE | ( | s2. | containss6 | ) |
| EXPECT_TRUE | ( | s2. | intersections1).isEmpty( | ) |
| EXPECT_TRUE | ( | s2. | intersections3).isEmpty( | ) |
| EXPECT_TRUE | ( | s2. | intersections8).isEmpty( | ) |
| EXPECT_TRUE | ( | s2. | intersectss4 | ) |
| EXPECT_TRUE | ( | s2. | intersectss7 | ) |
| EXPECT_TRUE | ( | s3. | isEmpty() | ) |
| Segment< int > const expected | ( | - | 3, |
| 3 | |||
| ) |
| Segment< int > const expected | ( | 3 | , |
| 2 | |||
| ) |
| Segment< int > const expected | ( | 35 | , |
| 15 | |||
| ) |
| void intersectsImpliesNonEmptyIntersection | ( | const Scaffold & | a, |
| const Scaffold & | b | ||
| ) |

| Scaffold orig | ( | 2 | , |
| 5 | |||
| ) |
Referenced by Scroom::ColormapImpl::ColormapProvider::ColormapProvider().

| s reduceSizeToMultipleOf | ( | 3 | ) |
| s reduceSizeToMultipleOf | ( | 5 | ) |
| Scaffold s | ( | 2 | , |
| 10 | |||
| ) |
| Scaffold s2 | ( | - | 1, |
| 3 | |||
| ) |
| Scaffold s2 | ( | 2 | , |
| 5 | |||
| ) |
| Scaffold s3 | ( | - | 3, |
| 2 | |||
| ) |
| Scaffold s4 | ( | - | 2, |
| 2 | |||
| ) |
| Scaffold s4 | ( | 2 | , |
| 5 | |||
| ) |
| Scaffold s5 | ( | - | 1, |
| 2 | |||
| ) |
| Scaffold s5 | ( | 3 | , |
| 5 | |||
| ) |
| Scaffold s6 | ( | 0 | , |
| 2 | |||
| ) |
| Scaffold s6 | ( | 2 | , |
| 6 | |||
| ) |
| Scaffold s7 | ( | 1 | , |
| 2 | |||
| ) |
| Scaffold s7 | ( | 7 | , |
| - | 5 | ||
| ) |
| Scaffold s8 | ( | 2 | , |
| 2 | |||
| ) |
| TYPED_TEST_SUITE | ( | Rectangle_and_Segment_TypedTests | , |
| ScaffoldTypes | |||
| ) |
| Segment< int > const expected(3, 2) | ( | 12 | , |
| 3 | |||
| ) |
| const GdkRectangle grect = rect.toGdkRectangle() |
| const auto rect = Rectangle<int>(original) |
Referenced by PipetteHandler::computeValues(), anonymous_namespace{determine-size-test.cc}::PresentationInterfaceStub::create(), anonymous_namespace{determine-size-test.cc}::ResizablePresentationInterfaceStub::create(), Scroom::GtkHelpers::createCairoIntRectangle(), anonymous_namespace{sizedeterminer.cc}::DetermineSize(), PipetteHandler::displayValues(), TiledBitmap::drawTile(), anonymous_namespace{determine-size-test.cc}::PresentationInterfaceStub::getRect(), View::on_configure(), on_configure(), Scroom::Pnm::open(), View::redraw(), TestData::redraw(), and SizeDeterminer::sendUpdates().
| Segment<int> const result = 0.5 * make_rect(1, 3, 5, 7) |
| Segment< int > const right(3, 7) | ( | 3 | , |
| 7 | |||
| ) |
Referenced by anonymous_namespace{pnmsource.cc}::approx(), anonymous_namespace{tiffsource.cc}::approx(), anonymous_namespace{sizedeterminer.cc}::DetermineSize(), anonymous_namespace{transparentoverlaypresentation.cc}::ColorComparer::operator()(), Scroom::Utils::operator*(), Scroom::Utils::operator*(), Scroom::Utils::operator*(), Scroom::Utils::operator+(), Scroom::Utils::operator-(), Scroom::Utils::operator-(), Scroom::Utils::operator/(), Scroom::Utils::operator/(), Scroom::Utils::operator/(), operator==(), operator==(), operator==(), and TiledBitmap::redraw().
| Scaffold s = orig.moveTo(5) |
| Scaffold s1 |
| Scaffold s3 |