00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <Basics.H>
00020 #include <chars_seq.H>
00021
00022 using std::endl;
00023 using std::cerr;
00024 using std::cout;
00025
00026 char *list1[] = {
00027 "PATH=/h/tJJ/McDdIbQ/bA_EeDylDwR/ola/UjN/v69l5IB60x/ITtc_QzMNM/EYzgZKlg/J65Am30j:/SoL:/lAO/QPg:/zAngR422585765Yad",
00028 "PERL5LIB=/G/VgE/MDJ/KWfdh/YyW/COKB/:/J/BqH/hXUiO/zMB/blJG:/OMi/vfqTA/53v3.3/hDQ/IilB0/iAeB_orDg",
00029 "MODEL_ROOT=/b/FjL/uUG/nlKMmc/PRCQCP/WyIFKA-ZNGa-gBs-uN0-51CW35v",
00030 "LM_LICENSE_FILE=/ZsU/Gjig/MBq/MUhWdVs/gtyg/bcX/yGOhFftM/RpI_rWL01:/DoK/MzBi/qKl/TNlXppe/FYNr/ZcV/ASwmjYe/UOH_JEn97:/LNt/LwwX/yFr/gKRJMiy/ohrt/ihI/FSvsOsfg/hef_Fqi04:/bRk/vibY/owb/TczkmNs/trYM/oeD/AiasBaxoDfPaa/mqC_Gig61:/VNF/IIvo/tpU/vkAHsCD/plnw/wyk/bOoSYBi/JiZ_UZp18:/bks/OIlk/eng/uicEsCR/Qskf/pCK/hhfxd/DEl_AQL88:/OAR/vFVC/vYL/VtDUtgC/YTqE/xgz/ohEhpA/KcN_euF97:/BUQ/CYPH/YTI/nXRGZAN/jTap/Snf/JcZLTvN/qZJ_vxA02:/AfV/dBuk/wOy/cwoJUnI/ztE/fFq/VEIohAjo/RwY_uSJ68:/QxQ/xrvn/xrb/rikCQcB/UA/ApR/IxvkizXE/mYe_Qam91:/vSk/gSGY/AqJ/NDahKjB/Wh/rhL/Xnfvsyau/VHZ_qbZ13:/Yuk/FTmS/Qbz/uPjAtvK/Fn/YKW/tCKFuadx/FXe-rEZ_pPN34:/Opw/IYQJ/hEB/mRHWtct/iy/xfl/fpTSVkUF/jWl-WeS_iLH55:/Fus/GEmq/pPK/Ljkjtyz/faB/eWV/kKMUpfPx/rXa_qDN99:0498@PZAAg480.LeG.paBND.lrh:0537@bOnv4173.UAk.DpNZH.wuJ:0160@MyESbOl226.mCU.PiEKA.kcY:1745@YxiD2404.AZ.SfJxm.Uba:8631@nGHE1603.iq.AoExd.lBC:0168@TAuV2367.SH.UxqoT.TVB",
00031 "CHEF_HOME=/m/teU/rgpeavd/Uj_JUnHEenj/AIg/FpZ/Vuhgr/hniE_CvaFa/QgCL/r64JN15x",
00032 "CAD_ROOT=/ZpJ/zZhF/FCD/DvDdH/hvywEGo/wYB",
00033 "SYSTEMSIM_ROOT=/Hwc/heDB/YBl/grGrp/fRJlmrI/nef/nPLwmTHG/PexsNXue/X9.6.8F"
00034 };
00035
00036 char *list2[] = {
00037 "/usr/bin/ar",
00038 "-q",
00039 "-c",
00040 "libCommTalk",
00041 "CommunicationTower.o",
00042 "rotate_left__34AVLSet__T9GnuStringP12CommunicatorXPP38AVLSetNode__T9GnuStringP12C2e3q28f.o",
00043 "rotate_right__34AVLSet__T9GnuStringP12CommunicatorXPP38AVLSetNode__T9GnuStringP1235p46sc.o"
00044 };
00045
00046 void Test(chars_seq &result, char *data[], unsigned int data_len)
00047 {
00048 for(unsigned int i = 0; i < data_len; i++)
00049 {
00050 result.append(data[i]);
00051 }
00052
00053 for(unsigned int i = 0; i < data_len; i++)
00054 {
00055 if(strcmp(result[i], data[i]) != 0)
00056 {
00057 cerr << "Misconpare at " << i << ":" << endl
00058 << " orig = " << data[i] << endl
00059 << " copy = " << result[i] << endl;
00060 exit(1);
00061 }
00062 }
00063
00064 }
00065
00066 int main()
00067 {
00068 chars_seq *result = NEW_CONSTR(chars_seq, (10, 20));
00069
00070 Test(*result, list1, sizeof(list1)/sizeof(list1[0]));
00071
00072 delete result;
00073
00074 result = NEW_CONSTR(chars_seq, (5, 100));
00075
00076 Test(*result, list2, sizeof(list2)/sizeof(list2[0]));
00077
00078 delete result;
00079
00080 cout << "All tests succeeded!" << endl;
00081 return 0;
00082 }