1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460
|
// This file contains generated testing code. We do some basic tests
// like writing and reading from/to streams. Of course these tests are
// neither complete nor very advanced, so watch out :)
#include <word97_generated.h>
#include <olestream.h>
#include <iostream>
#include <stdlib.h> // rand(), srand()
#include <time.h> // time()
using namespace wvWare;
using namespace Word97;
int main(int, char**) {
// First we have to create some infrastructure
system("rm word97_test.doc &> /dev/null");
OLEStorage storage("word97_test.doc");
if(!storage.open(OLEStorage::WriteOnly)) {
std::cout << "Error: Couldn't open the storage!" << std::endl;
::exit(1);
}
OLEStreamWriter *writer=storage.createStreamWriter("TestStream");
if(!writer || !writer->isValid()) {
std::cout << "Error: Couldn't open a stream for writing!" << std::endl;
::exit(1);
}
// Initialize the random number generator
srand( time( 0 ) );
// Some "global" variables...
int *ptr=0; // used to "initialize" the structs
int tmp;
std::cout << "Testing the Word97 structures..." << std::endl;
// Begin of writing test for DTTM
std::cout << "Testing writing for DTTM: ";
DTTM dttm1;
// Initilaize the struct with random data
tmp=sizeof(DTTM)/sizeof(int);
ptr=reinterpret_cast<int*>( &dttm1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(DTTM) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(dttm1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
dttm1.dump();
// End of writing test for DTTM
// Begin of writing test for DOPTYPOGRAPHY
std::cout << "Testing writing for DOPTYPOGRAPHY: ";
DOPTYPOGRAPHY doptypography1;
// Initilaize the struct with random data
tmp=sizeof(DOPTYPOGRAPHY)/sizeof(int);
ptr=reinterpret_cast<int*>( &doptypography1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(DOPTYPOGRAPHY) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(doptypography1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for DOPTYPOGRAPHY
// Begin of writing test for PRM2
std::cout << "Testing writing for PRM2: ";
PRM2 prm21;
// Initilaize the struct with random data
tmp=sizeof(PRM2)/sizeof(int);
ptr=reinterpret_cast<int*>( &prm21 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(PRM2) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(prm21.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for PRM2
// Begin of writing test for PRM
std::cout << "Testing writing for PRM: ";
PRM prm1;
// Initilaize the struct with random data
tmp=sizeof(PRM)/sizeof(int);
ptr=reinterpret_cast<int*>( &prm1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(PRM) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(prm1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for PRM
// Begin of writing test for SHD
std::cout << "Testing writing for SHD: ";
SHD shd1;
// Initilaize the struct with random data
tmp=sizeof(SHD)/sizeof(int);
ptr=reinterpret_cast<int*>( &shd1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(SHD) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(shd1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
shd1.dump();
// End of writing test for SHD
// Begin of writing test for PHE
std::cout << "Testing writing for PHE: ";
PHE phe1;
// Initilaize the struct with random data
tmp=sizeof(PHE)/sizeof(int);
ptr=reinterpret_cast<int*>( &phe1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(PHE) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(phe1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
phe1.dump();
// End of writing test for PHE
// Begin of writing test for BRC
std::cout << "Testing writing for BRC: ";
BRC brc1;
// Initilaize the struct with random data
tmp=sizeof(BRC)/sizeof(int);
ptr=reinterpret_cast<int*>( &brc1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(BRC) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(brc1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
brc1.dump();
// End of writing test for BRC
// Begin of writing test for TLP
std::cout << "Testing writing for TLP: ";
TLP tlp1;
// Initilaize the struct with random data
tmp=sizeof(TLP)/sizeof(int);
ptr=reinterpret_cast<int*>( &tlp1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(TLP) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(tlp1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
tlp1.dump();
// End of writing test for TLP
// Begin of writing test for TC
std::cout << "Testing writing for TC: ";
TC tc1;
// Initilaize the struct with random data
tmp=sizeof(TC)/sizeof(int);
ptr=reinterpret_cast<int*>( &tc1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(TC) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(tc1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
tc1.dump();
// End of writing test for TC
// Begin of writing test for ANLD
std::cout << "Testing writing for ANLD: ";
ANLD anld1;
// Initilaize the struct with random data
tmp=sizeof(ANLD)/sizeof(int);
ptr=reinterpret_cast<int*>( &anld1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(ANLD) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(anld1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
anld1.dump();
// End of writing test for ANLD
// Begin of writing test for ANLV
std::cout << "Testing writing for ANLV: ";
ANLV anlv1;
// Initilaize the struct with random data
tmp=sizeof(ANLV)/sizeof(int);
ptr=reinterpret_cast<int*>( &anlv1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(ANLV) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(anlv1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
anlv1.dump();
// End of writing test for ANLV
// Begin of writing test for ASUMY
std::cout << "Testing writing for ASUMY: ";
ASUMY asumy1;
// Initilaize the struct with random data
tmp=sizeof(ASUMY)/sizeof(int);
ptr=reinterpret_cast<int*>( &asumy1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(ASUMY) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(asumy1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for ASUMY
// Begin of writing test for ASUMYI
std::cout << "Testing writing for ASUMYI: ";
ASUMYI asumyi1;
// Initilaize the struct with random data
tmp=sizeof(ASUMYI)/sizeof(int);
ptr=reinterpret_cast<int*>( &asumyi1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(ASUMYI) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(asumyi1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for ASUMYI
// Begin of writing test for ATRD
std::cout << "Testing writing for ATRD: ";
ATRD atrd1;
// Initilaize the struct with random data
tmp=sizeof(ATRD)/sizeof(int);
ptr=reinterpret_cast<int*>( &atrd1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(ATRD) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(atrd1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for ATRD
// Begin of writing test for BKD
std::cout << "Testing writing for BKD: ";
BKD bkd1;
// Initilaize the struct with random data
tmp=sizeof(BKD)/sizeof(int);
ptr=reinterpret_cast<int*>( &bkd1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(BKD) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(bkd1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for BKD
// Begin of writing test for BKF
std::cout << "Testing writing for BKF: ";
BKF bkf1;
// Initilaize the struct with random data
tmp=sizeof(BKF)/sizeof(int);
ptr=reinterpret_cast<int*>( &bkf1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(BKF) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(bkf1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for BKF
// Begin of writing test for BKL
std::cout << "Testing writing for BKL: ";
BKL bkl1;
// Initilaize the struct with random data
tmp=sizeof(BKL)/sizeof(int);
ptr=reinterpret_cast<int*>( &bkl1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(BKL) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(bkl1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for BKL
// Begin of writing test for BRC10
std::cout << "Testing writing for BRC10: ";
BRC10 brc101;
// Initilaize the struct with random data
tmp=sizeof(BRC10)/sizeof(int);
ptr=reinterpret_cast<int*>( &brc101 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(BRC10) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(brc101.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for BRC10
// Begin of writing test for BTE
std::cout << "Testing writing for BTE: ";
BTE bte1;
// Initilaize the struct with random data
tmp=sizeof(BTE)/sizeof(int);
ptr=reinterpret_cast<int*>( &bte1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(BTE) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(bte1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for BTE
// Begin of writing test for CHP
std::cout << "Testing writing for CHP: ";
CHP chp1;
// Initilaize the struct with random data
tmp=sizeof(CHP)/sizeof(int);
ptr=reinterpret_cast<int*>( &chp1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(CHP) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(chp1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
chp1.dump();
// End of writing test for CHP
// Begin of writing test for DCS
std::cout << "Testing writing for DCS: ";
DCS dcs1;
// Initilaize the struct with random data
tmp=sizeof(DCS)/sizeof(int);
ptr=reinterpret_cast<int*>( &dcs1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(DCS) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(dcs1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
dcs1.dump();
// End of writing test for DCS
// Begin of writing test for DOGRID
std::cout << "Testing writing for DOGRID: ";
DOGRID dogrid1;
// Initilaize the struct with random data
tmp=sizeof(DOGRID)/sizeof(int);
ptr=reinterpret_cast<int*>( &dogrid1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(DOGRID) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(dogrid1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for DOGRID
// Begin of writing test for DOP
std::cout << "Testing writing for DOP: ";
DOP dop1;
// Initilaize the struct with random data
tmp=sizeof(DOP)/sizeof(int);
ptr=reinterpret_cast<int*>( &dop1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(DOP) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(dop1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for DOP
// Begin of writing test for FIB
std::cout << "Testing writing for FIB: ";
FIB fib1;
// Initilaize the struct with random data
tmp=sizeof(FIB)/sizeof(int);
ptr=reinterpret_cast<int*>( &fib1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(FIB) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(fib1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for FIB
// Begin of writing test for FIBFCLCB
std::cout << "Testing writing for FIBFCLCB: ";
FIBFCLCB fibfclcb1;
// Initilaize the struct with random data
tmp=sizeof(FIBFCLCB)/sizeof(int);
ptr=reinterpret_cast<int*>( &fibfclcb1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(FIBFCLCB) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(fibfclcb1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for FIBFCLCB
// Begin of writing test for FRD
std::cout << "Testing writing for FRD: ";
FRD frd1;
// Initilaize the struct with random data
tmp=sizeof(FRD)/sizeof(int);
ptr=reinterpret_cast<int*>( &frd1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(FRD) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(frd1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for FRD
// Begin of writing test for FSPA
std::cout << "Testing writing for FSPA: ";
FSPA fspa1;
// Initilaize the struct with random data
tmp=sizeof(FSPA)/sizeof(int);
ptr=reinterpret_cast<int*>( &fspa1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(FSPA) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(fspa1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for FSPA
// Begin of writing test for FTXBXS
std::cout << "Testing writing for FTXBXS: ";
FTXBXS ftxbxs1;
// Initilaize the struct with random data
tmp=sizeof(FTXBXS)/sizeof(int);
ptr=reinterpret_cast<int*>( &ftxbxs1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(FTXBXS) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(ftxbxs1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for FTXBXS
// Begin of writing test for LFO
std::cout << "Testing writing for LFO: ";
LFO lfo1;
// Initilaize the struct with random data
tmp=sizeof(LFO)/sizeof(int);
ptr=reinterpret_cast<int*>( &lfo1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(LFO) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(lfo1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for LFO
// Begin of writing test for LFOLVL
std::cout << "Testing writing for LFOLVL: ";
LFOLVL lfolvl1;
// Initilaize the struct with random data
tmp=sizeof(LFOLVL)/sizeof(int);
ptr=reinterpret_cast<int*>( &lfolvl1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(LFOLVL) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(lfolvl1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for LFOLVL
// Begin of writing test for LSPD
std::cout << "Testing writing for LSPD: ";
LSPD lspd1;
// Initilaize the struct with random data
tmp=sizeof(LSPD)/sizeof(int);
ptr=reinterpret_cast<int*>( &lspd1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(LSPD) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(lspd1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
lspd1.dump();
// End of writing test for LSPD
// Begin of writing test for LSTF
std::cout << "Testing writing for LSTF: ";
LSTF lstf1;
// Initilaize the struct with random data
tmp=sizeof(LSTF)/sizeof(int);
ptr=reinterpret_cast<int*>( &lstf1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(LSTF) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(lstf1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for LSTF
// Begin of writing test for LVLF
std::cout << "Testing writing for LVLF: ";
LVLF lvlf1;
// Initilaize the struct with random data
tmp=sizeof(LVLF)/sizeof(int);
ptr=reinterpret_cast<int*>( &lvlf1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(LVLF) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(lvlf1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for LVLF
// Begin of writing test for METAFILEPICT
std::cout << "Testing writing for METAFILEPICT: ";
METAFILEPICT metafilepict1;
// Initilaize the struct with random data
tmp=sizeof(METAFILEPICT)/sizeof(int);
ptr=reinterpret_cast<int*>( &metafilepict1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(METAFILEPICT) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(metafilepict1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for METAFILEPICT
// Begin of writing test for NUMRM
std::cout << "Testing writing for NUMRM: ";
NUMRM numrm1;
// Initilaize the struct with random data
tmp=sizeof(NUMRM)/sizeof(int);
ptr=reinterpret_cast<int*>( &numrm1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(NUMRM) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(numrm1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
numrm1.dump();
// End of writing test for NUMRM
// Begin of writing test for OBJHEADER
std::cout << "Testing writing for OBJHEADER: ";
OBJHEADER objheader1;
// Initilaize the struct with random data
tmp=sizeof(OBJHEADER)/sizeof(int);
ptr=reinterpret_cast<int*>( &objheader1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(OBJHEADER) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(objheader1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for OBJHEADER
// Begin of writing test for OLST
std::cout << "Testing writing for OLST: ";
OLST olst1;
// Initilaize the struct with random data
tmp=sizeof(OLST)/sizeof(int);
ptr=reinterpret_cast<int*>( &olst1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(OLST) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(olst1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
olst1.dump();
// End of writing test for OLST
// Begin of writing test for PCD
std::cout << "Testing writing for PCD: ";
PCD pcd1;
// Initilaize the struct with random data
tmp=sizeof(PCD)/sizeof(int);
ptr=reinterpret_cast<int*>( &pcd1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(PCD) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(pcd1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for PCD
// Begin of writing test for PGD
std::cout << "Testing writing for PGD: ";
PGD pgd1;
// Initilaize the struct with random data
tmp=sizeof(PGD)/sizeof(int);
ptr=reinterpret_cast<int*>( &pgd1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(PGD) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(pgd1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for PGD
// Begin of writing test for PHE2
std::cout << "Testing writing for PHE2: ";
PHE2 phe21;
// Initilaize the struct with random data
tmp=sizeof(PHE2)/sizeof(int);
ptr=reinterpret_cast<int*>( &phe21 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(PHE2) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(phe21.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for PHE2
// Begin of writing test for PICF
std::cout << "Testing writing for PICF: ";
PICF picf1;
// Initilaize the struct with random data
tmp=sizeof(PICF)/sizeof(int);
ptr=reinterpret_cast<int*>( &picf1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(PICF) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(picf1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for PICF
// Begin of writing test for RR
std::cout << "Testing writing for RR: ";
RR rr1;
// Initilaize the struct with random data
tmp=sizeof(RR)/sizeof(int);
ptr=reinterpret_cast<int*>( &rr1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(RR) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(rr1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for RR
// Begin of writing test for RS
std::cout << "Testing writing for RS: ";
RS rs1;
// Initilaize the struct with random data
tmp=sizeof(RS)/sizeof(int);
ptr=reinterpret_cast<int*>( &rs1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(RS) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(rs1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for RS
// Begin of writing test for SED
std::cout << "Testing writing for SED: ";
SED sed1;
// Initilaize the struct with random data
tmp=sizeof(SED)/sizeof(int);
ptr=reinterpret_cast<int*>( &sed1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(SED) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(sed1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for SED
std::cout << "Testing writing for SEPX:" << std::endl;
std::cout << " Sorry, testing dynamic structures isn't implemented,"
<< " yet." << std::endl;
// Begin of writing test for STSHI
std::cout << "Testing writing for STSHI: ";
STSHI stshi1;
// Initilaize the struct with random data
tmp=sizeof(STSHI)/sizeof(int);
ptr=reinterpret_cast<int*>( &stshi1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(STSHI) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(stshi1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for STSHI
// Begin of writing test for WKB
std::cout << "Testing writing for WKB: ";
WKB wkb1;
// Initilaize the struct with random data
tmp=sizeof(WKB)/sizeof(int);
ptr=reinterpret_cast<int*>( &wkb1 );
for(int _i=0; _i<tmp; ++_i)
*ptr++=rand();
*ptr |= rand() & (0x00ffffff >> (((sizeof(int)-1)-(sizeof(WKB) % sizeof(int)))*8)); // yay! :)
// and write it out...
if(wkb1.write(writer, false))
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of writing test for WKB
// Okay, close the stream writer and open it for reading...
int position=writer->tell(); // store the position for a check
delete writer;
storage.close();
if(!storage.open(OLEStorage::ReadOnly)) {
std::cout << "Error: Couldn't open the storage!" << std::endl;
::exit(1);
}
OLEStreamReader *reader=storage.createStreamReader("TestStream");
if(!reader || !reader->isValid()) {
std::cout << "Error: Couldn't open a stream for reading!" << std::endl;
::exit(1);
}
// Begin of reading test for DTTM
std::cout << "Testing reading for DTTM: ";
DTTM dttm2;
// Read the data from the stream
if(!dttm2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
DTTM dttm3(dttm2);
if(dttm1==dttm2 && dttm2==dttm3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for DTTM
// Begin of reading test for DOPTYPOGRAPHY
std::cout << "Testing reading for DOPTYPOGRAPHY: ";
DOPTYPOGRAPHY doptypography2;
// Read the data from the stream
if(!doptypography2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
DOPTYPOGRAPHY doptypography3(doptypography2);
if(doptypography1==doptypography2 && doptypography2==doptypography3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for DOPTYPOGRAPHY
// Begin of reading test for PRM2
std::cout << "Testing reading for PRM2: ";
PRM2 prm22;
// Read the data from the stream
if(!prm22.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
PRM2 prm23(prm22);
if(prm21==prm22 && prm22==prm23)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for PRM2
// Begin of reading test for PRM
std::cout << "Testing reading for PRM: ";
PRM prm2;
// Read the data from the stream
if(!prm2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
PRM prm3(prm2);
if(prm1==prm2 && prm2==prm3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for PRM
// Begin of reading test for SHD
std::cout << "Testing reading for SHD: ";
SHD shd2;
// Read the data from the stream
if(!shd2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
SHD shd3(shd2);
if(shd1==shd2 && shd2==shd3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for SHD
// Begin of reading test for PHE
std::cout << "Testing reading for PHE: ";
PHE phe2;
// Read the data from the stream
if(!phe2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
PHE phe3(phe2);
if(phe1==phe2 && phe2==phe3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for PHE
// Begin of reading test for BRC
std::cout << "Testing reading for BRC: ";
BRC brc2;
// Read the data from the stream
if(!brc2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
BRC brc3(brc2);
if(brc1==brc2 && brc2==brc3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for BRC
// Begin of reading test for TLP
std::cout << "Testing reading for TLP: ";
TLP tlp2;
// Read the data from the stream
if(!tlp2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
TLP tlp3(tlp2);
if(tlp1==tlp2 && tlp2==tlp3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for TLP
// Begin of reading test for TC
std::cout << "Testing reading for TC: ";
TC tc2;
// Read the data from the stream
if(!tc2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
TC tc3(tc2);
if(tc1==tc2 && tc2==tc3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for TC
// Begin of reading test for ANLD
std::cout << "Testing reading for ANLD: ";
ANLD anld2;
// Read the data from the stream
if(!anld2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
ANLD anld3(anld2);
if(anld1==anld2 && anld2==anld3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for ANLD
// Begin of reading test for ANLV
std::cout << "Testing reading for ANLV: ";
ANLV anlv2;
// Read the data from the stream
if(!anlv2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
ANLV anlv3(anlv2);
if(anlv1==anlv2 && anlv2==anlv3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for ANLV
// Begin of reading test for ASUMY
std::cout << "Testing reading for ASUMY: ";
ASUMY asumy2;
// Read the data from the stream
if(!asumy2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
ASUMY asumy3(asumy2);
if(asumy1==asumy2 && asumy2==asumy3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for ASUMY
// Begin of reading test for ASUMYI
std::cout << "Testing reading for ASUMYI: ";
ASUMYI asumyi2;
// Read the data from the stream
if(!asumyi2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
ASUMYI asumyi3(asumyi2);
if(asumyi1==asumyi2 && asumyi2==asumyi3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for ASUMYI
// Begin of reading test for ATRD
std::cout << "Testing reading for ATRD: ";
ATRD atrd2;
// Read the data from the stream
if(!atrd2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
ATRD atrd3(atrd2);
if(atrd1==atrd2 && atrd2==atrd3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for ATRD
// Begin of reading test for BKD
std::cout << "Testing reading for BKD: ";
BKD bkd2;
// Read the data from the stream
if(!bkd2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
BKD bkd3(bkd2);
if(bkd1==bkd2 && bkd2==bkd3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for BKD
// Begin of reading test for BKF
std::cout << "Testing reading for BKF: ";
BKF bkf2;
// Read the data from the stream
if(!bkf2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
BKF bkf3(bkf2);
if(bkf1==bkf2 && bkf2==bkf3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for BKF
// Begin of reading test for BKL
std::cout << "Testing reading for BKL: ";
BKL bkl2;
// Read the data from the stream
if(!bkl2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
BKL bkl3(bkl2);
if(bkl1==bkl2 && bkl2==bkl3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for BKL
// Begin of reading test for BRC10
std::cout << "Testing reading for BRC10: ";
BRC10 brc102;
// Read the data from the stream
if(!brc102.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
BRC10 brc103(brc102);
if(brc101==brc102 && brc102==brc103)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for BRC10
// Begin of reading test for BTE
std::cout << "Testing reading for BTE: ";
BTE bte2;
// Read the data from the stream
if(!bte2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
BTE bte3(bte2);
if(bte1==bte2 && bte2==bte3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for BTE
// Begin of reading test for CHP
std::cout << "Testing reading for CHP: ";
CHP chp2;
// Read the data from the stream
if(!chp2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
CHP chp3(chp2);
if(chp1==chp2 && chp2==chp3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for CHP
// Begin of reading test for DCS
std::cout << "Testing reading for DCS: ";
DCS dcs2;
// Read the data from the stream
if(!dcs2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
DCS dcs3(dcs2);
if(dcs1==dcs2 && dcs2==dcs3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for DCS
// Begin of reading test for DOGRID
std::cout << "Testing reading for DOGRID: ";
DOGRID dogrid2;
// Read the data from the stream
if(!dogrid2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
DOGRID dogrid3(dogrid2);
if(dogrid1==dogrid2 && dogrid2==dogrid3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for DOGRID
// Begin of reading test for DOP
std::cout << "Testing reading for DOP: ";
DOP dop2;
// Read the data from the stream
if(!dop2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
DOP dop3(dop2);
if(dop1==dop2 && dop2==dop3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for DOP
// Begin of reading test for FIB
std::cout << "Testing reading for FIB: ";
FIB fib2;
// Read the data from the stream
if(!fib2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
FIB fib3(fib2);
if(fib1==fib2 && fib2==fib3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for FIB
// Begin of reading test for FIBFCLCB
std::cout << "Testing reading for FIBFCLCB: ";
FIBFCLCB fibfclcb2;
// Read the data from the stream
if(!fibfclcb2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
FIBFCLCB fibfclcb3(fibfclcb2);
if(fibfclcb1==fibfclcb2 && fibfclcb2==fibfclcb3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for FIBFCLCB
// Begin of reading test for FRD
std::cout << "Testing reading for FRD: ";
FRD frd2;
// Read the data from the stream
if(!frd2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
FRD frd3(frd2);
if(frd1==frd2 && frd2==frd3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for FRD
// Begin of reading test for FSPA
std::cout << "Testing reading for FSPA: ";
FSPA fspa2;
// Read the data from the stream
if(!fspa2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
FSPA fspa3(fspa2);
if(fspa1==fspa2 && fspa2==fspa3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for FSPA
// Begin of reading test for FTXBXS
std::cout << "Testing reading for FTXBXS: ";
FTXBXS ftxbxs2;
// Read the data from the stream
if(!ftxbxs2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
FTXBXS ftxbxs3(ftxbxs2);
if(ftxbxs1==ftxbxs2 && ftxbxs2==ftxbxs3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for FTXBXS
// Begin of reading test for LFO
std::cout << "Testing reading for LFO: ";
LFO lfo2;
// Read the data from the stream
if(!lfo2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
LFO lfo3(lfo2);
if(lfo1==lfo2 && lfo2==lfo3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for LFO
// Begin of reading test for LFOLVL
std::cout << "Testing reading for LFOLVL: ";
LFOLVL lfolvl2;
// Read the data from the stream
if(!lfolvl2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
LFOLVL lfolvl3(lfolvl2);
if(lfolvl1==lfolvl2 && lfolvl2==lfolvl3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for LFOLVL
// Begin of reading test for LSPD
std::cout << "Testing reading for LSPD: ";
LSPD lspd2;
// Read the data from the stream
if(!lspd2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
LSPD lspd3(lspd2);
if(lspd1==lspd2 && lspd2==lspd3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for LSPD
// Begin of reading test for LSTF
std::cout << "Testing reading for LSTF: ";
LSTF lstf2;
// Read the data from the stream
if(!lstf2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
LSTF lstf3(lstf2);
if(lstf1==lstf2 && lstf2==lstf3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for LSTF
// Begin of reading test for LVLF
std::cout << "Testing reading for LVLF: ";
LVLF lvlf2;
// Read the data from the stream
if(!lvlf2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
LVLF lvlf3(lvlf2);
if(lvlf1==lvlf2 && lvlf2==lvlf3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for LVLF
// Begin of reading test for METAFILEPICT
std::cout << "Testing reading for METAFILEPICT: ";
METAFILEPICT metafilepict2;
// Read the data from the stream
if(!metafilepict2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
METAFILEPICT metafilepict3(metafilepict2);
if(metafilepict1==metafilepict2 && metafilepict2==metafilepict3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for METAFILEPICT
// Begin of reading test for NUMRM
std::cout << "Testing reading for NUMRM: ";
NUMRM numrm2;
// Read the data from the stream
if(!numrm2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
NUMRM numrm3(numrm2);
if(numrm1==numrm2 && numrm2==numrm3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for NUMRM
// Begin of reading test for OBJHEADER
std::cout << "Testing reading for OBJHEADER: ";
OBJHEADER objheader2;
// Read the data from the stream
if(!objheader2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
OBJHEADER objheader3(objheader2);
if(objheader1==objheader2 && objheader2==objheader3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for OBJHEADER
// Begin of reading test for OLST
std::cout << "Testing reading for OLST: ";
OLST olst2;
// Read the data from the stream
if(!olst2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
OLST olst3(olst2);
if(olst1==olst2 && olst2==olst3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for OLST
// Begin of reading test for PCD
std::cout << "Testing reading for PCD: ";
PCD pcd2;
// Read the data from the stream
if(!pcd2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
PCD pcd3(pcd2);
if(pcd1==pcd2 && pcd2==pcd3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for PCD
// Begin of reading test for PGD
std::cout << "Testing reading for PGD: ";
PGD pgd2;
// Read the data from the stream
if(!pgd2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
PGD pgd3(pgd2);
if(pgd1==pgd2 && pgd2==pgd3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for PGD
// Begin of reading test for PHE2
std::cout << "Testing reading for PHE2: ";
PHE2 phe22;
// Read the data from the stream
if(!phe22.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
PHE2 phe23(phe22);
if(phe21==phe22 && phe22==phe23)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for PHE2
// Begin of reading test for PICF
std::cout << "Testing reading for PICF: ";
PICF picf2;
// Read the data from the stream
if(!picf2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
PICF picf3(picf2);
if(picf1==picf2 && picf2==picf3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for PICF
// Begin of reading test for RR
std::cout << "Testing reading for RR: ";
RR rr2;
// Read the data from the stream
if(!rr2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
RR rr3(rr2);
if(rr1==rr2 && rr2==rr3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for RR
// Begin of reading test for RS
std::cout << "Testing reading for RS: ";
RS rs2;
// Read the data from the stream
if(!rs2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
RS rs3(rs2);
if(rs1==rs2 && rs2==rs3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for RS
// Begin of reading test for SED
std::cout << "Testing reading for SED: ";
SED sed2;
// Read the data from the stream
if(!sed2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
SED sed3(sed2);
if(sed1==sed2 && sed2==sed3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for SED
std::cout << "Testing reading for SEPX:" << std::endl;
std::cout << " Sorry, testing dynamic structures isn't implemented,"
<< " yet." << std::endl;
// Begin of reading test for STSHI
std::cout << "Testing reading for STSHI: ";
STSHI stshi2;
// Read the data from the stream
if(!stshi2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
STSHI stshi3(stshi2);
if(stshi1==stshi2 && stshi2==stshi3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for STSHI
// Begin of reading test for WKB
std::cout << "Testing reading for WKB: ";
WKB wkb2;
// Read the data from the stream
if(!wkb2.read(reader, false))
std::cout << "Failed. " << std::endl;
// Test the copy CTOR
WKB wkb3(wkb2);
if(wkb1==wkb2 && wkb2==wkb3)
std::cout << "Passed." << std::endl;
else
std::cout << "Failed." << std::endl;
// End of reading test for WKB
if(position!=reader->tell())
std::cout << "Error: Different amount of bytes read/written!" << std::endl;
delete reader;
std::cout << "Done." << std::endl;
// Clean up
storage.close();
}
|