TEST_F(UnitsFixture,IPUnit_Constructors)
{
    LOG(Debug,"IPUnit_Constructors");

    IPUnit u1;
    ASSERT_THROW(u1.setBaseUnitExponent("m",1),Exception);
    ASSERT_NO_THROW(u1.setBaseUnitExponent("ft",2));
    testStreamOutput("ft^2",u1);

    IPUnit u2(IPExpnt(1,1,-2));
    testStreamOutput("lb_m*ft/s^2",u2);
    u2.lbmToLbf();
    testStreamOutput("lb_f",u2);
    ASSERT_TRUE(u2.baseUnitExponent("lb_f") == 1);
    ASSERT_TRUE(u2.baseUnitExponent("lb_m") == 0);
    ASSERT_TRUE(u2.baseUnitExponent("m") == 0);
    u2.lbfToLbm();
    testStreamOutput("lb_m*ft/s^2", u2);

    IPUnit u3(IPExpnt(0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1));
    testStreamOutput("$/ft^2", u3);
    ASSERT_TRUE(u3.baseUnitExponent("$") == 1);
    ASSERT_TRUE(u3.baseUnitExponent("ft") == -2);
    ASSERT_TRUE(u3.baseUnitExponent("s") == 0);
    u3.lbmToLbf();
    testStreamOutput("$/ft^2", u3);
    ASSERT_TRUE(u3.baseUnitExponent("$") == 1);
    ASSERT_TRUE(u3.baseUnitExponent("ft") == -2);
    ASSERT_TRUE(u3.baseUnitExponent("s") == 0);
    u3.lbfToLbm();
    testStreamOutput("$/ft^2", u3);
}
TEST_F(UnitsFixture,IPUnit_ArithmeticOperators)
{
    LOG(Debug,"IPUnit_ArithmeticOperators");

    IPUnit u1;
    IPUnit u2 = createIPForce();
    IPUnit u3(IPExpnt(1));

    u1 *= u3;
    testStreamOutput("lb_m",u1);
    Unit u4 = u2*u3;
    ASSERT_TRUE(u4.system() == UnitSystem::IP);
    testStreamOutput("lb_m*lb_f",u4);
    u4.cast<IPUnit>().lbfToLbm();
    testStreamOutput("lb_m^2*ft/s^2",u4);

    Unit u5 = u4/u3;
    EXPECT_TRUE(u5.system() == UnitSystem::IP);
    EXPECT_TRUE(u5 == u2);

    Unit u6 = pow(u5,-6);
    EXPECT_TRUE(u6.system() == UnitSystem::IP);
    testStreamOutput("s^12/lb_m^6*ft^6",u6);
    u6.pow(1,3);
    testStreamOutput("s^4/lb_m^2*ft^2",u6);
}
TEST_F(UnitsFixture,IPUnit_LogicalOperators)
{
    LOG(Debug,"IPUnit_LogicalOperators");

    IPUnit u1 = createIPForce();
    IPUnit u2(IPExpnt(1,1,-2));

    ASSERT_TRUE(u1 == u2);
    u2.setBaseUnitExponent("s",-3);
    ASSERT_TRUE(u1 != u2);
}