#include <locale>
#include <testsuite_hooks.h>
void test01()
{
using namespace std;
typedef std::collate<char>::string_type string_type;
bool test __attribute__((unused)) = true;
locale loc_c = locale::classic();
locale loc_us = __gnu_test::try_named_locale("en_US");
locale loc_fr = __gnu_test::try_named_locale("fr_FR");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
VERIFY( loc_de != loc_fr );
const collate<char>& coll_c = use_facet<collate<char> >(loc_c);
const char* strlit1 = "monkey picked tikuanyin oolong";
const char* strlit2 = "imperial tea court green oolong";
int i1;
int i2;
int size1 = char_traits<char>::length(strlit1) - 1;
int size2 = char_traits<char>::length(strlit2) - 1;
i1 = coll_c.compare(strlit1, strlit1 + size1, strlit1, strlit1 + 7);
VERIFY ( i1 == 1 );
i1 = coll_c.compare(strlit1, strlit1 + 7, strlit1, strlit1 + size1);
VERIFY ( i1 == -1 );
i1 = coll_c.compare(strlit1, strlit1 + 7, strlit1, strlit1 + 7);
VERIFY ( i1 == 0 );
i2 = coll_c.compare(strlit2, strlit2 + size2, strlit2, strlit2 + 13);
VERIFY ( i2 == 1 );
i2 = coll_c.compare(strlit2, strlit2 + 13, strlit2, strlit2 + size2);
VERIFY ( i2 == -1 );
i2 = coll_c.compare(strlit2, strlit2 + size2, strlit2, strlit2 + size2);
VERIFY ( i2 == 0 );
}
int main()
{
test01();
return 0;
}