Index: /library/tests/epdf_harness.h
===================================================================
--- /library/tests/epdf_harness.h (revision 436)
+++ /library/tests/epdf_harness.h (revision 439)
@@ -31,5 +31,4 @@
     vec mean;
     vec variance;
-    double lognc;
     mat support;
     int nsamples;
@@ -37,9 +36,12 @@
 
 public:
-    epdf_harness():lognc(0), nsamples(100), integral(0) { }
+    epdf_harness():nsamples(100), integral(0) { }
 
-    void test();
+    virtual void test();
 
     void from_setting(const Setting &set);
+
+protected:
+    epdf *get_epdf() { return hepdf.get(); }
 };
 
Index: /library/tests/egiw_harness.cpp
===================================================================
--- /library/tests/egiw_harness.cpp (revision 439)
+++ /library/tests/egiw_harness.cpp (revision 439)
@@ -0,0 +1,57 @@
+#include "egiw_harness.h"
+#include "stat/exp_family.h"
+#include "mat_checks.h"
+#include "test_util.h"
+#include "UnitTest++.h"
+
+const double epsilon = 0.00001;
+
+namespace UnitTest
+{
+
+inline void CheckClose(TestResults &results, const itpp::vec &expected,
+		       const itpp::vec &actual, double tolerance,
+		       TestDetails const &details) {
+    if (!AreClose(expected, actual, tolerance)) { 
+        MemoryOutStream stream;
+        stream << "Expected " << expected << " +/- " << tolerance << " but was " << actual;
+
+        results.OnTestFailure(details, stream.GetText());
+    }
+}
+
+inline void CheckClose(TestResults &results, const itpp::mat &expected,
+		       const itpp::mat &actual, double tolerance,
+		       TestDetails const &details) {
+    if (!AreClose(expected, actual, tolerance)) { 
+        MemoryOutStream stream;
+        stream << "Expected " << expected << " +/- " << tolerance << " but was " << actual;
+
+        results.OnTestFailure(details, stream.GetText());
+    }
+}
+
+}
+
+namespace bdm {
+
+template<>
+const ParticularUI<egiw_harness> &ParticularUI<egiw_harness>::factory(
+    ParticularUI<egiw_harness>("egiw_harness"));
+
+void egiw_harness::from_setting(const Setting &set) {
+    epdf_harness::from_setting(set);
+    UI::get(lognc, set, "lognc");
+}
+
+void egiw_harness::test()
+{
+    epdf_harness::test();
+
+    egiw *wide = dynamic_cast<egiw *>(get_epdf());
+    CHECK(wide);
+
+    CHECK_CLOSE(lognc, wide->lognc(), epsilon);
+}
+
+}
Index: /library/tests/CMakeLists.txt
===================================================================
--- /library/tests/CMakeLists.txt (revision 436)
+++ /library/tests/CMakeLists.txt (revision 439)
@@ -7,5 +7,5 @@
 link_directories (./unittest-cpp)
 
-add_library(testutil epdf_harness.cpp epdf_harness.h mat_checks.cpp mat_checks.h test_util.cpp test_util.h)
+add_library(testutil egiw_harness.cpp egiw_harness.h epdf_harness.cpp epdf_harness.h mat_checks.cpp mat_checks.h test_util.cpp test_util.h)
 target_link_libraries(testutil bdm itpp unittest)
 
Index: /library/tests/epdf_harness.cpp
===================================================================
--- /library/tests/epdf_harness.cpp (revision 436)
+++ /library/tests/epdf_harness.cpp (revision 439)
@@ -44,5 +44,4 @@
     UI::get(mean, set, "mean");
     UI::get(variance, set, "variance");
-    UI::get(lognc, set, "lognc");
     UI::get(support, set, "support");
 
@@ -63,9 +62,4 @@
     CHECK_CLOSE(mean, num_mean2(hepdf.get(), xb, yb, nsamples, nsamples), 0.1);
     CHECK_CLOSE(integral, normcoef(hepdf.get(), xb, yb, nsamples, nsamples), 0.1);
-
-    egiw *wide = dynamic_cast<egiw *>(hepdf.get());
-    CHECK(wide);
-
-    CHECK_CLOSE(lognc, wide->lognc(), epsilon);
 }
 
Index: /library/tests/egiw_harness.h
===================================================================
--- /library/tests/egiw_harness.h (revision 439)
+++ /library/tests/egiw_harness.h (revision 439)
@@ -0,0 +1,36 @@
+/*!
+  \file
+  \brief Support for testing egiw.
+  \author Vaclav Barta.
+
+  -----------------------------------
+  BDM++ - C++ library for Bayesian Decision Making under Uncertainty
+
+  Using IT++ for numerical operations
+  -----------------------------------
+*/
+
+#ifndef EGIW_HARNESS_H
+#define EGIW_HARNESS_H
+
+#include "epdf_harness.h"
+
+namespace bdm
+{
+
+class egiw_harness : public epdf_harness
+{
+private:
+    double lognc;
+
+public:
+    egiw_harness():lognc(0) { }
+
+    void test();
+
+    void from_setting(const Setting &set);
+};
+
+}
+
+#endif
