rtxRandTest.h
00001 /* 00002 * Copyright (c) 2003-2017 Objective Systems, Inc. 00003 * 00004 * This software is furnished under a license and may be used and copied 00005 * only in accordance with the terms of such license and with the 00006 * inclusion of the above copyright notice. This software or any other 00007 * copies thereof may not be provided or otherwise made available to any 00008 * other person. No title to and ownership of the software is hereby 00009 * transferred. 00010 * 00011 * The information in this software is subject to change without notice 00012 * and should not be construed as a commitment by Objective Systems, Inc. 00013 * 00014 * PROPRIETARY NOTICE 00015 * 00016 * This software is an unpublished work subject to a confidentiality agreement 00017 * and is protected by copyright and trade secret law. Unauthorized copying, 00018 * redistribution or other use of this work is prohibited. 00019 * 00020 * The above notice of copyright on this source code product does not indicate 00021 * any actual or intended publication of such source code. 00022 * 00023 *****************************************************************************/ 00024 /* 00025 * @file rtxRandTest.h 00026 */ 00027 #ifndef _RTXRANDTEST_H_ 00028 #define _RTXRANDTEST_H_ 00029 00030 #ifndef _NO_STREAM 00031 00032 #include "rtxsrc/osSysTypes.h" 00033 #include "rtxsrc/rtxExternDefs.h" 00034 #include "rtxsrc/rtxStream.h" 00035 00036 #ifdef __cplusplus 00037 extern "C" { 00038 #endif 00039 00040 /* 00041 * This function used for runtime random functions initialization. 00042 * Has to be called one time in the beginning of the program. 00043 * 00044 * @param randSeed Seed for srand random-number generation. 00045 */ 00046 EXTERNRT void rtxRandInit(unsigned int randSeed); 00047 00048 /* 00049 * This function used for runtime random int32 data generation in interval 00050 * 00051 * @param pctxt Pointer to context structure variable. 00052 * @param lower Minimum number in interval 00053 * @param upper Maximum number in interval 00054 * 00055 * @return int32 generated number 00056 */ 00057 EXTERNRT OSINT32 rtxRandInt32 (OSCTXT* pctxt, OSINT32 lower, OSINT32 upper); 00058 00059 /* 00060 * This function used for runtime random int64 data generation in interval 00061 * 00062 * @param pctxt Pointer to context structure variable. 00063 * @param lower Minimum number in interval 00064 * @param upper Maximum number in interval 00065 * 00066 * @return int64 generated number 00067 */ 00068 EXTERNRT OSINT64 rtxRandInt64 (OSCTXT* pctxt, OSINT64 lower, OSINT64 upper); 00069 00070 /* 00071 * This function used for runtime random unsigned int32 data generation in interval 00072 * 00073 * @param pctxt Pointer to context structure variable. 00074 * @param lower Minimum number in interval 00075 * @param upper Maximum number in interval 00076 * 00077 * @return Unsigned int32 generated number 00078 */ 00079 EXTERNRT OSUINT32 rtxRandUInt32 (OSCTXT* pctxt, OSUINT32 lower, OSUINT32 upper); 00080 00081 /* 00082 * This function used for runtime random unsigned int64 data generation in interval 00083 * 00084 * @param pctxt Pointer to context structure variable. 00085 * @param lower Minimum number in interval 00086 * @param upper Maximum number in interval 00087 * 00088 * @return Unsigned int64 generated number 00089 */ 00090 EXTERNRT OSUINT64 rtxRandUInt64 (OSCTXT* pctxt, OSUINT64 lower, OSUINT64 upper); 00091 00092 /* 00093 * This function used for runtime random string generation 00094 * 00095 * @param pctxt Pointer to context structure variable. 00096 * @param lower Minimum size of string 00097 * @param upper Maximum size of string 00098 * @param charSet Char set for string 00099 * 00100 * @return Generated string 00101 */ 00102 EXTERNRT char* rtxRandString (OSCTXT* pctxt, size_t lower, size_t upper, 00103 const char* charSet); 00104 00105 /* 00106 * This function used for runtime random Unicode string generation 00107 * 00108 * @param pctxt Pointer to context structure variable. 00109 * @param lower Minimum size of string 00110 * @param upper Maximum size of string 00111 * @param charSet Char set for string 00112 * 00113 * @return Generated Unicode string 00114 */ 00115 EXTERNRT OSUTF8CHAR* rtxRandUnicodeString (OSCTXT* pctxt, size_t lower, 00116 size_t upper, const char* charSet); 00117 00118 /* 00119 * This function used for runtime random float data generation in interval 00120 * 00121 * @param pctxt Pointer to context structure variable. 00122 * @param lower Minimum number in interval 00123 * @param upper Maximum number in interval 00124 * 00125 * @return Float generated number 00126 */ 00127 EXTERNRT OSREAL rtxRandFloat (OSCTXT* pctxt, OSREAL lower, OSREAL upper); 00128 00129 /* 00130 * This function used for runtime random octet string generation 00131 * 00132 * @param pctxt Pointer to context structure variable. 00133 * @pvalue Generated string 00134 * @param lower Minimum size of string 00135 * @param upper Maximum size of string 00136 */ 00137 EXTERNRT void rtxRandOctetString (OSCTXT* pctxt, OSDynOctStr* pvalue, size_t 00138 lower, size_t upper); 00139 00140 /* 00141 * This function used for runtime random date generation 00142 * 00143 * @param pctxt Pointer to context structure variable. 00144 * @param pvalue Generated date 00145 */ 00146 EXTERNRT void rtxRandDateTime (OSCTXT* pctxt, OSNumDateTime* pvalue, OSUINT32 lower, OSUINT32 upper); 00147 00148 #ifdef __cplusplus 00149 } 00150 #endif 00151 00152 #endif /* _NO_STREAM */ 00153 #endif /* _RTXRANDTEST_H_ */