Revision: 54076
http://brlcad.svn.sourceforge.net/brlcad/?rev=54076&view=rev
Author: caen23
Date: 2012-12-17 18:57:51 +0000 (Mon, 17 Dec 2012)
Log Message:
-----------
Move test_density.c into a tests/ directory (GCI:
http://www.google-melange.com/gci/task/view/google/gci2012/7986225)
Modified Paths:
--------------
brlcad/trunk/src/libanalyze/CMakeLists.txt
Added Paths:
-----------
brlcad/trunk/src/libanalyze/tests/
brlcad/trunk/src/libanalyze/tests/CMakeLists.txt
brlcad/trunk/src/libanalyze/tests/density.c
Removed Paths:
-------------
brlcad/trunk/src/libanalyze/test_density.c
Modified: brlcad/trunk/src/libanalyze/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libanalyze/CMakeLists.txt 2012-12-17 18:46:30 UTC (rev
54075)
+++ brlcad/trunk/src/libanalyze/CMakeLists.txt 2012-12-17 18:57:51 UTC (rev
54076)
@@ -13,10 +13,11 @@
)
#BRLCAD_ADDEXEC(test_density test_density.c "libanalyze;libbu" NO_INSTALL)
+add_subdirectory(tests)
BRLCAD_ADDLIB(libanalyze "${LIBANALYZE_SOURCES}" "libbu;librt")
SET_TARGET_PROPERTIES(libanalyze PROPERTIES VERSION 20.0.1 SOVERSION 20)
-CMAKEFILES(Makefile.am test_density.c)
+CMAKEFILES(Makefile.am)
# Local Variables:
# tab-width: 8
Deleted: brlcad/trunk/src/libanalyze/test_density.c
===================================================================
--- brlcad/trunk/src/libanalyze/test_density.c 2012-12-17 18:46:30 UTC (rev
54075)
+++ brlcad/trunk/src/libanalyze/test_density.c 2012-12-17 18:57:51 UTC (rev
54076)
@@ -1,70 +0,0 @@
-/* T E S T _ D E N S I T Y . C
- * BRL-CAD
- *
- * Copyright (c) 2011-2012 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 <sys/stat.h>
-#include "analyze.h"
-
-int
-main(int argc, char **argv)
-{
- struct density_entry *densities = NULL;
- static int num_densities = 1028;
-
- struct stat sb;
- FILE *fp = (FILE *)NULL;
- char *buf = NULL;
- int ret = 0;
- int i;
-
- if (argc < 2) {
- bu_log("Error - please supply density file\n");
- bu_exit(EXIT_FAILURE, NULL);
- }
-
- fp = fopen(argv[1], "rb");
- if (fp == (FILE *)NULL) {
- bu_log("Error - file %s not opened\n", argv[1]);
- bu_exit(EXIT_FAILURE, NULL);
- }
-
- if (stat(argv[1], &sb)) {
- bu_log("Error - file %s not stat successfully\n", argv[1]);
- bu_exit(EXIT_FAILURE, NULL);
- }
-
- buf = bu_malloc(sb.st_size+1, "density buffer");
- ret = fread(buf, sb.st_size, 1, fp);
- if (ret != 1) {
- bu_log("Error reading file %s\n", argv[1]);
- bu_exit(EXIT_FAILURE, NULL);
- }
-
- densities = bu_calloc(num_densities, sizeof(struct density_entry), "density
entries");
-
- ret = parse_densities_buffer(buf, (unsigned long)sb.st_size, densities,
NULL, &num_densities);
-
- for (i = 0; i < num_densities; i++) {
- if (densities[i].name)
- bu_log("densities[%i]: %s, %d\n", i, densities[i].name,
densities[i].grams_per_cu_mm);
- }
-
-}
Added: brlcad/trunk/src/libanalyze/tests/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libanalyze/tests/CMakeLists.txt
(rev 0)
+++ brlcad/trunk/src/libanalyze/tests/CMakeLists.txt 2012-12-17 18:57:51 UTC
(rev 54076)
@@ -0,0 +1,8 @@
+BRLCAD_ADDEXEC(tester_density density.c "libanalyze;libbu" NO_INSTALL LOCAL)
+
+# Local Variables:
+# tab-width: 8
+# mode: cmake
+# indent-tabs-mode: t
+# End:
+# ex: shiftwidth=2 tabstop=8 textwidth=0 wrapmargin=0
Property changes on: brlcad/trunk/src/libanalyze/tests/CMakeLists.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: brlcad/trunk/src/libanalyze/tests/density.c
===================================================================
--- brlcad/trunk/src/libanalyze/tests/density.c (rev 0)
+++ brlcad/trunk/src/libanalyze/tests/density.c 2012-12-17 18:57:51 UTC (rev
54076)
@@ -0,0 +1,70 @@
+/* T E S T _ D E N S I T Y . C
+ * BRL-CAD
+ *
+ * Copyright (c) 2011-2012 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 <sys/stat.h>
+#include "analyze.h"
+
+int
+main(int argc, char **argv)
+{
+ struct density_entry *densities = NULL;
+ static int num_densities = 1028;
+
+ struct stat sb;
+ FILE *fp = (FILE *)NULL;
+ char *buf = NULL;
+ int ret = 0;
+ int i;
+
+ if (argc < 2) {
+ bu_log("Error - please supply density file\n");
+ bu_exit(EXIT_FAILURE, NULL);
+ }
+
+ fp = fopen(argv[1], "rb");
+ if (fp == (FILE *)NULL) {
+ bu_log("Error - file %s not opened\n", argv[1]);
+ bu_exit(EXIT_FAILURE, NULL);
+ }
+
+ if (stat(argv[1], &sb)) {
+ bu_log("Error - file %s not stat successfully\n", argv[1]);
+ bu_exit(EXIT_FAILURE, NULL);
+ }
+
+ buf = bu_malloc(sb.st_size+1, "density buffer");
+ ret = fread(buf, sb.st_size, 1, fp);
+ if (ret != 1) {
+ bu_log("Error reading file %s\n", argv[1]);
+ bu_exit(EXIT_FAILURE, NULL);
+ }
+
+ densities = bu_calloc(num_densities, sizeof(struct density_entry), "density
entries");
+
+ ret = parse_densities_buffer(buf, (unsigned long)sb.st_size, densities,
NULL, &num_densities);
+
+ for (i = 0; i < num_densities; i++) {
+ if (densities[i].name)
+ bu_log("densities[%i]: %s, %f\n", i, densities[i].name,
densities[i].grams_per_cu_mm);
+ }
+
+}
Property changes on: brlcad/trunk/src/libanalyze/tests/density.c
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits