microsoft/qdk
Publicmirrored from https://github.com/microsoft/qdkAvailable
source/resource_estimator/src/system/data/profile/tests.rs
29lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | use super::SampledProfile; |
| 5 | |
| 6 | use super::File; |
| 7 | |
| 8 | #[test] |
| 9 | fn test_two_sampled() { |
| 10 | let mut two_sampled = File::new(&["a", "b", "c", "d"]); |
| 11 | |
| 12 | let mut one = SampledProfile::new("one"); |
| 13 | one.push_sample(&[0, 1, 2], 1); |
| 14 | one.push_sample(&[0, 1, 2], 1); |
| 15 | one.push_sample(&[0, 1, 3], 4); |
| 16 | one.push_sample(&[0, 1, 2], 3); |
| 17 | one.push_sample(&[0, 1], 5); |
| 18 | two_sampled.push(one); |
| 19 | |
| 20 | let mut two = SampledProfile::new("two"); |
| 21 | two.push_sample(&[0, 1, 2], 1); |
| 22 | two.push_sample(&[0, 1, 2], 1); |
| 23 | two.push_sample(&[0, 1, 3], 4); |
| 24 | two.push_sample(&[0, 1, 2], 3); |
| 25 | two.push_sample(&[0, 1], 5); |
| 26 | two_sampled.push(two); |
| 27 | |
| 28 | println!("{}", serde_json::to_string(&two_sampled).unwrap()); |
| 29 | } |
| 30 | |