use crate::ez::*;
#[test]
fn test_ez_config_defaults() {
let config = EzConfig::default();
assert_eq!(config.app_name, "EZ Renderer");
assert_eq!(config.in_flight_frames, 2);
#[cfg(debug_assertions)]
assert!(config.enable_validation);
#[cfg(not(debug_assertions))]
assert!(!config.enable_validation);
}
#[test]
fn test_ez_config_custom_values() {
let config = EzConfig {
app_name: "Custom App".to_string(),
enable_validation: true,
in_flight_frames: 3,
};
assert_eq!(config.app_name, "Custom App");
assert!(config.enable_validation);
assert_eq!(config.in_flight_frames, 3);
}
#[test]
fn test_ez_config_clone() {
let config1 = EzConfig {
app_name: "Test App".to_string(),
enable_validation: false,
in_flight_frames: 4,
};
let config2 = config1.clone();
assert_eq!(config1.app_name, config2.app_name);
assert_eq!(config1.enable_validation, config2.enable_validation);
assert_eq!(config1.in_flight_frames, config2.in_flight_frames);
}
#[test]
fn test_ez_error_display() {
let error = EzError::RuntimeError("test error".to_string());
let display = format!("{}", error);
assert!(display.contains("test error"));
}
#[test]
fn test_ez_error_from_shader_manager_error() {
use crate::ex::ShaderManagerError;
let shader_error = ShaderManagerError::InvalidShaderId(crate::ex::ShaderId(999));
let ez_error: EzError = shader_error.into();
match ez_error {
EzError::ShaderCompilationFailed(_) => {}
_ => panic!("Expected ShaderCompilationFailed variant"),
}
}
#[test]
fn test_ez_error_from_runtime_error() {
use crate::ex::RuntimeError;
let runtime_error = RuntimeError::NoGraphicsQueue;
let ez_error: EzError = runtime_error.into();
match ez_error {
EzError::RuntimeError(_) => {}
_ => panic!("Expected RuntimeError variant"),
}
}
#[test]
fn test_ez_config_validation_disabled_in_release() {
#[cfg(not(debug_assertions))]
{
let config = EzConfig::default();
assert!(
!config.enable_validation,
"Validation should be disabled in release builds"
);
}
}
#[test]
fn test_ez_config_validation_enabled_in_debug() {
#[cfg(debug_assertions)]
{
let config = EzConfig::default();
assert!(
config.enable_validation,
"Validation should be enabled in debug builds"
);
}
}
#[test]
fn test_ez_config_reasonable_frame_count() {
let config = EzConfig::default();
assert!(
config.in_flight_frames >= 1,
"Need at least one in-flight frame"
);
assert!(
config.in_flight_frames <= 5,
"Too many in-flight frames is wasteful"
);
}
#[test]
fn test_ez_config_app_name_not_empty() {
let config = EzConfig::default();
assert!(
!config.app_name.is_empty(),
"Default app name should not be empty"
);
}
#[test]
fn test_ez_error_is_send_and_sync() {
fn assert_send<T: Send>() {}
fn assert_sync<T: Sync>() {}
assert_send::<EzError>();
assert_sync::<EzError>();
}
#[test]
fn test_ez_config_is_clone() {
fn assert_clone<T: Clone>() {}
assert_clone::<EzConfig>();
}
#[test]
#[ignore] fn test_ez_renderer_creation() {
}
#[test]
#[ignore] fn test_ez_renderer_with_custom_config() {
}
#[test]
#[ignore] fn test_quick_pipeline_compilation() {
}
#[test]
#[ignore] fn test_quick_compute_compilation() {
}
#[test]
#[ignore] fn test_buffer_creation() {
}
#[test]
#[ignore] fn test_image_creation() {
}
#[test]
#[ignore] fn test_render_frame_callback() {
}
#[test]
fn test_documentation_tests_exist() {
}