From 80686d4e567bae579ea39e009826a2de92cd4ace Mon Sep 17 00:00:00 2001 From: redpony Date: Wed, 11 Aug 2010 02:37:10 +0000 Subject: major refactor, break bad circular deps git-svn-id: https://ws10smt.googlecode.com/svn/trunk@509 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/logval_test.cc | 73 -------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 decoder/logval_test.cc (limited to 'decoder/logval_test.cc') diff --git a/decoder/logval_test.cc b/decoder/logval_test.cc deleted file mode 100644 index 1a23177d..00000000 --- a/decoder/logval_test.cc +++ /dev/null @@ -1,73 +0,0 @@ -#include "logval.h" - -#include -#include - -class LogValTest : public testing::Test { - protected: - virtual void SetUp() { } - virtual void TearDown() { } -}; - -using namespace std; - -TEST_F(LogValTest,Order) { - LogVal a(-0.3); - LogVal b(0.3); - LogVal c(2.4); - EXPECT_LT(a,b); - EXPECT_LT(b,c); - EXPECT_LT(a,c); - EXPECT_FALSE(b < a); - EXPECT_FALSE(c < a); - EXPECT_FALSE(c < b); - EXPECT_FALSE(c < c); - EXPECT_FALSE(b < b); - EXPECT_FALSE(a < a); -} - -TEST_F(LogValTest,Invert) { - LogVal x(-2.4); - LogVal y(2.4); - y.invert(); - EXPECT_FLOAT_EQ(x,y); -} - -TEST_F(LogValTest,Minus) { - LogVal x(12); - LogVal y(2); - LogVal z1 = x - y; - LogVal z2 = x; - z2 -= y; - EXPECT_FLOAT_EQ(z1, z2); - EXPECT_FLOAT_EQ(z1, 10.0); - EXPECT_FLOAT_EQ(y - x, -10.0); -} - -TEST_F(LogValTest,TestOps) { - LogVal x(-12.12); - LogVal y(x); - cerr << x << endl; - cerr << (x*y) << endl; - cerr << (x*y + x) << endl; - cerr << (x + x*y) << endl; - cerr << log1p(-0.5) << endl; - LogVal aa(0.2); - LogVal bb(-0.3); - cerr << (aa + bb) << endl; - cerr << (bb + aa) << endl; - EXPECT_FLOAT_EQ((aa + bb), (bb + aa)); - EXPECT_FLOAT_EQ((aa + bb), -0.1); -} - -TEST_F(LogValTest,TestSizes) { - cerr << sizeof(LogVal) << endl; - cerr << sizeof(LogVal) << endl; - cerr << sizeof(void*) << endl; -} - -int main(int argc, char** argv) { - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} - -- cgit v1.2.3