-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutest.c
32 lines (27 loc) · 810 Bytes
/
utest.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Funções simples que eu uso para fazer testes
#include <stdio.h>
void println(const char *msg) {
printf("%s\n", msg);
}
void print_erro(const char *error, int esperado, int recebido) {
printf("%s\n", error);
printf(" Valor esperado: %d\n", esperado);
printf(" Valor recebido: %d\n", recebido);
}
void print_array_int(int *lista, int len) {
for (int i = 0; i < len; i++)
printf("%d ", lista[i]);
}
// 1 = listas iguals
// 0 = listas diferentes
int compListas(int *lista1, int *lista2, int len) {
for (int i = 0; i < len; i++) {
int v1 = lista1[i];
int v2 = lista2[i];
// printf("Valor Lista 1 - %d\n", v1);
// printf("Valor Lista 2 - %d\n", v2);
if (v1 != v2)
return 0;
}
return 1;
}