tests: mark styles as done after use

This commit is contained in:
Vaxry 2024-03-11 21:06:13 +00:00
parent 0631da05fc
commit 0cbf601229
2 changed files with 7 additions and 2 deletions

View file

@ -26,6 +26,7 @@ int main(int argc, char** argv) {
int ret = cairo_surface_write_to_png(data[0]->surface, "/tmp/arrowC.png");
hyprcursor_cursor_image_data_free(data, dataSize);
hyprcursor_style_done(mgr, info);
if (ret) {
printf("cairo failed\n");

View file

@ -4,14 +4,16 @@
int main(int argc, char** argv) {
Hyprcursor::CHyprcursorManager mgr(nullptr);
Hyprcursor::SCursorStyleInfo style{.size = 48};
// preload size 48 for testing
if (!mgr.loadThemeStyle(Hyprcursor::SCursorStyleInfo{.size = 48})) {
if (!mgr.loadThemeStyle(style)) {
std::cout << "failed loading style\n";
return 1;
}
// get cursor for left_ptr
const auto SHAPEDATA = mgr.getShape("left_ptr", Hyprcursor::SCursorStyleInfo{.size = 48});
const auto SHAPEDATA = mgr.getShape("left_ptr", style);
if (SHAPEDATA.images.empty()) {
std::cout << "no images\n";
@ -25,6 +27,8 @@ int main(int argc, char** argv) {
std::cout << "Cairo returned for write: " << RET << "\n";
mgr.cursorSurfaceStyleDone(style);
if (RET)
return 1;