home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / hdf / unix / examples.lha / examples / err / err.c next >
Encoding:
C/C++ Source or Header  |  1991-10-09  |  711 b   |  25 lines

  1.  
  2. /******************************************************
  3. *
  4. *  Testing existence of global variable DFerror.
  5. *
  6. *  Note: "textfile" should not exist;  otherwise no error is reported.
  7. *        The error code reported should be -1.
  8. *
  9. *******************************************************/
  10. extern int DFerror;
  11. main()
  12. {
  13.     int ret, rank, sizes[3];
  14.  
  15.     ret = DFSDgetdims("textfile", &rank, sizes,3);
  16.     printf("\n\treturn value = %d\n\tDFerror = %d\n\n", ret, DFerror);
  17.  
  18.     if (ret < 0  && DFerror == -1)
  19.         printf("Test of error reporting successful !\n");
  20.     else {
  21.         printf("Test of error reporting unsuccessful !\n");
  22.         printf("Return value should be < 0; DFerror should be -1\n");
  23.     }
  24. }
  25.