This commit is contained in:
alex
2017-12-12 12:24:44 -08:00
4 changed files with 47 additions and 39 deletions
+26 -28
View File
@@ -30,35 +30,33 @@ TEST(OneOfExample, ProduceSixtyOrHigher) {
// Add this back in and uncomment out choices parts below, add
// & choices, N to captures, and it becomes quite difficult.
int N = 0;
while (N < LENGTH) {
N++;
for (int N = 0;N < LENGTH; N++) {
OneOf(
[&x] {
x += 1;
printf("-1\n");
//choices[N] = '+';
},
[&x] {
x -= 1;
printf("+1\n");
//choices[N] = '-';
},
[&x] {
x *= 2;
printf("*2\n");
//choices[N] = '2';
},
[&x] {
x += 10;
printf("+=10\n");
//choices[N] = 'x';
},
[&x] {
x = 0;
printf("=0\n");
//choices[N] = '0';
});
[&x] {
x += 1;
printf("+=1\n");
//choices[N] = '+';
},
[&x] {
x -= 1;
printf("-=1\n");
//choices[N] = '-';
},
[&x] {
x *= 2;
printf("*2\n");
//choices[N] = '2';
},
[&x] {
x += 10;
printf("+=10\n");
//choices[N] = 'x';
},
[&x] {
x = 0;
printf("=0\n");
//choices[N] = '0';
});
//choices[N+1] = 0;
ASSERT_LE(x, 60)
+3 -2
View File
@@ -15,7 +15,7 @@
*/
#include <deepstate/DeepState.hpp>
/*
TEST(Streaming, BasicLevels) {
LOG(DEBUG) << "This is a debug message";
LOG(INFO) << "This is an info message";
@@ -32,11 +32,12 @@ TEST(Streaming, BasicTypes) {
LOG(INFO) << "string";
LOG(INFO) << nullptr;
}
*/
TEST(Formatting, OverridePrintf) {
printf("hello string=%s hex_lower=%x hex_upper=%X octal=%o char=%c dec=%d"
"double=%f sci=%e SCI=%E pointer=%p",
"world", 999, 999, 999, 'a', 999, 999.0, 999.0, 999.0, "world");
printf("hello again!");
}
int main(void) {