Skip to content

Commit 34eda6d

Browse files
committed
add status to test results
1 parent 4a3592c commit 34eda6d

35 files changed

+51
-34
lines changed

pctest/test_qset.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,29 @@ int main( int argc,char** argv )
146146
}
147147
upd_aggregate( px, slot+1 );
148148

149+
char const* status = "invalid value";
150+
switch ( px->agg_.status_ ) {
151+
case PC_STATUS_UNKNOWN:
152+
status = "unknown";
153+
break;
154+
case PC_STATUS_TRADING:
155+
status = "trading";
156+
break;
157+
case PC_STATUS_HALTED:
158+
status = "halted";
159+
break;
160+
case PC_STATUS_AUCTION:
161+
status = "auction";
162+
break;
163+
}
164+
149165
// generate result
150166
json_wtr jw;
151167
jw.add_val( json_wtr::e_obj );
152168
jw.add_key( "exponent", (int64_t)px->expo_ );
153169
jw.add_key( "price", px->agg_.price_ );
154170
jw.add_key( "conf", px->agg_.conf_ );
171+
jw.add_key( "status", status );
155172
jw.pop();
156173
net_buf *hd, *tl;
157174
jw.detach( hd, tl );

pyth/tests/qset/1.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":10000,"conf":1000}
1+
{"exponent":-3,"price":10000,"conf":1000,"status":"trading"}

pyth/tests/qset/10.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":500497,"conf":498}
1+
{"exponent":-3,"price":500497,"conf":498,"status":"trading"}

pyth/tests/qset/11.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":500501440000,"conf":499530000}
1+
{"exponent":-3,"price":500501440000,"conf":499530000,"status":"trading"}

pyth/tests/qset/12.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":10010510,"conf":500}
1+
{"exponent":-3,"price":10010510,"conf":500,"status":"trading"}

pyth/tests/qset/13.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":13003,"conf":1845}
1+
{"exponent":-3,"price":13003,"conf":1845,"status":"trading"}

pyth/tests/qset/14.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":10521,"conf":500}
1+
{"exponent":-3,"price":10521,"conf":500,"status":"trading"}

pyth/tests/qset/15.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":13000,"conf":1750}
1+
{"exponent":-3,"price":13000,"conf":1750,"status":"trading"}

pyth/tests/qset/16.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":13128,"conf":1705}
1+
{"exponent":-3,"price":13128,"conf":1705,"status":"trading"}

pyth/tests/qset/17.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":13128,"conf":1705}
1+
{"exponent":-3,"price":13128,"conf":1705,"status":"trading"}

pyth/tests/qset/18.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":11031,"conf":246}
1+
{"exponent":-3,"price":11031,"conf":246,"status":"trading"}

pyth/tests/qset/19.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":11031,"conf":246}
1+
{"exponent":-3,"price":11031,"conf":246,"status":"trading"}

pyth/tests/qset/2.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":-10000,"conf":1000}
1+
{"exponent":-3,"price":-10000,"conf":1000,"status":"trading"}

pyth/tests/qset/20.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":11037,"conf":256}
1+
{"exponent":-3,"price":11037,"conf":256,"status":"trading"}

pyth/tests/qset/21.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":11101,"conf":963}
1+
{"exponent":-3,"price":11101,"conf":963,"status":"trading"}

pyth/tests/qset/22.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":0,"price":10000,"conf":2}
1+
{"exponent":0,"price":10000,"conf":2,"status":"trading"}

pyth/tests/qset/23.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":0,"price":10100,"conf":10}
1+
{"exponent":0,"price":10100,"conf":10,"status":"trading"}

pyth/tests/qset/24.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":0,"price":100499,"conf":500}
1+
{"exponent":0,"price":100499,"conf":500,"status":"trading"}

pyth/tests/qset/25.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":0,"price":100495,"conf":500}
1+
{"exponent":0,"price":100495,"conf":500,"status":"trading"}

pyth/tests/qset/26.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":0,"price":100000,"conf":500}
1+
{"exponent":0,"price":100000,"conf":500,"status":"trading"}

pyth/tests/qset/27.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":0,"price":100499,"conf":500}
1+
{"exponent":0,"price":100499,"conf":500,"status":"trading"}

pyth/tests/qset/28.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":0,"price":101000,"conf":500}
1+
{"exponent":0,"price":101000,"conf":500,"status":"trading"}

pyth/tests/qset/29.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":0,"price":100500,"conf":500}
1+
{"exponent":0,"price":100500,"conf":500,"status":"trading"}

pyth/tests/qset/3.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":0,"conf":0}
1+
{"exponent":-3,"price":0,"conf":0,"status":"unknown"}

pyth/tests/qset/30.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":0,"price":100500,"conf":500}
1+
{"exponent":0,"price":100500,"conf":500,"status":"trading"}

pyth/tests/qset/31.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-8,"price":4329782800000,"conf":2616650000}
1+
{"exponent":-8,"price":4329782800000,"conf":2616650000,"status":"trading"}

pyth/tests/qset/32.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-8,"price":4329847900000,"conf":3031550000}
1+
{"exponent":-8,"price":4329847900000,"conf":3031550000,"status":"trading"}

pyth/tests/qset/33.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-8,"price":4329782800000,"conf":2616650000}
1+
{"exponent":-8,"price":4329782800000,"conf":2616650000,"status":"trading"}

pyth/tests/qset/34.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-8,"price":4290171000000,"conf":59750000}
1+
{"exponent":-8,"price":4290171000000,"conf":59750000,"status":"trading"}

pyth/tests/qset/4.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":10500,"conf":1000}
1+
{"exponent":-3,"price":10500,"conf":1000,"status":"trading"}

pyth/tests/qset/5.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":15000,"conf":3750}
1+
{"exponent":-3,"price":15000,"conf":3750,"status":"trading"}

pyth/tests/qset/6.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":15000,"conf":3750}
1+
{"exponent":-3,"price":15000,"conf":3750,"status":"trading"}

pyth/tests/qset/7.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":100000,"conf":10}
1+
{"exponent":-3,"price":100000,"conf":10,"status":"trading"}

pyth/tests/qset/8.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":10010,"conf":31}
1+
{"exponent":-3,"price":10010,"conf":31,"status":"trading"}

pyth/tests/qset/9.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"exponent":-3,"price":10510,"conf":500}
1+
{"exponent":-3,"price":10510,"conf":500,"status":"trading"}

0 commit comments

Comments
 (0)