// Test case, bug 572978 - Glib::ustring allows comparison to 0

#include <glibmm.h>
#include <iostream>

namespace Glib
{
bool operator==(const ustring& lhs, int rhs) = delete;
bool operator==(int lhs, const ustring& rhs) = delete;
}

int main(int, char**)
{
  Glib::init();

  Glib::ustring string1("String 1");
  Glib::ustring string2("String 2");

  if (string1 == 0)
    std::cout << "string1 == 0" << std::endl;

  if (string1 == 1)
    std::cout << "string1 == 1" << std::endl;

  if (string1 == nullptr)
    std::cout << "string1 == nullptr" << std::endl;

  if (0 == string2)
    std::cout << "0 == string2" << std::endl;

  if (1 == string2)
    std::cout << "1 == string2" << std::endl;

  if (nullptr == string2)
    std::cout << "nullptr == string2" << std::endl;

  if (string1 == string2)
    std::cout << "string1 == string2" << std::endl;

  return 0;
}
