Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Macros | Enumerations | Functions | Variables
22.locale.collate.cpp File Reference
#include <locale>
#include <string>
#include <algorithm>
#include <climits>
#include <clocale>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cwchar>
#include <rw_driver.h>
#include <rw_environ.h>
#include <rw_file.h>
#include <rw_locale.h>
#include <rw_process.h>
Include dependency graph for 22.locale.collate.cpp:

Go to the source code of this file.

Macros

#define SLASH   "\\"
 
#define RELPATH   "etc" SLASH "nls"
 
#define TESTS_ETC_PATH   "tests" SLASH "etc"
 
#define LOCALE_ROOT   "RWSTD_LOCALE_ROOT"
 
#define LC_COLLATE_SRC   "LC_COLLATE.src"
 
#define LC_COLLATE_CM   "LC_COLLATE.cm"
 
#define TEST_LOCALE_NAME   "test.locale"
 
#define STR_SIZE   16
 
#define IGNORE   0
 
#define TEST(ch, w0, w1, w2, w3, w3_is_fp)    test_weight_val (charTname, co, charT (ch), w0, w1, w2, w3, w3_is_fp)
 
#define TOPDIR   "TOPDIR" /* the TOPDIR environment variable */
 
#define RM_RF   "rmdir /Q /S "
 

Enumerations

enum  { bufsiz = 256 }
 

Functions

int c_strcoll (const char *s1, const char *s2)
 
std::size_t c_xfrm (char *to, const char *from, std::size_t size)
 
std::size_t c_strlen (const char *s1)
 
const char * narrow (char *dst, const char *src)
 
const char * widen (char *dst, const char *src)
 
int c_strcoll (const wchar_t *s1, const wchar_t *s2)
 
std::size_t c_xfrm (wchar_t *to, const wchar_t *from, std::size_t size)
 
std::size_t c_strlen (const wchar_t *s1)
 
const wchar_t * widen (wchar_t *dst, const char *src)
 
const char * narrow (char *dst, const wchar_t *src)
 
template<class charT >
void gen_str (charT *str, std::size_t size)
 
template<class charT >
void check_libc (const char *charTname)
 
template<class charT >
void check_libstd_test_locale (const char *charTname)
 
template<class charT >
void test_hash (const char *charTname, const std::collate< charT > &co, const char *str1, const char *str2)
 
template<class charT >
void test_string (const char *charTname, const std::collate< charT > &co, const char *str1, const char *str2, int expected_val)
 
template<class charT >
void test_weight_val (const char *charTname, const std::collate< charT > &co, charT ch, int w1a, int w1b, int w2, int w3, bool w3_is_fp)
 
template<class charT >
void check_libstd (const char *charTname)
 
template<class charT >
void check_hash_eff (const char *charTname)
 
template<class charT >
void check_NUL (const char *charTname)
 
template<class charT >
void do_test (const char *charTname)
 
int main (int argc, char *argv[])
 

Variables

const char * locale_root
 

Macro Definition Documentation

◆ IGNORE

#define IGNORE   0

◆ LC_COLLATE_CM

#define LC_COLLATE_CM   "LC_COLLATE.cm"

Definition at line 63 of file 22.locale.collate.cpp.

◆ LC_COLLATE_SRC

#define LC_COLLATE_SRC   "LC_COLLATE.src"

Definition at line 62 of file 22.locale.collate.cpp.

◆ LOCALE_ROOT

#define LOCALE_ROOT   "RWSTD_LOCALE_ROOT"

Definition at line 59 of file 22.locale.collate.cpp.

◆ RELPATH

#define RELPATH   "etc" SLASH "nls"

Definition at line 55 of file 22.locale.collate.cpp.

◆ RM_RF

#define RM_RF   "rmdir /Q /S "

Definition at line 1071 of file 22.locale.collate.cpp.

◆ SLASH

#define SLASH   "\\"

22.locale.collate.cpp – tests for collate-facet member functions

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 1994-2008 Rogue Wave Software.

Definition at line 50 of file 22.locale.collate.cpp.

◆ STR_SIZE

#define STR_SIZE   16

◆ TEST

#define TEST (   ch,
  w0,
  w1,
  w2,
  w3,
  w3_is_fp 
)     test_weight_val (charTname, co, charT (ch), w0, w1, w2, w3, w3_is_fp)

◆ TEST_LOCALE_NAME

#define TEST_LOCALE_NAME   "test.locale"

Definition at line 64 of file 22.locale.collate.cpp.

◆ TESTS_ETC_PATH

#define TESTS_ETC_PATH   "tests" SLASH "etc"

Definition at line 56 of file 22.locale.collate.cpp.

◆ TOPDIR

#define TOPDIR   "TOPDIR" /* the TOPDIR environment variable */

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
bufsiz 

Definition at line 597 of file 22.locale.collate.cpp.

Function Documentation

◆ c_strcoll() [1/2]

int c_strcoll ( const char *  s1,
const char *  s2 
)

Definition at line 72 of file 22.locale.collate.cpp.

◆ c_strcoll() [2/2]

int c_strcoll ( const wchar_t *  s1,
const wchar_t *  s2 
)

Definition at line 122 of file 22.locale.collate.cpp.

◆ c_strlen() [1/2]

std::size_t c_strlen ( const char *  s1)

Definition at line 97 of file 22.locale.collate.cpp.

◆ c_strlen() [2/2]

std::size_t c_strlen ( const wchar_t *  s1)

Definition at line 175 of file 22.locale.collate.cpp.

◆ c_xfrm() [1/2]

std::size_t c_xfrm ( char *  to,
const char *  from,
std::size_t  size 
)

Definition at line 78 of file 22.locale.collate.cpp.

◆ c_xfrm() [2/2]

std::size_t c_xfrm ( wchar_t *  to,
const wchar_t *  from,
std::size_t  size 
)

Definition at line 128 of file 22.locale.collate.cpp.

◆ check_hash_eff()

template<class charT >
void check_hash_eff ( const char *  charTname)

Definition at line 910 of file 22.locale.collate.cpp.

◆ check_libc()

template<class charT >
void check_libc ( const char *  charTname)

Definition at line 247 of file 22.locale.collate.cpp.

◆ check_libstd()

template<class charT >
void check_libstd ( const char *  charTname)

Definition at line 708 of file 22.locale.collate.cpp.

◆ check_libstd_test_locale()

template<class charT >
void check_libstd_test_locale ( const char *  charTname)

Definition at line 508 of file 22.locale.collate.cpp.

◆ check_NUL()

template<class charT >
void check_NUL ( const char *  charTname)

Definition at line 968 of file 22.locale.collate.cpp.

◆ do_test()

template<class charT >
void do_test ( const char *  charTname)

Definition at line 1058 of file 22.locale.collate.cpp.

◆ gen_str()

template<class charT >
void gen_str ( charT *  str,
std::size_t  size 
)

Definition at line 230 of file 22.locale.collate.cpp.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 1111 of file 22.locale.collate.cpp.

◆ narrow() [1/2]

const char * narrow ( char *  dst,
const char *  src 
)

Definition at line 102 of file 22.locale.collate.cpp.

◆ narrow() [2/2]

const char * narrow ( char *  dst,
const wchar_t *  src 
)

Definition at line 202 of file 22.locale.collate.cpp.

◆ test_hash()

template<class charT >
void test_hash ( const char *  charTname,
const std::collate< charT > &  co,
const char *  str1,
const char *  str2 
)

Definition at line 601 of file 22.locale.collate.cpp.

◆ test_string()

template<class charT >
void test_string ( const char *  charTname,
const std::collate< charT > &  co,
const char *  str1,
const char *  str2,
int  expected_val 
)

Definition at line 627 of file 22.locale.collate.cpp.

◆ test_weight_val()

template<class charT >
void test_weight_val ( const char *  charTname,
const std::collate< charT > &  co,
charT  ch,
int  w1a,
int  w1b,
int  w2,
int  w3,
bool  w3_is_fp 
)

Definition at line 651 of file 22.locale.collate.cpp.

◆ widen() [1/2]

const char * widen ( char *  dst,
const char *  src 
)

Definition at line 111 of file 22.locale.collate.cpp.

◆ widen() [2/2]

const wchar_t * widen ( wchar_t *  dst,
const char *  src 
)

Definition at line 180 of file 22.locale.collate.cpp.

Variable Documentation

◆ locale_root

const char* locale_root

Definition at line 60 of file 22.locale.collate.cpp.