mirror of
https://github.com/mandiant/capa.git
synced 2026-06-12 19:11:32 -07:00
RelativeVirtualAddress deprecation warning
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import warnings
|
||||
|
||||
import pytest
|
||||
|
||||
import capa.features.address
|
||||
@@ -23,6 +25,7 @@ from capa.features.address import (
|
||||
DynamicCallAddress,
|
||||
DNTokenOffsetAddress,
|
||||
AbsoluteVirtualAddress,
|
||||
RelativeVirtualAddress,
|
||||
)
|
||||
|
||||
ADDR1 = capa.features.address.AbsoluteVirtualAddress(0x401001)
|
||||
@@ -55,6 +58,13 @@ def test_no_address_hash():
|
||||
assert d[addr_zero] == "zero"
|
||||
|
||||
|
||||
def test_relative_address():
|
||||
with pytest.raises(DeprecationWarning):
|
||||
warnings.filterwarnings("error", category=DeprecationWarning)
|
||||
_ = RelativeVirtualAddress(0)
|
||||
warnings.resetwarnings()
|
||||
|
||||
|
||||
def test_dn_token_offset_address_cross_type_eq():
|
||||
addr = DNTokenOffsetAddress(0x1000, 0x10)
|
||||
assert (addr == AbsoluteVirtualAddress(0x1010)) is False
|
||||
|
||||
Reference in New Issue
Block a user