Back to index

glibc  2.9
Defines | Functions | Variables
tst_putwc.c File Reference
#include <errno.h>
#include <error.h>
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
#include <test-skeleton.c>

Go to the source code of this file.


#define TEST_FUNCTION   do_test ()


int do_test (void)


static const char outname [] = "tst_putwc.temp"

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 31 of file tst_putwc.c.

Function Documentation

int do_test ( void  )

Definition at line 41 of file glrefmain.c.

  void *d1;
  void *d2;
  int (*f) (void);

  d1 = load ("");
  d2 = load ("");

  f = dlsym (d2, "ref2");
  if (f == NULL)
    error (EXIT_FAILURE, errno, "cannot get pointer to `%s'", "ref2");

  if (f () != 42)
    error (EXIT_FAILURE, 0, "wrong result from `%s'", "ref2");

  puts ("Correct result in first call");
  fflush (stdout);

  /* Now unload the first file.  */
  dlclose (d1);

  puts ("About to call the second time");
  fflush (stdout);

  /* Try calling the function again.  */
  if (f () != 42)
    error (EXIT_FAILURE, 0, "wrong result from `%s' (second call)", "ref2");

  puts ("Second call succeeded!");
  fflush (stdout);

  dlclose (d2);

  puts ("glreflib2 also closed");
  fflush (stdout);

  return 0;

Variable Documentation

const char outname[] = "tst_putwc.temp" [static]

Definition at line 27 of file tst_putwc.c.