
#include <nstd/Debug.h>
#include <nstd/Variant.h>

void_t testVariant()
{
  // test default constructor
  {
    Variant var;
    ASSERT(var.isNull());
    ASSERT(var.toBool() == false);
  }

  // test boolean constructor
  {
    Variant var(true);
    ASSERT(var.toBool() == true);
  }

  // test map constructor
  {
    HashMap<String, Variant> map;
    map.append(_T("dasd"), Variant(String(_T("yes"))));
    Variant var(map);
    ASSERT(((const Variant&)var).toMap().find(_T("dasd"))->toString() == _T("yes"));
    ASSERT(var.toMap().find(_T("dasd"))->toString() == _T("yes"));
  }

}


#include <nstd/Debug.h>
#include <nstd/Variant.h>

void_t testVariant()
{
  // test default constructor
  {
    Variant var;
    ASSERT(var.isNull());
    ASSERT(var.toBool() == false);
  }

  // test boolean constructor
  {
    Variant var(true);
    ASSERT(var.toBool() == true);
  }

  // test map constructor
  {
    HashMap<String, Variant> map;
    map.append("dasd", Variant(String("yes")));
    Variant var(map);
    ASSERT(((const Variant&)var).toMap().find("dasd")->toString() == "yes");
    ASSERT(var.toMap().find("dasd")->toString() == "yes");
  }

}

--- 
+++ 
@@ -20,10 +20,10 @@
   // test map constructor
   {
     HashMap<String, Variant> map;
-    map.append("dasd", Variant(String("yes")));
+    map.append(_T("dasd"), Variant(String(_T("yes"))));
     Variant var(map);
-    ASSERT(((const Variant&)var).toMap().find("dasd")->toString() == "yes");
-    ASSERT(var.toMap().find("dasd")->toString() == "yes");
+    ASSERT(((const Variant&)var).toMap().find(_T("dasd"))->toString() == _T("yes"));
+    ASSERT(var.toMap().find(_T("dasd"))->toString() == _T("yes"));
   }
 
 }
Variant: Use Unicode compatible in Variant test
