Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Keystone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Third Party Mirrors
Keystone
Commits
3765156a
Commit
3765156a
authored
8 years ago
by
Nguyen Anh Quynh
Browse files
Options
Downloads
Patches
Plain Diff
regress: fix x86_mem_size.py so that it works
parent
76588769
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
suite/regress/x86_mem_size.py
+26
-26
26 additions, 26 deletions
suite/regress/x86_mem_size.py
with
26 additions
and
26 deletions
suite/regress/x86_mem_size.py
100644 → 100755
+
26
−
26
View file @
3765156a
#!/usr/bin/python
# Github issue: #73
# Author: fvrmatteo
# Description: missing memory size indicator
from
keystone
import
*
import
regress
class
TestX86
(
regress
.
RegressTest
):
def
runTest
(
self
):
# Initialize Keystone engine
ks
=
Ks
(
KS_ARCH_X86
,
KS_MODE_32
)
try
:
# Assemble to get back insn encoding & statement count
encoding
,
count
=
ks
.
asm
(
b
"
add ptr ss:[eax + ebx], 0x777
"
)
expect
KsError
as
e
:
if
e
.
errno
==
KS_ERR_ASM_INVALIDOPERAND
:
print
(
"
Got error KS_ERR_ASM_INVALIDOPERAND as expected
"
)
else
self
.
assertFalse
(
1
,
"
ERROR: %s
"
%
e
)
if
__name__
==
'
__main__
'
regress
.
main
()
\ No newline at end of file
#!/usr/bin/python
# Github issue: #73
# Author: fvrmatteo
# Description: missing memory size indicator
from
keystone
import
*
import
regress
class
TestX86
(
regress
.
RegressTest
):
def
runTest
(
self
):
# Initialize Keystone engine
ks
=
Ks
(
KS_ARCH_X86
,
KS_MODE_32
)
try
:
# Assemble to get back insn encoding & statement count
encoding
,
count
=
ks
.
asm
(
b
"
add ptr ss:[eax + ebx], 0x777
"
)
except
KsError
as
e
:
if
e
.
errno
==
KS_ERR_ASM_INVALIDOPERAND
:
print
(
"
Got error KS_ERR_ASM_INVALIDOPERAND as expected
"
)
else
:
self
.
assertFalse
(
1
,
"
ERROR: %s
"
%
e
)
if
__name__
==
'
__main__
'
:
regress
.
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment