-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(script): vm_version should be correct after resuming from snapshot
- Loading branch information
1 parent
d987413
commit bd24f17
Showing
4 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "ckb_syscalls.h" | ||
|
||
#ifdef DEBUG | ||
#include <stdio.h> | ||
#else | ||
#define ckb_debug(...) | ||
#define sprintf(...) | ||
#endif | ||
|
||
void try_pause() { | ||
syscall(2178, 0, 0, 0, 0, 0, 0); | ||
} | ||
|
||
int vm_version() { | ||
return syscall(2041, 0, 0, 0, 0, 0, 0); | ||
} | ||
|
||
int main() { | ||
#ifdef DEBUG | ||
char message[2048]; | ||
#endif | ||
int ver; | ||
for (int i=0; i<4096; i++) { | ||
ver = vm_version(); | ||
sprintf(message, "version = %d", ver); ckb_debug(message); | ||
if (i > 16) { | ||
try_pause(); | ||
} | ||
if (ver != 1) { | ||
return -1; | ||
} | ||
} | ||
return CKB_SUCCESS; | ||
} |