-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from espressif/fix/negative_int_for_soc_header
fix: negative value for soc caps integer
- Loading branch information
Showing
2 changed files
with
22 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import pytest | ||
|
||
from idf_build_apps.manifest.soc_header import parse_define | ||
|
||
|
||
@pytest.mark.parametrize( | ||
's, res', | ||
[ | ||
('#define SOC_FOO (4)', '4'), | ||
('#define SOC_FOO (-4)', '-4'), | ||
('#define SOC_FOO 4', '4'), | ||
('#define SOC_FOO -4', '-4'), | ||
], | ||
) | ||
def test_parse_define_int(s, res): | ||
parse_result = parse_define(s) | ||
assert parse_result['name'] == 'SOC_FOO' | ||
assert parse_result['int_value'] == res |
ac74ba1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report