Skip to content

Commit c3f7bca

Browse files
authored
qtest: parse "status" key from qtest inputs (#164)
1 parent 8d8cbb8 commit c3f7bca

40 files changed

+540
-285
lines changed

pctest/test_qset.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ int main( int argc,char** argv )
140140
uint32_t qt =pt.find_val( 1, "quotes" );
141141
for( uint32_t it = pt.get_first( qt ); it; it = pt.get_next( it ) ) {
142142
pc_price_comp_t *ptr = &px->comp_[px->num_++];
143-
ptr->latest_.status_ = PC_STATUS_TRADING;
143+
ptr->latest_.status_ = pt.get_int( pt.find_val( it, "status" ) );
144144
ptr->latest_.price_ = pt.get_int( pt.find_val( it, "price" ) );
145145
int64_t conf = pt.get_int( pt.find_val( it, "conf" ) );
146146
assert( conf >= 0 );

pyth/tests/qset/1.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
"quotes": [
44
{
55
"price": 10000,
6-
"conf": 1000
6+
"conf": 1000,
7+
"status": 1,
78
},
89
{
910
"price": 10000,
10-
"conf": 1000
11+
"conf": 1000,
12+
"status": 1,
1113
},
1214
{
1315
"price": 10000,
14-
"conf": 1000
16+
"conf": 1000,
17+
"status": 1,
1518
}
1619
]
17-
}
20+
}

pyth/tests/qset/10.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
"quotes": [
44
{
55
"price": 500000,
6-
"conf": 10
6+
"conf": 10,
7+
"status": 1
78
},
89
{
910
"price": 501000,
10-
"conf": 20
11+
"conf": 20,
12+
"status": 1
1113
},
1214
{
1315
"price": 500000000000,
14-
"conf": 10000000
16+
"conf": 10000000,
17+
"status": 1
1518
}
1619
]
17-
}
20+
}

pyth/tests/qset/11.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
"quotes": [
44
{
55
"price": 500000,
6-
"conf": 10
6+
"conf": 10,
7+
"status": 1
78
},
89
{
910
"price": 501000000000,
10-
"conf": 10000000
11+
"conf": 10000000,
12+
"status": 1
1113
},
1214
{
1315
"price": 500000000000,
14-
"conf": 20000000
16+
"conf": 20000000,
17+
"status": 1
1518
}
1619
]
17-
}
20+
}

pyth/tests/qset/12.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,23 @@
33
"quotes": [
44
{
55
"price": 10010000,
6-
"conf": 10
6+
"conf": 10,
7+
"status": 1
78
},
89
{
910
"price": 10010020,
10-
"conf": 10
11+
"conf": 10,
12+
"status": 1
1113
},
1214
{
1315
"price": 10011000,
14-
"conf": 10
16+
"conf": 10,
17+
"status": 1
1518
},
1619
{
1720
"price": 10011020,
18-
"conf": 10
21+
"conf": 10,
22+
"status": 1
1923
}
2024
]
21-
}
25+
}

pyth/tests/qset/13.json

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,73 @@
33
"quotes": [
44
{
55
"price": 10000,
6-
"conf": 10
6+
"conf": 10,
7+
"status": 1
78
},
89
{
910
"price": 10020,
10-
"conf": 100
11+
"conf": 100,
12+
"status": 1
1113
},
1214
{
1315
"price": 11000,
14-
"conf": 10
16+
"conf": 10,
17+
"status": 1
1518
},
1619
{
1720
"price": 11020,
18-
"conf": 100
21+
"conf": 100,
22+
"status": 1
1923
},
2024
{
2125
"price": 12000,
22-
"conf": 10
26+
"conf": 10,
27+
"status": 1
2328
},
2429
{
2530
"price": 12020,
26-
"conf": 100
31+
"conf": 100,
32+
"status": 1
2733
},
2834
{
2935
"price": 13000,
30-
"conf": 10
36+
"conf": 10,
37+
"status": 1
3138
},
3239
{
3340
"price": 13020,
34-
"conf": 100
41+
"conf": 100,
42+
"status": 1
3543
},
3644
{
3745
"price": 14000,
38-
"conf": 10
46+
"conf": 10,
47+
"status": 1
3948
},
4049
{
4150
"price": 14020,
42-
"conf": 100
51+
"conf": 100,
52+
"status": 1
4353
},
4454
{
4555
"price": 15000,
46-
"conf": 10
56+
"conf": 10,
57+
"status": 1
4758
},
4859
{
4960
"price": 15020,
50-
"conf": 100
61+
"conf": 100,
62+
"status": 1
5163
},
5264
{
5365
"price": 16000,
54-
"conf": 10
66+
"conf": 10,
67+
"status": 1
5568
},
5669
{
5770
"price": 16020,
58-
"conf": 100
71+
"conf": 100,
72+
"status": 1
5973
}
6074
]
61-
}
75+
}

