|
UEFIStarter
a simple UEFI framework
|
Assertions and utilities for graphics tests. More...
#include <Library/BaseMemoryLib.h>#include <UEFIStarter/core/string.h>#include <UEFIStarter/tests/graphics.h>#include <UEFIStarter/tests/asserts.h>Functions | |
| void | reset_bounding_box (bounding_box_t *box) |
| Initializes a bounding box. More... | |
| void | reset_graphics_difftest (graphics_difftest_t *difftest) |
| Resets a graphics difference test. More... | |
| void | init_graphics_difftest_ex (graphics_difftest_t *difftest, INTN width, INTN height, UINT32 bgcol) |
| Initializes a graphics difference test. More... | |
| void | init_graphics_difftest (graphics_difftest_t *difftest, INTN width, INTN height) |
| Initializes a default graphics difference test. More... | |
| void | destroy_graphics_difftest (graphics_difftest_t *difftest) |
| Destroys a graphics difference test structure. More... | |
| void | find_bounding_box_for_changes (graphics_difftest_t *difftest) |
| Compares "before" and "after" images of a difference test and determines the bounding box changes happened in. More... | |
| void | assert_box_equals (bounding_box_t *box, INTN left, INTN top, INTN right, INTN bottom, CHAR16 *message) |
| Asserts a bounding box matches expected values. More... | |
| void | assert_differences_within_box (graphics_difftest_t *difftest, INTN min_width, INTN max_width, INTN min_height, INTN max_height, CHAR16 *message) |
| Asserts the bounding box of changes is within given ranges of width and height. More... | |
Assertions and utilities for graphics tests.
Some of the graphics tests work by looking for changes between two images, then asserting whether those changes are within a given rectangular region, the bounding box.
| void reset_bounding_box | ( | bounding_box_t * | box | ) |
Initializes a bounding box.
| box | the bounding box to reset |
| void reset_graphics_difftest | ( | graphics_difftest_t * | difftest | ) |
Resets a graphics difference test.
Initializes the expected bounding box and resets the "after" image.
| difftest | the difference test to reset |
| void init_graphics_difftest_ex | ( | graphics_difftest_t * | difftest, |
| INTN | width, | ||
| INTN | height, | ||
| UINT32 | bgcol | ||
| ) |
Initializes a graphics difference test.
| difftest | the difference test to reset |
| width | the compared images' width |
| height | the compared images' height |
| bgcol | the background color to paint "before" and "after" images with |
| void init_graphics_difftest | ( | graphics_difftest_t * | difftest, |
| INTN | width, | ||
| INTN | height | ||
| ) |
Initializes a default graphics difference test.
| difftest | the difference test to reset |
| width | the compared images' width |
| height | the compared images' height |
| void destroy_graphics_difftest | ( | graphics_difftest_t * | difftest | ) |
Destroys a graphics difference test structure.
| difftest | the difference test to destroy |
| void find_bounding_box_for_changes | ( | graphics_difftest_t * | difftest | ) |
Compares "before" and "after" images of a difference test and determines the bounding box changes happened in.
| difftest | the difference test to update |
| void assert_box_equals | ( | bounding_box_t * | box, |
| INTN | left, | ||
| INTN | top, | ||
| INTN | right, | ||
| INTN | bottom, | ||
| CHAR16 * | message | ||
| ) |
Asserts a bounding box matches expected values.
| box | the actual bounding box |
| left | the expected left coordinate |
| top | the expected top coordinate |
| right | the expected right coordinate |
| bottom | the expected bottom coordinate |
| message | a descriptive message of what's being tested |
| void assert_differences_within_box | ( | graphics_difftest_t * | difftest, |
| INTN | min_width, | ||
| INTN | max_width, | ||
| INTN | min_height, | ||
| INTN | max_height, | ||
| CHAR16 * | message | ||
| ) |
Asserts the bounding box of changes is within given ranges of width and height.
| difftest | the difference test to check |
| min_width | the smallest allowed bounding box width |
| max_width | the largest allowed bounding box width |
| min_height | the smallest allowed bounding box height |
| max_height | the largest allowed bounding box height |
| message | a descriptive message of what's being tested |
1.8.13