-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide tests for disabled idiom case
This case was created from issue: avast/retdec#724
- Loading branch information
Peter Kubov
committed
Aug 2, 2020
1 parent
0ebf790
commit 64b3c40
Showing
6 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,21 @@ | ||
// | ||
// Created from https://github.com/avast/retdec/issues/724 | ||
// Author: adahsuzixin | ||
// | ||
|
||
#include <stdio.h> | ||
|
||
char getSecondByte(long long a); | ||
|
||
int main(void) | ||
{ | ||
long long a; | ||
scanf("%llx", &a); | ||
char res = getSecondByte(a); | ||
printf("getSecondByte( %llx ) = %d\n",a,res); | ||
return res; | ||
} | ||
|
||
char getSecondByte(long long a) { | ||
return (a >> 8) & 0xff; | ||
} |
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,19 @@ | ||
# | ||
# Created from https://github.com/avast/retdec/issues/724 | ||
# Author: adahsuzixin | ||
# | ||
|
||
from regression_tests import * | ||
|
||
class TestBase(Test): | ||
def test_produce_expected_output(self): | ||
self.assert_c_produces_output_when_run( | ||
input='0xa5a5a5a5a5a50020', | ||
expected_output='getSecondByte( a5a5a5a5a5a50020 ) = 0\n', | ||
expected_return_code=0 | ||
) | ||
|
||
class Test_shiftOrDivide(TestBase): | ||
shiftOrDivide = TestSettings( | ||
input=files_in_dir('2020-08-02') | ||
) |