| 431 | end |
| 432 | |
| 433 | def test_4 |
| 434 | |
| 435 | # check if PNG support is compiled in |
| 436 | # TODO: remove this once PNG support is available on all platforms |
| 437 | begin |
| 438 | RBA::PixelBuffer.read_png(File.join($ut_testsrc, "testdata/lay/au_lv1.png")) |
| 439 | rescue => ex |
| 440 | # PNG support missing |
| 441 | puts "WARNING: PNG support not compiled in - skipping test" |
| 442 | return |
| 443 | end |
| 444 | |
| 445 | # standalone image generation (see C++ tests) |
| 446 | lv = RBA::LayoutView::new |
| 447 | lv.set_config("inst-color", "#000000") |
| 448 | lv.set_config("background-color", "#ffffff") |
| 449 | lv.load_layout(File.join($ut_testsrc, "testdata/gds/t10.gds"), true) |
| 450 | |
| 451 | img = lv.get_pixels_with_options(500, 500, 1, 1, 1.0, RBA::DBox::new) |
| 452 | au = RBA::PixelBuffer.read_png(File.join($ut_testsrc, "testdata/lay/au_lv1.png")) |
| 453 | if au |
| 454 | assert_equal(au == img, true) |
| 455 | end |
| 456 | |
| 457 | lv.set_config("full-hierarchy-new-cell", "true") |
| 458 | lv.load_layout(File.join($ut_testsrc, "testdata/gds/t10.gds"), false) |
| 459 | |
| 460 | img = lv.get_pixels_with_options(500, 500, 1, 1, 1.0, RBA::DBox::new) |
| 461 | au = RBA::PixelBuffer.read_png(File.join($ut_testsrc, "testdata/lay/au_lv2.png")) |
| 462 | if au |
| 463 | assert_equal(au == img, true) |
| 464 | end |
| 465 | |
| 466 | img = lv.get_pixels_with_options_mono(500, 500, 1, RBA::DBox::new) |
| 467 | au = RBA::BitmapBuffer.read_png(File.join($ut_testsrc, "testdata/lay/au_lv3.png")) |
| 468 | if au |
| 469 | assert_equal(au == img, true) |
| 470 | end |
| 471 | |
| 472 | end |
| 473 | |
| 474 | def test_5 |
| 475 |
nothing calls this directly
no test coverage detected