Changeset 21793 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jul 25, 2009 11:14:38 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 50396
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/tstSSM.cpp
r21787 r21793 45 45 46 46 47 const uint8_t gabPage[PAGE_SIZE] = {0}; 48 49 const char gachMem1[] = "sdfg\1asdfa\177hjkl;sdfghjkl;dfghjkl;dfghjkl;\0\0asdf;kjasdf;lkjasd;flkjasd;lfkjasd\0;lfk"; 50 51 uint8_t gabBigMem[8*1024*1024]; 47 /******************************************************************************* 48 * Defined Constants And Macros * 49 *******************************************************************************/ 50 #define TSTSSM_BIG_CONFIG 1 51 52 #ifdef TSTSSM_BIG_CONFIG 53 # define TSTSSM_ITEM_SIZE (512*_1M) 54 #else 55 # define TSTSSM_ITEM_SIZE (5*_1M) 56 #endif 57 58 59 /******************************************************************************* 60 * Global Variables * 61 *******************************************************************************/ 62 const uint8_t gabPage[PAGE_SIZE] = {0}; 63 const char gachMem1[] = "sdfg\1asdfa\177hjkl;sdfghjkl;dfghjkl;dfghjkl;\0\0asdf;kjasdf;lkjasd;flkjasd;lfkjasd\0;lfk"; 64 #ifdef TSTSSM_BIG_CONFIG 65 uint8_t gabBigMem[_1M]; 66 #else 67 uint8_t gabBigMem[8*_1M]; 68 #endif 69 52 70 53 71 /** initializes gabBigMem with some non zero stuff. */ … … 167 185 DECLCALLBACK(int) Item01Load(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t u32Version) 168 186 { 187 if (u32Version != 0) 188 { 189 RTPrintf("Item01: u32Version=%#x, expected 0\n", u32Version); 190 return VERR_GENERAL_FAILURE; 191 } 192 169 193 /* 170 194 * Load the memory block. … … 315 339 DECLCALLBACK(int) Item02Load(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t u32Version) 316 340 { 341 if (u32Version != 0) 342 { 343 RTPrintf("Item02: u32Version=%#x, expected 0\n", u32Version); 344 return VERR_GENERAL_FAILURE; 345 } 346 317 347 /* 318 348 * Load the size. … … 379 409 * Put the size. 380 410 */ 381 uint32_t cb = 512*_1M;411 uint32_t cb = TSTSSM_ITEM_SIZE; 382 412 int rc = SSMR3PutU32(pSSM, cb); 383 413 if (RT_FAILURE(rc)) … … 421 451 DECLCALLBACK(int) Item03Load(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t u32Version) 422 452 { 453 if (u32Version != 123) 454 { 455 RTPrintf("Item03: u32Version=%#x, expected 123\n", u32Version); 456 return VERR_GENERAL_FAILURE; 457 } 458 423 459 /* 424 460 * Load the size. … … 431 467 return rc; 432 468 } 433 if (cb != 512*_1M)434 { 435 RTPrintf("Item03: loaded size doesn't match the real thing. %#x != %#x\n", cb, 512*_1M);469 if (cb != TSTSSM_ITEM_SIZE) 470 { 471 RTPrintf("Item03: loaded size doesn't match the real thing. %#x != %#x\n", cb, TSTSSM_ITEM_SIZE); 436 472 return VERR_GENERAL_FAILURE; 437 473 } … … 447 483 if (RT_FAILURE(rc)) 448 484 { 449 RTPrintf("Item03: SSMR3GetMem(,,%#x) -> %Rrc offset %#x\n", PAGE_SIZE, rc, 512*_1M- cb);485 RTPrintf("Item03: SSMR3GetMem(,,%#x) -> %Rrc offset %#x\n", PAGE_SIZE, rc, TSTSSM_ITEM_SIZE - cb); 450 486 return rc; 451 487 } 452 488 if (memcmp(achPage, pu8Org, PAGE_SIZE)) 453 489 { 454 RTPrintf("Item03: compare failed. mem offset=%#x\n", 512*_1M- cb);490 RTPrintf("Item03: compare failed. mem offset=%#x\n", TSTSSM_ITEM_SIZE - cb); 455 491 return VERR_GENERAL_FAILURE; 456 492 } … … 519 555 DECLCALLBACK(int) Item04Load(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t u32Version) 520 556 { 557 if (u32Version != 42) 558 { 559 RTPrintf("Item04: u32Version=%#x, expected 42\n", u32Version); 560 return VERR_GENERAL_FAILURE; 561 } 562 521 563 /* 522 564 * Load the size. … … 707 749 return 1; 708 750 } 709 RTPrintf("tstSSM: file size % RI64 bytes\n", Info.cbObject);751 RTPrintf("tstSSM: file size %'RI64 bytes\n", Info.cbObject); 710 752 711 753 /* … … 770 812 RTPrintf("tstSSM: Failed seek in %'RI64 ns\n", u64Elapsed); 771 813 814 /* another negative, now only the instance number isn't matching. */ 815 rc = SSMR3Seek(pSSM, "SSM Testcase Data Item no.2 (rand mem)", 0, NULL); 816 if (rc != VERR_SSM_UNIT_NOT_FOUND) 817 { 818 RTPrintf("SSMR3Seek #1 unit 2 -> %Rrc\n", rc); 819 return 1; 820 } 821 772 822 /* 2nd unit */ 773 rc = SSMR3Seek(pSSM, "SSM Testcase Data Item no.2 (rand mem)", 0, NULL);774 if (RT_FAILURE(rc)) 775 { 776 RTPrintf("SSMR3Seek #1 unit 2 -> %Rrc\n", rc);823 rc = SSMR3Seek(pSSM, "SSM Testcase Data Item no.2 (rand mem)", 2, NULL); 824 if (RT_FAILURE(rc)) 825 { 826 RTPrintf("SSMR3Seek #1 unit 2 -> %Rrc [2]\n", rc); 777 827 return 1; 778 828 } 779 829 uint32_t u32Version = 0xbadc0ded; 780 rc = SSMR3Seek(pSSM, "SSM Testcase Data Item no.2 (rand mem)", 0, &u32Version);781 if (RT_FAILURE(rc)) 782 { 783 RTPrintf("SSMR3Seek #1 unit 2 -> %Rrc\n", rc);830 rc = SSMR3Seek(pSSM, "SSM Testcase Data Item no.2 (rand mem)", 2, &u32Version); 831 if (RT_FAILURE(rc)) 832 { 833 RTPrintf("SSMR3Seek #1 unit 2 -> %Rrc [3]\n", rc); 784 834 return 1; 785 835 } … … 796 846 /* 1st unit */ 797 847 u32Version = 0xbadc0ded; 798 rc = SSMR3Seek(pSSM, "SSM Testcase Data Item no.1 (all types)", 0, &u32Version);848 rc = SSMR3Seek(pSSM, "SSM Testcase Data Item no.1 (all types)", 1, &u32Version); 799 849 if (RT_FAILURE(rc)) 800 850 { … … 814 864 /* 3st unit */ 815 865 u32Version = 0xbadc0ded; 816 rc = SSMR3Seek(pSSM, "SSM Testcase Data Item no.3 (big mem)", 123, &u32Version);866 rc = SSMR3Seek(pSSM, "SSM Testcase Data Item no.3 (big mem)", 0, &u32Version); 817 867 if (RT_FAILURE(rc)) 818 868 {
Note:
See TracChangeset
for help on using the changeset viewer.