diff --git a/unit/Makefile b/unit/Makefile index fabd9b30..4608f17a 100644 --- a/unit/Makefile +++ b/unit/Makefile @@ -24,8 +24,8 @@ include $(MOOSE_DIR)/modules/modules.mk ############################################################################### # Extra stuff for GTEST -ADDITIONAL_INCLUDES := -I$(FRAMEWORK_DIR)/contrib/gtest -ADDITIONAL_LIBS := $(FRAMEWORK_DIR)/contrib/gtest/libgtest.la +ADDITIONAL_INCLUDES += -I$(FRAMEWORK_DIR)/contrib/gtest +ADDITIONAL_LIBS += $(FRAMEWORK_DIR)/contrib/gtest/libgtest.la # dep apps APPLICATION_DIR := $(CURRENT_DIR)/.. diff --git a/unit/src/GSLTest.C b/unit/src/GSLTest.C index 9e64ba66..e8e45f68 100644 --- a/unit/src/GSLTest.C +++ b/unit/src/GSLTest.C @@ -11,26 +11,26 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ +#ifdef GSL_ENABLED #include #include -//GSL includes +// GSL includes #include // function to integrate double function(double x, void * params) { - double alpha = *(double *) params; - double f = std::log(alpha*x) / std::sqrt(x); + double alpha = *(double *)params; + double f = std::log(alpha * x) / std::sqrt(x); return f; } TEST(GSLTest, integrationTest) { - gsl_integration_workspace * w - = gsl_integration_workspace_alloc (1000); + gsl_integration_workspace * w = gsl_integration_workspace_alloc(1000); double result, error; double alpha = 1.0; @@ -39,12 +39,13 @@ TEST(GSLTest, integrationTest) F.function = &function; F.params = α - gsl_integration_qags (&F, 0, 1, 0, 1e-7, 1000, - w, &result, &error); + gsl_integration_qags(&F, 0, 1, 0, 1e-7, 1000, w, &result, &error); EXPECT_NEAR(result, -4.000000000000085265, 1e-18) << "Integration result is wrong"; EXPECT_NEAR(error, 0.000000000000135447, 1e-18) << "Integration error is wrong"; EXPECT_EQ(w->size, 8); - gsl_integration_workspace_free (w); + gsl_integration_workspace_free(w); } + +#endif