/* $XConsortium: prelim.c,v 1.0 93/11/22 12:26:56 rws Exp $ */ /******************************************************************************/ /* */ /* (c) Copyright Hewlett-Packard Company, 1993, Fort Collins, Colorado */ /* */ /* All Rights Reserved */ /* */ /* Permission to use, copy, modify, and distribute this software and its */ /* documentation for any purpose and without fee is hereby granted, */ /* provided that the above copyright notices appear in all copies and that */ /* both the copyright notices and this permission notice appear in */ /* supporting documentation, and that the name of Hewlett-Packard not be */ /* used in advertising or publicity pertaining to distribution of the */ /* software without specific, written prior permission. */ /* */ /* HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS */ /* SOFTWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard */ /* shall not be liable for errors contained herein or direct, indirect, */ /* special, incidental or consequential damages in connection with the */ /* furnishing, performance or use of this software. */ /* */ /******************************************************************************/ #include #include #include #include #include "pexutcmap.h" #include #include /* Inquires some basic information about the PEX implementation and prints warnings if it does not meet the minimum requirements for running the PEX-IC susPEX test suite. */ Window local_win; test_body(Display *dpy, XID resourceID, PEXOCRequestType req_type) { PEXExtensionInfo *ext_info; unsigned int subset_info; unsigned int float_format; /* Get the extension information. */ if ((ext_info = PEXGetExtensionInfo (dpy)) == NULL) { _hppex_stderr_print("ERROR: PEXGetExtensionInfo returned NULL pointer\n" ); } _hppex_stderr_print("Information about this PEX implementation:\n"); _hppex_stderr_print(" Vendor string: %s\n", ext_info->vendor_name); _hppex_stderr_print(" Release: %d (0x%x)\n\n", ext_info->release, ext_info->release); /* Check the protocol version. */ if ((ext_info->major_version != 5) || (ext_info->minor_version < 1)) { _hppex_stderr_print("WARNING: Protocol version is not 5.1 or higher.\n" ); _hppex_stderr_print(" The PEX-IC susPEX suite is written to use\n"); _hppex_stderr_print(" PEX 5.1 requests and is unlikely to work correctly\n"); _hppex_stderr_print(" on 5.0 implementations.\n\n"); } /* Check the subset support. */ subset_info = ext_info->subset_info & 0xffff; _hppex_stderr_print("Subsets supported are:\n"); if (subset_info & PEXImmediateMode) _hppex_stderr_print(" Immediate mode\n"); if (subset_info & PEXStructureMode) _hppex_stderr_print(" Structure mode\n"); if (subset_info & PEXWorkstationOnly) _hppex_stderr_print(" PHIGS Workstation mode\n"); _hppex_stderr_print("\n"); if (! ((subset_info & PEXImmediateMode) && (subset_info & PEXStructureMode))) { _hppex_stderr_print("WARNING: Without the immediate mode and structure mode\n"); _hppex_stderr_print(" subsets, the PEX-IC susPEX test suite can be\n"); _hppex_stderr_print(" expected to exhibit failures in testing basic\n"); _hppex_stderr_print(" functionality.\n\n"); } if (! (subset_info & PEXWorkstationOnly)) { _hppex_stderr_print("WARNING: Without the PHIGS workstation support,\n"); _hppex_stderr_print(" the PEX-IC susPEX test suite can test only\n"); _hppex_stderr_print(" basic functionality but not full functionality\n\n"); } /* Check the floating point format. */ float_format = PEXGetProtocolFloatFormat (dpy); if (float_format != PEXIEEE_754_32) { _hppex_stderr_print("WARNING: The natural protocol float format of the server\n"); _hppex_stderr_print(" is not IEEE_754_32. There may be serious problems\n"); _hppex_stderr_print(" in interoperability unless the client library has\n"); _hppex_stderr_print(" floating point format conversion\n\n"); } /* Check various enumerated types as determined by the PEX-IC test suite Basic functionality definition. */ { Status status = 0; int enum_count; unsigned long enum_item_mask = 0; unsigned long *info_count_return = 0; PEXEnumTypeDesc *enum_info_return = 0; int enum_index, j; int RGB_found, Indexed_found, approx_found, hlhsr_found; int enum_types[3]; enum_count = 3; enum_types[0] = PEXETColorType; enum_types[1] = PEXETColorApproxModel; enum_types[2] = PEXETHLHSRMode; enum_item_mask = PEXETIndex; status = 0; status = PEXGetEnumTypeInfo(dpy, local_win, enum_count, enum_types, enum_item_mask, &info_count_return, &enum_info_return); if (status == 0) _hppex_stderr_print("ERROR: zero status from PEXGetEnumTypeInfo()\n\n"); enum_index=0; /* Color types required: PEXColorTypeRGB and PEXColorTypeIndexed. */ RGB_found = False; Indexed_found = False; for (j=0; j