-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added missing testcase, reduce cases of defined but not used
- Loading branch information
1 parent
d301ea4
commit d43b4a2
Showing
3 changed files
with
54 additions
and
17 deletions.
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,10 @@ | ||
option varintbits=32; | ||
option intsize=32; | ||
|
||
message xint | ||
{ | ||
int8 i8 = 1; | ||
int16 i16 = 2; | ||
sint8 s8 = 3; | ||
sint16 s16 = 4; | ||
} |
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,33 @@ | ||
#include "xint.h" | ||
#include <assert.h> | ||
#include "runcheck.h" | ||
#include "runcheck.cpp" | ||
|
||
|
||
int main() | ||
{ | ||
xint x; | ||
x.set_i8(-1); | ||
x.set_i16(-1); | ||
x.set_s8(-1); | ||
x.set_s16(-1); | ||
runcheck(x); | ||
|
||
x.set_i8(1); | ||
x.set_i16(1); | ||
x.set_s8(1); | ||
x.set_s16(1); | ||
runcheck(x); | ||
|
||
x.set_i8(INT8_MAX); | ||
x.set_i16(INT16_MAX); | ||
x.set_s8(INT8_MAX); | ||
x.set_s16(INT16_MAX); | ||
runcheck(x); | ||
|
||
x.set_i8(INT8_MIN); | ||
x.set_i16(INT16_MIN); | ||
x.set_s8(INT8_MIN); | ||
x.set_s16(INT16_MIN); | ||
runcheck(x); | ||
} |