-
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.
using standard integer types; explicit overflow checking
- Loading branch information
Steve Donovan
committed
Mar 29, 2016
1 parent
a76adab
commit bcb3051
Showing
4 changed files
with
152 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "outstream.h" | ||
#include "instream.h" | ||
using namespace std; | ||
|
||
void test(const char *str) { | ||
Reader::Error err; | ||
int res = 0; | ||
double x = 0; | ||
string s; | ||
short b = 0; | ||
|
||
outs("input")(str)(); | ||
//~ Writer("/tmp/tmp.tmp")(str); | ||
//~ Reader s1("/tmp/tmp.tmp"); | ||
StrReader s1(str); | ||
s1 (res)(x)(s)(b)(err); | ||
outs("output")(res)(x)(s)(b)(); | ||
outs("error")(err.msg)(); | ||
|
||
} | ||
|
||
int main() | ||
{ | ||
outs.sep(' '); // DEFAULT | ||
|
||
test("10 4.2 boo 34"); | ||
test("10 4.2 boo 344455555"); | ||
test("10 x4.2 boo 23"); | ||
test("x10 4.2 boo 52"); | ||
test("10 4.2"); | ||
|
||
return 0; | ||
} |
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
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