 
 char outBuf[80];
 
+test(bool_default_is_false)
+{
+  Value<bool> boolVal1;
+  
+  assertEqual(boolVal1.getValue(), false);
+  
+  boolVal1.getValueString(outBuf);
+  assertEqual(strcmp (outBuf, "Off"), 0);  
+}
+
+test(bool_setValue_true_default_format)
+{
+  Value<bool> boolVal1;
+  boolVal1.setValue(true);
+  
+  assertEqual(boolVal1.getValue(), true);
+  
+  boolVal1.getValueString(outBuf);
+  assertEqual(strcmp (outBuf, "On"), 0);
+}
+
+test(bool_comparisons)
+{
+  Value<bool> boolVal1;
+  Value<bool> boolVal2;
+
+  assertTrue(boolVal1 == boolVal2);
+
+  boolVal1.setValue(true);
+  assertTrue( boolVal1 != boolVal2);
+
+  boolVal2.setValue(true);
+  assertTrue(boolVal1 == boolVal2);
+}
+
+
+test(bool_has_changed)
+{
+  Value<bool> boolVal1;
+  assertFalse(boolVal1.hasChanged());
+  
+  boolVal1.setValue(true);
+  assertTrue(boolVal1.hasChanged());
+}
+
+
+test(bool_persist)
+{
+  Value<bool> boolVal1;
+  assertFalse(boolVal1.hasChanged());
+  
+  boolVal1.setValue(true);
+  assertTrue(boolVal1.hasChanged());
+
+  boolVal1.persistValue();
+  assertFalse(boolVal1.hasChanged());
+
+  boolVal1.setValue(false);
+  assertTrue(boolVal1.hasChanged());
+
+  boolVal1.revertValue();
+  assertTrue(boolVal1.getValue());
+  assertFalse(boolVal1.hasChanged());
+
+  boolVal1.initValue(false);
+  assertFalse(boolVal1.getValue());
+  assertFalse(boolVal1.hasChanged());
+}
+
+
 
 test(float_default_is_0_0)
 {

  assertEqual(strcmp (outBuf, "1.01"), 0);
}


test(int_default_is_0)
{

  assertEqual(intVal1.getValue(), -1001);
  
  intVal1.getValueString(outBuf);
  assertEqual(strcmp (outBuf, "-10.01"), 0);
}

test(int_comparisons)
{
  Value<int> intVal1;
  Value<int> intVal2;

  assertTrue(intVal1 == intVal2);

  intVal1.setValue(10);
  assertTrue( intVal1 != intVal2);
  assertTrue( intVal1 > intVal2);
  assertTrue( intVal1 >= intVal2);
  assertFalse( intVal1 < intVal2);
  assertFalse( intVal1 <= intVal2);
  
  intVal2.setValue(10);
  assertTrue(intVal1 == intVal2);
  assertFalse( intVal1 > intVal2);
  assertTrue( intVal1 >= intVal2);
  assertFalse( intVal1 < intVal2);
  assertTrue( intVal1 <= intVal2);
}

test(int_math)
{
  Value<int> intVal1;
  Value<int> intVal2;
  Value<int> intVal3;

  intVal1.setValue(10);
  assertEqual(intVal1.getValue(), 10);

  assertFalse(intVal1 == intVal2);

  intVal3.setValue(10);
  assertTrue(intVal1 == intVal3);
  
  
  intVal2 = intVal1;
  assertTrue(intVal1 == intVal2);

  intVal1.setValue(20);
  assertEqual(intVal1.getValue(), 20);
  assertFalse(intVal1 == intVal2);

  assertEqual(intVal1 + intVal2, 30);

  assertEqual(intVal1 - intVal2, 10);
 
  assertEqual(intVal1 * intVal2, 200);
  
  assertEqual(intVal1 / intVal2, 2);
}

test(int_persist)
{
  Value<int> intVal1;
  assertFalse(intVal1.hasChanged());
  
  intVal1.setValue(10);
  assertTrue(intVal1.hasChanged());

  intVal1.persistValue();
  assertFalse(intVal1.hasChanged());

  intVal1.setValue(0);
  assertTrue(intVal1.hasChanged());

  intVal1.revertValue();
  assertEqual(intVal1.getValue(), 10);
  assertFalse(intVal1.hasChanged());

  intVal1.initValue(20);
  assertEqual(intVal1.getValue(), 20);
  assertFalse(intVal1.hasChanged());
}

test(uint_default_is_0)
{
  Value<unsigned int> uintVal1;
  
  assertEqual(uintVal1.getValue(), 0);
  
  uintVal1.getValueString(outBuf);
  assertEqual(strcmp (outBuf, "0"), 0);
  
}

test(uint_setValue_1_default_format)
{
  Value<unsigned int> uintVal1;
  uintVal1.setValue(1);
  
  assertEqual(uintVal1.getValue(), 1);
  
  uintVal1.getValueString(outBuf);
  assertEqual(strcmp (outBuf, "1"), 0);
}


test(uint_setValue_1_01_fixed_pouint_2_decimals)
{
  Value<unsigned int> uintVal1(1,2);
  uintVal1.setValue(101);
  
  assertEqual(uintVal1.getValue(), 101);
  
  uintVal1.getValueString(outBuf);
  assertEqual(strcmp (outBuf, "1.01"), 0);
}

test(uint_setValue_1_01_fixed_pouint_scaled_by_10)
{
  Value<unsigned int> uintVal1(1,2,10);
  uintVal1.setValue(1010);
  
  assertEqual(uintVal1.getValue(), 1010);
  
  uintVal1.getValueString(outBuf);
  assertEqual(strcmp (outBuf, "1.01"), 0);
}

test(ulong_default_is_0)
{
  Value<unsigned long> uintVal1;
  
  assertEqual(uintVal1.getValue(), 0);
  
  uintVal1.getValueString(outBuf);
  assertEqual(strcmp (outBuf, "0"), 0);
  
}

test(ulong_setValue_1_default_format)
{
  Value<unsigned long> uintVal1;
  uintVal1.setValue(1);
  
  assertEqual(uintVal1.getValue(), 1);
  
  uintVal1.getValueString(outBuf);
  assertEqual(strcmp (outBuf, "1"), 0);
}


test(ulong_setValue_1_01_fixed_point_2_decimals)
{
  Value<unsigned long> uintVal1(1,2);
  uintVal1.setValue(101);
  
  assertEqual(uintVal1.getValue(), 101);
  
  uintVal1.getValueString(outBuf);
  assertEqual(strcmp (outBuf, "1.01"), 0);
}

test(ulong_setValue_1_01_fixed_point_scaled_by_10)
{
  Value<unsigned long> uintVal1(1,2,10);
  uintVal1.setValue(1010);
  
  assertEqual(uintVal1.getValue(), 1010);
  
  uintVal1.getValueString(outBuf);
  assertEqual(strcmp (outBuf, "1.01"), 0);
}




