2009-04-12 17:48:03 +04:00
|
|
|
//
|
|
|
|
// Unit tests for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2022-02-19 14:55:06 +03:00
|
|
|
// Copyright 1998-2022 by Bill Spitzak and others.
|
2009-04-12 17:48:03 +04:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
2009-04-12 17:48:03 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/COPYING.php
|
2009-04-12 17:48:03 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// Please see the following page on how to report bugs and issues:
|
2009-04-12 17:48:03 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/bugs.php
|
2009-04-12 17:48:03 +04:00
|
|
|
//
|
|
|
|
|
2022-02-06 17:22:24 +03:00
|
|
|
#include "unittests.h"
|
|
|
|
|
2009-04-12 17:48:03 +04:00
|
|
|
#include <FL/Fl_Help_View.H>
|
|
|
|
|
|
|
|
//
|
|
|
|
//------- Introduction to FLTK drawing test -------
|
|
|
|
//
|
2022-12-17 15:16:57 +03:00
|
|
|
class Ut_About_View : public Fl_Help_View {
|
2009-04-12 17:48:03 +04:00
|
|
|
public:
|
|
|
|
static Fl_Widget *create() {
|
2022-12-17 15:16:57 +03:00
|
|
|
return new Ut_About_View(UT_TESTAREA_X, UT_TESTAREA_Y, UT_TESTAREA_W, UT_TESTAREA_H);
|
2009-04-12 17:48:03 +04:00
|
|
|
}
|
2022-12-17 15:16:57 +03:00
|
|
|
Ut_About_View(int x, int y, int w, int h) : Fl_Help_View(x, y, w, h) {
|
2009-04-12 17:48:03 +04:00
|
|
|
value(
|
|
|
|
"<htmL><body><h2>About Unit Testing...</h2>\n"
|
2009-07-01 19:47:45 +04:00
|
|
|
"The Unit Testing application can be used to verify correct graphics rendering "
|
2009-06-30 17:57:45 +04:00
|
|
|
"on the current platform. The core developer team uses this program to make sure that the "
|
2009-07-01 19:47:45 +04:00
|
|
|
"FLTK user experience is identical on all supported graphics systems."
|
2022-02-19 14:55:06 +03:00
|
|
|
"<h3>The UI Designer</h3>\n"
|
2009-04-12 17:48:03 +04:00
|
|
|
"<p>Designing a good user interface is an art. Widgets must be selected and carefully positioned "
|
|
|
|
"to create a consistent look and feel for the user. Text must fit into given boxes and graphic "
|
2009-07-01 19:47:45 +04:00
|
|
|
"elements must be correctly aligned. A good UI library will give consistent results on any "
|
2009-04-12 17:48:03 +04:00
|
|
|
"supported platform and render all graphics in the way the UI designer intended.</p>\n"
|
|
|
|
"<p>FLTK supports a large collection of platforms and graphics drivers. This unit testing "
|
|
|
|
"application contains modules which will test rendering and alignment for most "
|
|
|
|
"FLTK core graphics functions.</p>\n"
|
2022-02-19 14:55:06 +03:00
|
|
|
"<h3>The Developer</h3>\n"
|
2009-04-12 17:48:03 +04:00
|
|
|
"<p>Unittest is also a great help when implementing new graphics drivers. The tests are sorted "
|
|
|
|
"in the same order in which a new graphics driver could be implemented. Most tests rely "
|
|
|
|
"on the previous test to function correctly, so sticking to the given order is a good idea.</p>\n"
|
|
|
|
"<h3>Conventions</h3>\n"
|
2009-07-01 19:47:45 +04:00
|
|
|
"<p>Two layers of graphics are drawn for most tests. The lower layer contains "
|
2009-04-12 17:48:03 +04:00
|
|
|
"red and green pixels. The upper layer contains black pixels. The test is rendered correctly "
|
|
|
|
"if all red pixels are covered, but none of the green pixels. The top graphics layer can be "
|
|
|
|
"switched on and off.</p>"
|
|
|
|
"</body></html>");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-12-17 15:16:57 +03:00
|
|
|
UnitTest about(UT_TEST_ABOUT, "About...", Ut_About_View::create);
|