RelativeVirtualAddress deprecation warning

This commit is contained in:
Ange Albertini
2026-05-28 13:09:53 +00:00
parent 3eada453e5
commit 61c24ebcbb
2 changed files with 19 additions and 0 deletions
+10
View File
@@ -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