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"}

0 commit comments

Comments
 (0)