Ticket #11971: bug.cc

File bug.cc, 658 bytes (added by lopresti@…, 7 years ago)

Test case demonstrating bug

Line 
1#include <boost/polygon/polygon.hpp>
2#include <stdint.h>
3#include <assert.h>
4#include <limits>
5
6namespace bp = boost::polygon;
7
8typedef int32_t Coord;
9typedef bp::polygon_set_data<Coord> PSet;
10typedef bp::rectangle_data<Coord> Rect;
11
12int
13main()
14{
15 using namespace bp::operators;
16
17 PSet ps1;
18 ps1.insert(Rect(0, 0, 1, 1));
19
20 Coord low = std::numeric_limits<Coord>::min();
21 Coord high = std::numeric_limits<Coord>::max(); // fails
22
23 //Coord high = std::numeric_limits<Coord>::max()-100; // also fails
24 //Coord high = std::numeric_limits<Coord>::max()/2; // works
25
26 PSet ps2 = ps1 & Rect(low, low, high, high);
27 assert(ps1 == ps2);
28}