Harness: teste de regressao ao arrastar bloco da Caneta para o chapeu

This commit is contained in:
mguinhos committed 2026-10-20 20:05:58 -03:00
1 parent f37884ccdf
commit f616503caa
3 files changed
+1094

No files matched your search

+18
View File
@@ -345,6 +345,24 @@ int main(void) {
CHECK(any_has("Exportado xml"), "exportar XML pelo menu escreve o arquivo");
remove(expf);
/* 15. Regressao: arrastar um bloco da Caneta para o chapeu */
if (need("Caneta", R_CAT, 0, &x, &y)) click(x, y);
frame(0, 0, 0, 0, 0, 0, NULL);
int clear_before = 0;
{ float a, b; for (int k = 0; find("apague tudo", R_WS, k, &a, &b); k++) clear_before++; }
if (need("apague tudo", R_FLY, 0, &x, &y)) {
float hx, hy;
if (need("quando a bandeira for clicado", R_WS, 0, &hx, &hy)) {
float bx = hx - 3 - 10, by = hy - 18 - 18;
float gx = x - 3 - 10, gy = y - 18;
drag(x, y, x + (bx - gx), y + (by + 54 - gy) + 6);
}
}
frame(0, 0, 0, 0, 0, 0, NULL);
int clear_after = 0;
{ float a, b; for (int k = 0; find("apague tudo", R_WS, k, &a, &b); k++) clear_after++; }
CHECK(clear_after == clear_before + 1, "arrastar bloco da Caneta para o chapeu");
printf("comandos de desenho no último frame: %u\n", ncmd);
tinyblocks_deinit(&rt);
printf(fails ? "\n%d FALHA(S)\n" : "\nTUDO OK\n", fails);