serialize: add json bounds checks, support for u64s, and tests

This commit is contained in:
Erick Tryzelaar
2014-08-07 08:35:06 -04:00
parent 3019af6c01
commit e95552c5e6
2 changed files with 268 additions and 144 deletions

View File

@@ -1103,8 +1103,8 @@ fn calc_result(desc: &TestDesc, task_succeeded: bool) -> TestResult {
impl ToJson for Metric {
fn to_json(&self) -> json::Json {
let mut map = TreeMap::new();
map.insert("value".to_string(), json::Floating(self.value));
map.insert("noise".to_string(), json::Floating(self.noise));
map.insert("value".to_string(), json::F64(self.value));
map.insert("noise".to_string(), json::F64(self.noise));
json::Object(map)
}
}