cristobal ladron
This commit is contained in:
@@ -4,7 +4,7 @@ LDFLAGS=-lm
|
||||
SRC=test.c
|
||||
OBJ=$(SRC:.c=.o)
|
||||
|
||||
OBJ+=../src/read_file.o ../src/distance.o ../src/brute_force.o
|
||||
OBJ+=../src/read_file.o ../src/distance.o ../src/brute_force.o ../src/divide_and_conquer.o
|
||||
|
||||
all: test
|
||||
|
||||
|
||||
19
test/test.c
19
test/test.c
@@ -22,6 +22,7 @@
|
||||
#include "points.h"
|
||||
#include "read_file.h"
|
||||
#include "brute_force.h"
|
||||
#include "divide_and_conquer.h"
|
||||
|
||||
/**
|
||||
* Comparar 2 double para ver si son casi igual
|
||||
@@ -81,6 +82,24 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (failed > 0) {
|
||||
fprintf(stdout, "\tdivide and conquer: failed\n");
|
||||
failed++;
|
||||
}
|
||||
else {
|
||||
fprintf(stdout, "\tdivide and conquer: ");
|
||||
fflush(stdout);
|
||||
divide_and_conquer(points, n, &dist);
|
||||
if (compare_double(dist, 0.067687840)) {
|
||||
fprintf(stdout, "passed\n");
|
||||
passed++;
|
||||
}
|
||||
else {
|
||||
fprintf(stdout, "failed\n");
|
||||
failed++;
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stdout, "%d tests passed\n", passed);
|
||||
fprintf(stdout, "%d tests failed\n", failed);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user