Revision: 74242
http://sourceforge.net/p/brlcad/code/74242
Author: starseeker
Date: 2019-10-25 17:31:02 +0000 (Fri, 25 Oct 2019)
Log Message:
-----------
rename test file
Modified Paths:
--------------
brlcad/trunk/src/libbg/tests/CMakeLists.txt
Added Paths:
-----------
brlcad/trunk/src/libbg/tests/tri_closest_pt.c
Removed Paths:
-------------
brlcad/trunk/src/libbg/tests/tri_pt_dist.c
Modified: brlcad/trunk/src/libbg/tests/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libbg/tests/CMakeLists.txt 2019-10-25 17:28:15 UTC (rev
74241)
+++ brlcad/trunk/src/libbg/tests/CMakeLists.txt 2019-10-25 17:31:02 UTC (rev
74242)
@@ -103,12 +103,12 @@
add_test(NAME bg_tri_tri_isect_null COMMAND bg_tri_tri_isect 0,0,0 1,0,0
1,1,0 1,0,1 1,0,1 1,1,1 0)
-# ************ tri_pt_dist.c tests ***********
+# ************ tri_closest_pt.c tests ***********
-BRLCAD_ADDEXEC(bg_tri_pt_dist tri_pt_dist.c "libbg;libbn;libbu" TEST)
+BRLCAD_ADDEXEC(bg_tri_closest_pt tri_closest_pt.c "libbg;libbn;libbu" TEST)
-add_test(NAME bg_tri_pt_dist_coplanar_center COMMAND bg_tri_pt_dist 0,0,0
-1,-1,0 1,-1,0 0,1,0 0)
-add_test(NAME bg_tri_pt_dist_coplanar_vert_closest COMMAND bg_tri_pt_dist
-2,-1,0 -1,-1,0 1,-1,0 0,1,0 1)
+add_test(NAME bg_tri_pt_dist_coplanar_center COMMAND bg_tri_closest_pt
0,0,0 -1,-1,0 1,-1,0 0,1,0 0)
+add_test(NAME bg_tri_pt_dist_coplanar_vert_closest COMMAND bg_tri_closest_pt
-2,-1,0 -1,-1,0 1,-1,0 0,1,0 1)
# ************ trimesh_pt_in.cpp tests ***********
Copied: brlcad/trunk/src/libbg/tests/tri_closest_pt.c (from rev 74241,
brlcad/trunk/src/libbg/tests/tri_pt_dist.c)
===================================================================
--- brlcad/trunk/src/libbg/tests/tri_closest_pt.c
(rev 0)
+++ brlcad/trunk/src/libbg/tests/tri_closest_pt.c 2019-10-25 17:31:02 UTC
(rev 74242)
@@ -0,0 +1,78 @@
+/* T R I _ P T _ D I S T . C
+ * BRL-CAD
+ *
+ * Copyright (c) 2011-2019 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+
+#include "common.h"
+
+#include <stdio.h>
+
+#include "bu.h"
+#include "bg.h"
+
+
+int
+main(int argc, char **argv)
+{
+ int expected_result = 0;
+ int actual_result = 0;
+ float f1, f2, f3 = 0.0;
+ point_t V0 = VINIT_ZERO;
+ point_t V1 = VINIT_ZERO;
+ point_t V2 = VINIT_ZERO;
+ point_t TP = VINIT_ZERO;
+
+ if (argc != 6)
+ bu_exit(1, "ERROR: [%s] input format is TPx,TPy,TPz V0x,V0y,V0z
V1x,V1y,V1z V2x,V2y,V2z expected_result\n", argv[0]);
+
+ sscanf(argv[1], "%f,%f,%f", &f1, &f2, &f3);
+ VSET(TP, f1, f2, f3);
+
+ sscanf(argv[2], "%f,%f,%f", &f1, &f2, &f3);
+ VSET(V0, f1, f2, f3);
+
+ sscanf(argv[3], "%f,%f,%f", &f1, &f2, &f3);
+ VSET(V1, f1, f2, f3);
+
+ sscanf(argv[4], "%f,%f,%f", &f1, &f2, &f3);
+ VSET(V2, f1, f2, f3);
+
+ sscanf(argv[5], "%d", &expected_result);
+
+ actual_result = bg_tri_closest_pt(NULL, TP, V0, V1, V2);
+
+ bu_log("result: %d\n", actual_result);
+
+ if (NEAR_EQUAL(expected_result, actual_result, SMALL_FASTF)) {
+ return 0;
+ }
+
+ return -1;
+}
+
+
+/** @} */
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Deleted: brlcad/trunk/src/libbg/tests/tri_pt_dist.c
===================================================================
--- brlcad/trunk/src/libbg/tests/tri_pt_dist.c 2019-10-25 17:28:15 UTC (rev
74241)
+++ brlcad/trunk/src/libbg/tests/tri_pt_dist.c 2019-10-25 17:31:02 UTC (rev
74242)
@@ -1,78 +0,0 @@
-/* T R I _ P T _ D I S T . C
- * BRL-CAD
- *
- * Copyright (c) 2011-2019 United States Government as represented by
- * the U.S. Army Research Laboratory.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this file; see the file named COPYING for more
- * information.
- */
-
-#include "common.h"
-
-#include <stdio.h>
-
-#include "bu.h"
-#include "bg.h"
-
-
-int
-main(int argc, char **argv)
-{
- int expected_result = 0;
- int actual_result = 0;
- float f1, f2, f3 = 0.0;
- point_t V0 = VINIT_ZERO;
- point_t V1 = VINIT_ZERO;
- point_t V2 = VINIT_ZERO;
- point_t TP = VINIT_ZERO;
-
- if (argc != 6)
- bu_exit(1, "ERROR: [%s] input format is TPx,TPy,TPz V0x,V0y,V0z
V1x,V1y,V1z V2x,V2y,V2z expected_result\n", argv[0]);
-
- sscanf(argv[1], "%f,%f,%f", &f1, &f2, &f3);
- VSET(TP, f1, f2, f3);
-
- sscanf(argv[2], "%f,%f,%f", &f1, &f2, &f3);
- VSET(V0, f1, f2, f3);
-
- sscanf(argv[3], "%f,%f,%f", &f1, &f2, &f3);
- VSET(V1, f1, f2, f3);
-
- sscanf(argv[4], "%f,%f,%f", &f1, &f2, &f3);
- VSET(V2, f1, f2, f3);
-
- sscanf(argv[5], "%d", &expected_result);
-
- actual_result = bg_tri_closest_pt(NULL, TP, V0, V1, V2);
-
- bu_log("result: %d\n", actual_result);
-
- if (NEAR_EQUAL(expected_result, actual_result, SMALL_FASTF)) {
- return 0;
- }
-
- return -1;
-}
-
-
-/** @} */
-/*
- * Local Variables:
- * mode: C
- * tab-width: 8
- * indent-tabs-mode: t
- * c-file-style: "stroustrup"
- * End:
- * ex: shiftwidth=4 tabstop=8
- */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits