Back to index

glibc  2.9
Defines | Functions
tst-wcsnlen.c File Reference
#include <stdio.h>
#include <wchar.h>

Go to the source code of this file.

Defines

#define TEST(Str, Max, Exp)

Functions

int main (void)

Define Documentation

#define TEST (   Str,
  Max,
  Exp 
)
Value:
n = wcsnlen (L##Str, Max);                                           \
  if (n != Exp)                                                             \
    {                                                                \
      result = 1;                                                    \
      printf ("wcsnlen (L\"%s\", %d) = %d, not %d\n", Str, Max, n, Exp);      \
    }

Definition at line 23 of file tst-wcsnlen.c.


Function Documentation

int main ( void  )

Definition at line 32 of file tst-wcsnlen.c.

{
  int result = 0;
  int n;

  TEST ("0123456789", 0, 0);
  TEST ("0123456789", 1, 1);
  TEST ("0123456789", 2, 2);
  TEST ("0123456789", 3, 3);
  TEST ("0123456789", 4, 4);
  TEST ("0123456789", 5, 5);
  TEST ("0123456789", 6, 6);
  TEST ("0123456789", 7, 7);
  TEST ("0123456789", 8, 8);
  TEST ("0123456789", 9, 9);

  TEST ("01234", 9, 5);

  return result;
}