Phase 33 NORM canon test: enforce normalized dev route for P1/P2/JP mini

This commit is contained in:
nyash-codex
2025-12-11 20:54:33 +09:00
parent 59a985b7fa
commit af6f95cd4b
170 changed files with 4423 additions and 1897 deletions

View File

@ -7,7 +7,7 @@ mod std_impls;
mod traits;
pub use errors::{IoError, TimeError};
pub use std_impls::{NoopMem, NoFsApi, StdFs, StdIo, StdLog, StdMem, StdThread, StdTime};
pub use std_impls::{NoFsApi, NoopMem, StdFs, StdIo, StdLog, StdMem, StdThread, StdTime};
pub use traits::{
FsApi, FsMetadata, IoApi, LogApi, LogLevel, MemApi, MemStats, ThreadApi, TimeApi,
};
@ -23,7 +23,7 @@ pub struct Ring0Context {
pub io: Arc<dyn IoApi>,
pub time: Arc<dyn TimeApi>,
pub log: Arc<dyn LogApi>,
pub fs: Arc<dyn FsApi>, // Phase 90-A
pub fs: Arc<dyn FsApi>, // Phase 90-A
pub thread: Arc<dyn ThreadApi>, // Phase 90-D
}
@ -123,12 +123,7 @@ mod tests {
use super::*;
fn unsafe_dealloc(ptr: *mut u8, size: usize) {
unsafe {
std::alloc::dealloc(
ptr,
std::alloc::Layout::from_size_align_unchecked(size, 1),
)
}
unsafe { std::alloc::dealloc(ptr, std::alloc::Layout::from_size_align_unchecked(size, 1)) }
}
#[test]
@ -228,13 +223,17 @@ mod tests {
#[test]
fn test_nofs_api_write_all() {
let api = NoFsApi;
assert!(api.write_all(std::path::Path::new("/tmp/test.txt"), b"data").is_err());
assert!(api
.write_all(std::path::Path::new("/tmp/test.txt"), b"data")
.is_err());
}
#[test]
fn test_nofs_api_append_all() {
let api = NoFsApi;
assert!(api.append_all(std::path::Path::new("/tmp/test.txt"), b"data").is_err());
assert!(api
.append_all(std::path::Path::new("/tmp/test.txt"), b"data")
.is_err());
}
#[test]
@ -252,6 +251,8 @@ mod tests {
#[test]
fn test_nofs_api_canonicalize() {
let api = NoFsApi;
assert!(api.canonicalize(std::path::Path::new("/tmp/test.txt")).is_err());
assert!(api
.canonicalize(std::path::Path::new("/tmp/test.txt"))
.is_err());
}
}