()
| 147 | |
| 148 | #[test] |
| 149 | fn fourcc_roundtrip() { |
| 150 | // Verify that from_fourcc and to_fourcc are inverse operations. |
| 151 | // 验证 from_fourcc 和 to_fourcc 互为逆操作。 |
| 152 | let formats = [ |
| 153 | (PixelFormat::Mjpeg, fcc::MJPEG, "MJPG"), |
| 154 | (PixelFormat::Yuyv, fcc::YUYV, "YUYV"), |
| 155 | (PixelFormat::Nv12, fcc::NV12, "NV12"), |
| 156 | ]; |
| 157 | for (fmt, expected_fcc, expected_str) in formats { |
| 158 | assert_eq!(fmt.to_fourcc(), expected_fcc); |
| 159 | assert_eq!(PixelFormat::from_fourcc(expected_fcc), fmt); |
| 160 | assert_eq!(fmt.fourcc_str(), expected_str); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | #[test] |
| 165 | fn unknown_fourcc_preserved() { |
nothing calls this directly
no outgoing calls
no test coverage detected