Merge pull request #225 from jray272/remove-log-every-n-assert
[platform/upstream/glog.git] / src / utilities_unittest.cc
index a2fb31b..38e847d 100644 (file)
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //
 // Author: Shinichiro Hamaji
-
 #include "utilities.h"
 #include "googletest.h"
 #include "glog/logging.h"
 
+#ifdef HAVE_LIB_GFLAGS
+#include <gflags/gflags.h>
+using namespace GFLAGS_NAMESPACE;
+#endif
+
 using namespace GOOGLE_NAMESPACE;
 
-TEST(sync_val_compare_and_swap, utilities) {
+TEST(utilities, sync_val_compare_and_swap) {
   bool now_entering = false;
   EXPECT_FALSE(sync_val_compare_and_swap(&now_entering, false, true));
   EXPECT_TRUE(sync_val_compare_and_swap(&now_entering, false, true));
   EXPECT_TRUE(sync_val_compare_and_swap(&now_entering, false, true));
 }
 
+TEST(utilities, InitGoogleLoggingDeathTest) {
+  ASSERT_DEATH(InitGoogleLogging("foobar"), "");
+}
+
 int main(int argc, char **argv) {
   InitGoogleLogging(argv[0]);
   InitGoogleTest(&argc, argv);