pyth/tests/qset/14.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,28 @@
33
"quotes": [
44
{
55
"price": 10000,
6-
"conf": 10
6+
"conf": 10,
7+
"status": 1
78
},
89
{
910
"price": 10010,
10-
"conf": 10
11+
"conf": 10,
12+
"status": 1
1113
},
1214
{
1315
"price": 11000,
14-
"conf": 10
16+
"conf": 10,
17+
"status": 1
1518
},
1619
{
1720
"price": 11010,
18-
"conf": 10
21+
"conf": 10,
22+
"status": 1
1923
},
2024
{
2125
"price": 11500,
22-
"conf": 100
26+
"conf": 100,
27+
"status": 1
2328
}
2429
]
25-
}
30+
}

pyth/tests/qset/15.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,38 @@
33
"quotes": [
44
{
55
"price": 10000,
6-
"conf": 1000
6+
"conf": 1000,
7+
"status": 1
78
},
89
{
910
"price": 11000,
10-
"conf": 1000
11+
"conf": 1000,
12+
"status": 1
1113
},
1214
{
1315
"price": 12000,
14-
"conf": 1000
16+
"conf": 1000,
17+
"status": 1
1518
},
1619
{
1720
"price": 13000,
18-
"conf": 1000
21+
"conf": 1000,
22+
"status": 1
1923
},
2024
{
2125
"price": 14000,
22-
"conf": 1000
26+
"conf": 1000,
27+
"status": 1
2328
},
2429
{
2530
"price": 15000,
26-
"conf": 1000
31+
"conf": 1000,
32+
"status": 1
2733
},
2834
{
2935
"price": 16000,
30-
"conf": 1000
36+
"conf": 1000,
37+
"status": 1
3138
}
3239
]
33-
}
40+
}

pyth/tests/qset/16.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,38 @@
33
"quotes": [
44
{
55
"price": 10000,
6-
"conf": 1100
6+
"conf": 1100,
7+
"status": 1
78
},
89
{
910
"price": 11030,
10-
"conf": 900
11+
"conf": 900,
12+
"status": 1
1113
},
1214
{
1315
"price": 12030,
14-
"conf": 1123
16+
"conf": 1123,
17+
"status": 1
1518
},
1619
{
1720
"price": 13200,
18-
"conf": 940
21+
"conf": 940,
22+
"status": 1
1923
},
2024
{
2125
"price": 14020,
22-
"conf": 1070
26+
"conf": 1070,
27+
"status": 1
2328
},
2429
{
2530
"price": 15200,
26-
"conf": 1123
31+
"conf": 1123,
32+
"status": 1
2733
},
2834
{
2935
"price": 16320,
30-
"conf": 1213
36+
"conf": 1213,
37+
"status": 1
3138
}
3239
]
33-
}
40+
}

pyth/tests/qset/17.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,38 @@
33
"quotes": [
44
{
55
"price": 16320,
6-
"conf": 1213
6+
"conf": 1213,
7+
"status": 1
78
},
89
{
910
"price": 15200,
10-
"conf": 1123
11+
"conf": 1123,
12+
"status": 1
1113
},
1214
{
1315
"price": 14020,
14-
"conf": 1070
16+
"conf": 1070,
17+
"status": 1
1518
},
1619
{
1720
"price": 13200,
18-
"conf": 940
21+
"conf": 940,
22+
"status": 1
1923
},
2024
{
2125
"price": 12030,
22-
"conf": 1123
26+
"conf": 1123,
27+
"status": 1
2328
},
2429
{
2530
"price": 11030,
26-
"conf": 900
31+
"conf": 900,
32+
"status": 1
2733
},
2834
{
2935
"price": 10000,
30-
"conf": 1100
36+
"conf": 1100,
37+
"status": 1
3138
}
3239
]
33-
}
40+
}

0 commit comments

Comments
 (0)