Index: include/test_utils.h
===================================================================
--- include/test_utils.h	(revision 0)
+++ include/test_utils.h	(working copy)
@@ -0,0 +1,57 @@
+/*                       T E S T _ U T I L S . H
+ * BRL-CAD
+ *
+ * Copyright (c) 2014 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.
+ */
+/** @file test_utils.h
+ *
+ * Common utility macros used by various different tests.
+ *
+ */
+#ifndef TEST_UTILS_H
+#define TEST_UTILS_H
+
+#define TEST_ARGV_EMPTY_STR "#EMPTY"
+
+#define TEST_ARGV(argc, argv) do {					\
+	int _i, _n = 0;							\
+	for (_i = 0; _i < argc; _i++) {					\
+	    if (argv[_i] == NULL) {					\
+		_n = -1;						\
+		break;							\
+	    }								\
+	    if (bu_strcmp(argv[_i], TEST_ARGV_EMPTY_STR) == 0) {	\
+		argv[_i] = "";						\
+		_n++;							\
+	    }								\
+	}								\
+	if (_n < 0) {							\
+	    bu_exit(1, "ERROR: error parsing args.\n");			\
+	}								\
+    } while (0)
+
+#endif /* TEST_UTILS_H */
+
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Index: src/libbu/tests/bitv-tests.cmake
===================================================================
--- src/libbu/tests/bitv-tests.cmake	(revision 63699)
+++ src/libbu/tests/bitv-tests.cmake	(working copy)
@@ -78,13 +78,11 @@
 add_test(bu_binstr_to_hexstr_test1 tester_bu_bitv 13        " 0011"    "03")
 add_test(bu_binstr_to_hexstr_test2 tester_bu_bitv 13   "0b0000011 "  "0x03")
 add_test(bu_binstr_to_hexstr_test3 tester_bu_bitv 13   "0b000 0011"  "0x03")
+add_test(bu_binstr_to_hexstr_test4 tester_bu_bitv 13       "#EMPTY"    "00")
 add_test(bu_binstr_to_hexstr_test5 tester_bu_bitv 13           "0b"  "0x00")
 add_test(bu_binstr_to_hexstr_test6 tester_bu_bitv 13   "0b000_0011"  "0x03")
 add_test(bu_binstr_to_hexstr_test7 tester_bu_bitv 13   "0b000|0011"  "0x03")
 
-# args: function number, expected hex string - tests null input case
-add_test(bu_binstr_to_hexstr_test4 tester_bu_bitv 14                   "00")
-
 # some tests are expected to fail:
 set_tests_properties(
   bu_binary_to_bitv_07
Index: src/libbu/tests/bu_bitv.c
===================================================================
--- src/libbu/tests/bu_bitv.c	(revision 63699)
+++ src/libbu/tests/bu_bitv.c	(working copy)
@@ -25,6 +25,7 @@
 #include <string.h>
 
 #include "bu.h"
+#include "test_utils.h"
 #include "../bu_internals.h"
 #include "./test_internals.h"
 
@@ -772,44 +773,7 @@
     return test_results;
 }
 
-
 static int
-test_bu_binstr_to_hexstr_empty_input(int argc, char **argv)
-{
-    /*         argv[1]    ""                    argv[2]
-     * inputs: <func num> <input binary string> <expected hex string>
-     */
-    int test_results = CTEST_FAIL;
-    const char *input = "";
-    const char *expected;
-    struct bu_vls v = BU_VLS_INIT_ZERO;
-
-    if (argc < 3)
-	bu_exit(1, "ERROR: input format: function_num function_test_args [%s]\n", argv[0]);
-
-    expected = argv[2];
-
-    bu_binstr_to_hexstr(input, &v);
-
-    if (BU_STR_EQUAL(expected, bu_vls_cstr(&v))) {
-	test_results = CTEST_PASS;
-	printf("\nbu_binstr_to_hexstr PASSED");
-    } else {
-	test_results = CTEST_FAIL;
-	printf("\nbu_binstr_to_hexstr FAILED");
-    }
-
-    printf("\n  Input:    '%s'", input);
-    printf("\n  Output:   '%s'", bu_vls_cstr(&v));
-    printf("\n  Expected: '%s'", expected);
-
-    bu_vls_free(&v);
-
-    return test_results;
-}
-
-
-static int
 test_bu_hexstr_to_binstr(int argc, char **argv)
 {
     /*         argv[1]    argv[2]            argv[3]
@@ -854,6 +818,8 @@
 	bu_exit(1, "ERROR: input format is function_num function_test_args [%s]\n", argv[0]);
     }
 
+    TEST_ARGV(argc, argv);
+
     sscanf(argv[1], "%d", &function_num);
 
     switch (function_num) {
@@ -898,8 +864,6 @@
 	    break;
         case 13:
 	    return test_bu_binstr_to_hexstr(argc, argv);
-	case 14:
-	    return test_bu_binstr_to_hexstr_empty_input(argc, argv);
 	    break;
 
     }
Index: src/libbu/tests/CMakeLists.txt
===================================================================
--- src/libbu/tests/CMakeLists.txt	(revision 63699)
+++ src/libbu/tests/CMakeLists.txt	(working copy)
@@ -46,7 +46,7 @@
 #################################
 BRLCAD_ADDEXEC(tester_bu_booleanize bu_booleanize.c libbu NO_INSTALL)
 add_test(bu_booleanize_null         tester_bu_booleanize) # tests NULL
-add_test(bu_booleanize_empty        tester_bu_booleanize "")
+add_test(bu_booleanize_empty        tester_bu_booleanize "#EMPTY")
 add_test(bu_booleanize_n            tester_bu_booleanize "n")
 add_test(bu_booleanize_nabcd        tester_bu_booleanize "nabcd")
 add_test(bu_booleanize_N            tester_bu_booleanize "N")
@@ -109,7 +109,7 @@
 add_test(bu_dirname__period__period_ tester_bu_dirname "..")
 add_test(bu_dirname__period__period__period_ tester_bu_dirname "...")
 add_test(bu_dirname__sp__sp__sp_ tester_bu_dirname "   ")
-add_test(bu_dirname_empty tester_bu_dirname "")
+add_test(bu_dirname_empty tester_bu_dirname "#EMPTY")
 add_test(bu_dirname_null tester_bu_dirname)
 
 #
@@ -305,7 +305,7 @@
 
 add_test(bu_strlcatm_valid_1 tester_bu_str 1 "abc" "def" 7 6 "abcdef")
 add_test(bu_strlcatm_valid_2 tester_bu_str 1 "abc" "def" 8 6 "abcdef")
-add_test(bu_strlcatm_bad_size_1 tester_bu_str 1 "abc" "def" 0 0 "")
+add_test(bu_strlcatm_bad_size_1 tester_bu_str 1 "abc" "def" 0 0 "#EMPTY")
 add_test(bu_strlcatm_bad_size_2 tester_bu_str 1 "abc" "def" 5 4 "abcd")
 
 # For function #2 (bu_strlcpym) the <args> format is as follows:
@@ -319,7 +319,7 @@
 
 add_test(bu_strlcpym_valid_1 tester_bu_str 2 "abcdef" 7 6 "abcdef")
 add_test(bu_strlcpym_valid_2 tester_bu_str 2 "abcdef" 8 6 "abcdef")
-add_test(bu_strlcpym_bad_size_1 tester_bu_str 2 "abcdef" 0 0 "")
+add_test(bu_strlcpym_bad_size_1 tester_bu_str 2 "abcdef" 0 0 "#EMPTY")
 add_test(bu_strlcpym_bad_size_2 tester_bu_str 2 "abcdef" 5 4 "abcd")
 
 # For function #3 (bu_strdupm) the <args> format is as follows:
Index: src/libbu/tests/bitv-tests.cmake
===================================================================
--- src/libbu/tests/bitv-tests.cmake	(revision 63699)
+++ src/libbu/tests/bitv-tests.cmake	(working copy)
@@ -78,13 +78,11 @@
 add_test(bu_binstr_to_hexstr_test1 tester_bu_bitv 13        " 0011"    "03")
 add_test(bu_binstr_to_hexstr_test2 tester_bu_bitv 13   "0b0000011 "  "0x03")
 add_test(bu_binstr_to_hexstr_test3 tester_bu_bitv 13   "0b000 0011"  "0x03")
+add_test(bu_binstr_to_hexstr_test4 tester_bu_bitv 13       "#EMPTY"    "00")
 add_test(bu_binstr_to_hexstr_test5 tester_bu_bitv 13           "0b"  "0x00")
 add_test(bu_binstr_to_hexstr_test6 tester_bu_bitv 13   "0b000_0011"  "0x03")
 add_test(bu_binstr_to_hexstr_test7 tester_bu_bitv 13   "0b000|0011"  "0x03")
 
-# args: function number, expected hex string - tests null input case
-add_test(bu_binstr_to_hexstr_test4 tester_bu_bitv 14                   "00")
-
 # some tests are expected to fail:
 set_tests_properties(
   bu_binary_to_bitv_07
Index: src/libbu/tests/bu_bitv.c
===================================================================
--- src/libbu/tests/bu_bitv.c	(revision 63699)
+++ src/libbu/tests/bu_bitv.c	(working copy)
@@ -25,6 +25,7 @@
 #include <string.h>
 
 #include "bu.h"
+#include "test_utils.h"
 #include "../bu_internals.h"
 #include "./test_internals.h"
 
@@ -772,44 +773,7 @@
     return test_results;
 }
 
-
 static int
-test_bu_binstr_to_hexstr_empty_input(int argc, char **argv)
-{
-    /*         argv[1]    ""                    argv[2]
-     * inputs: <func num> <input binary string> <expected hex string>
-     */
-    int test_results = CTEST_FAIL;
-    const char *input = "";
-    const char *expected;
-    struct bu_vls v = BU_VLS_INIT_ZERO;
-
-    if (argc < 3)
-	bu_exit(1, "ERROR: input format: function_num function_test_args [%s]\n", argv[0]);
-
-    expected = argv[2];
-
-    bu_binstr_to_hexstr(input, &v);
-
-    if (BU_STR_EQUAL(expected, bu_vls_cstr(&v))) {
-	test_results = CTEST_PASS;
-	printf("\nbu_binstr_to_hexstr PASSED");
-    } else {
-	test_results = CTEST_FAIL;
-	printf("\nbu_binstr_to_hexstr FAILED");
-    }
-
-    printf("\n  Input:    '%s'", input);
-    printf("\n  Output:   '%s'", bu_vls_cstr(&v));
-    printf("\n  Expected: '%s'", expected);
-
-    bu_vls_free(&v);
-
-    return test_results;
-}
-
-
-static int
 test_bu_hexstr_to_binstr(int argc, char **argv)
 {
     /*         argv[1]    argv[2]            argv[3]
@@ -854,6 +818,8 @@
 	bu_exit(1, "ERROR: input format is function_num function_test_args [%s]\n", argv[0]);
     }
 
+    TEST_ARGV(argc, argv);
+
     sscanf(argv[1], "%d", &function_num);
 
     switch (function_num) {
@@ -898,8 +864,6 @@
 	    break;
         case 13:
 	    return test_bu_binstr_to_hexstr(argc, argv);
-	case 14:
-	    return test_bu_binstr_to_hexstr_empty_input(argc, argv);
 	    break;
 
     }
Index: src/libbu/tests/bu_str.c
===================================================================
--- src/libbu/tests/bu_str.c	(revision 63699)
+++ src/libbu/tests/bu_str.c	(working copy)
@@ -28,6 +28,8 @@
 
 #include "vmath.h"
 
+#include "test_utils.h"
+
 #define SIGNUM(x) ((x > 0) - (x < 0))
 
 static int
@@ -39,14 +41,6 @@
     int size;
     int len;
 
-    /* CMake won't pass empty strings as test parameters properly;
-     * assume expected_result is supposed to be empty.
-     */
-    if (argc == 6) {
-	expected_result = "";
-	argc++;
-    }
-
     if (argc != 7) {
 	bu_exit(1, "ERROR: input format is string1 string2 result_size expected_ret expected_result [%s]\n", argv[0]);
     }
@@ -81,14 +75,6 @@
     int size;
     int len;
 
-    /* CMake won't pass empty strings as test parameters properly;
-     * assume expected_result is supposed to be empty.
-     */
-    if (argc == 5) {
-	expected_result = "";
-	argc++;
-    }
-
     if (argc != 6) {
 	bu_exit(1, "ERROR: input format is string result_size expected_ret expected_result [%s]\n", argv[0]);
     }
@@ -174,6 +160,8 @@
 	bu_exit(1, "ERROR: input format is function_num function_test_args [%s]\n", argv[0]);
     }
 
+    TEST_ARGV(argc, argv);
+
     sscanf(argv[1], "%d", &function_num);
 
     switch (function_num) {
Index: src/libbu/tests/bu_vls.c
===================================================================
--- src/libbu/tests/bu_vls.c	(revision 63699)
+++ src/libbu/tests/bu_vls.c	(working copy)
@@ -26,6 +26,8 @@
 
 #include "bu.h"
 
+#include "test_utils.h"
+
 #include "./vls_internals.h"
 #include "./test_internals.h"
 
@@ -641,14 +643,6 @@
     struct bu_vls vsubstr       = BU_VLS_INIT_ZERO;
     int test_results            = CTEST_FAIL;
 
-    /* CMake won't pass empty strings as test parameters properly;
-     * assume expected_result is supposed to be empty.
-     */
-    if (argc == 5) {
-	expected_result = "";
-	argc++;
-    }
-
     if (argc != 6)
 	bu_exit(1, "ERROR: input format is <func num> <source string> <begin index> <num chars> <expected result string> [%s]\n", argv[0]);
 
@@ -677,6 +671,7 @@
 int
 main(int argc, char *argv[])
 {
+
     int function_num = 0;
 
     if (argc < 2) {
@@ -683,6 +678,8 @@
 	bu_exit(1, "ERROR: input format is function_num function_test_args [%s]\n", argv[0]);
     }
 
+    TEST_ARGV(argc, argv);
+
     sscanf(argv[1], "%d", &function_num);
 
     switch (function_num) {
Index: src/libbu/tests/vls-tests.cmake
===================================================================
--- src/libbu/tests/vls-tests.cmake	(revision 63699)
+++ src/libbu/tests/vls-tests.cmake	(working copy)
@@ -167,14 +167,14 @@
 #   098765432101234567890
 #            "01234567890" <= 11 chars
 add_test(bu_vls_substr_01 tester_bu_vls 20 "01234567890"  0  5  "01234")
-add_test(bu_vls_substr_02 tester_bu_vls 20 "01234567890" -2  5  "")
-add_test(bu_vls_substr_03 tester_bu_vls 20 "01234567890" -2 20  "")
+add_test(bu_vls_substr_02 tester_bu_vls 20 "01234567890" -2  5  "#EMPTY")
+add_test(bu_vls_substr_03 tester_bu_vls 20 "01234567890" -2 20  "#EMPTY")
 add_test(bu_vls_substr_04 tester_bu_vls 20 "01234567890"  5 20  "567890")
 add_test(bu_vls_substr_05 tester_bu_vls 20 "01234567890"  0 20  "01234567890")
 add_test(bu_vls_substr_06 tester_bu_vls 20 "01234567890"  2  5  "23456")
-add_test(bu_vls_substr_07 tester_bu_vls 20 "01234567890" 20  5  "")
+add_test(bu_vls_substr_07 tester_bu_vls 20 "01234567890" 20  5  "#EMPTY")
 add_test(bu_vls_substr_08 tester_bu_vls 20 "01234567890"  0 -1  "01234567890")
 add_test(bu_vls_substr_09 tester_bu_vls 20 "01234567890"  2 -1  "234567890")
-add_test(bu_vls_substr_10 tester_bu_vls 20 "01234567890"  0  0  "")
+add_test(bu_vls_substr_10 tester_bu_vls 20 "01234567890"  0  0  "#EMPTY")
 add_test(bu_vls_substr_11 tester_bu_vls 20 "01234567890"  0  2  "01")
-add_test(bu_vls_substr_12 tester_bu_vls 20 "01234567890" 11 20  "")
+add_test(bu_vls_substr_12 tester_bu_vls 20 "01234567890" 11 20  "#EMPTY")
Index: src/libbu/tests/bu_basename.c
===================================================================
--- src/libbu/tests/bu_basename.c	(revision 63699)
+++ src/libbu/tests/bu_basename.c	(working copy)
@@ -29,6 +29,8 @@
 
 #include "bu.h"
 
+#include "test_utils.h"
+
 #ifdef HAVE_BASENAME
 /* These two functions wrap the system and bu implementations to
  * standardize the memory behavior. The input string is unmodified,
@@ -89,6 +91,8 @@
 int
 main(int argc, char *argv[])
 {
+    TEST_ARGV(argc, argv);
+
     /* If we don't have any args at all, test NULL */
     if (argc == 1) {
 	compare_bu_to_system_basename(NULL);
Index: src/libbu/tests/bu_booleanize.c
===================================================================
--- src/libbu/tests/bu_booleanize.c	(revision 63699)
+++ src/libbu/tests/bu_booleanize.c	(working copy)
@@ -21,6 +21,8 @@
 #include "common.h"
 #include "bu.h"
 
+#include "test_utils.h"
+
 #include <string.h>
 
 
@@ -94,10 +96,11 @@
 main(int argc, char *argv[])
 {
     int pass = 0;
-
     if (argc > 2)
        fprintf(stderr,"Usage: %s test_string\n", argv[0]);
 
+    TEST_ARGV(argc, argv);
+
     if (argc == 1) {
        pass = automatic_test(NULL);
        return !pass;
Index: src/libbu/tests/bu_dirname.c
===================================================================
--- src/libbu/tests/bu_dirname.c	(revision 63699)
+++ src/libbu/tests/bu_dirname.c	(working copy)
@@ -29,7 +29,9 @@
 
 #include "bu.h"
 
+#include "test_utils.h"
 
+
 /* Test against basename UNIX tool */
 int
 automatic_test(const char *input)
@@ -76,6 +78,8 @@
 int
 main(int argc, char *argv[])
 {
+    TEST_ARGV(argc, argv);
+
     if (argc == 1)
        return !automatic_test(NULL);
 
