use super::*;
#[test]
fn test_core_always_available() {
let _qubit = core::QubitId::new(0);
assert_eq!(VERSION, QUANTRS2_VERSION);
}
#[cfg(feature = "circuit")]
#[test]
fn test_circuit_feature_available() {
#[allow(unused_imports)]
use crate::circuit;
}
#[cfg(not(feature = "circuit"))]
#[test]
fn test_circuit_feature_unavailable() {
}
#[cfg(feature = "sim")]
#[test]
fn test_sim_feature_available() {
#[allow(unused_imports)]
use crate::sim;
}
#[cfg(feature = "sim")]
#[test]
fn test_sim_requires_circuit() {
#[allow(unused_imports)]
use crate::circuit;
}
#[cfg(feature = "anneal")]
#[test]
fn test_anneal_feature_available() {
#[allow(unused_imports)]
use crate::anneal;
}
#[cfg(feature = "device")]
#[test]
fn test_device_feature_available() {
#[allow(unused_imports)]
use crate::device;
}
#[cfg(feature = "ml")]
#[test]
fn test_ml_feature_available() {
#[allow(unused_imports)]
use crate::ml;
}
#[cfg(feature = "ml")]
#[test]
fn test_ml_requires_sim_and_anneal() {
#[allow(unused_imports)]
use crate::{anneal, circuit, sim};
}
#[cfg(feature = "tytan")]
#[test]
fn test_tytan_feature_available() {
#[allow(unused_imports)]
use crate::tytan;
}
#[cfg(feature = "tytan")]
#[test]
fn test_tytan_requires_anneal() {
#[allow(unused_imports)]
use crate::{anneal, circuit};
}
#[cfg(feature = "symengine")]
#[test]
fn test_symengine_feature_available() {
#[allow(unused_imports)]
use crate::symengine;
}
#[cfg(feature = "full")]
#[test]
fn test_full_feature_enables_all() {
#[allow(unused_imports)]
use crate::{anneal, circuit, device, ml, sim, symengine, tytan};
}
#[test]
fn test_prelude_essentials_available() {
use crate::prelude::essentials::*;
assert!(!VERSION.is_empty());
assert_eq!(VERSION, QUANTRS2_VERSION);
}
#[cfg(feature = "circuit")]
#[test]
fn test_prelude_circuits_available() {
use crate::prelude::circuits::*;
assert!(!VERSION.is_empty());
}
#[cfg(feature = "sim")]
#[test]
fn test_prelude_simulation_available() {
use crate::prelude::simulation::*;
assert!(!VERSION.is_empty());
}
#[cfg(feature = "ml")]
#[test]
fn test_prelude_algorithms_available() {
use crate::prelude::algorithms::*;
assert!(!VERSION.is_empty());
}
#[cfg(feature = "device")]
#[test]
fn test_prelude_hardware_available() {
use crate::prelude::hardware::*;
assert!(!VERSION.is_empty());
}
#[cfg(feature = "anneal")]
#[test]
fn test_prelude_quantum_annealing_available() {
use crate::prelude::quantum_annealing::*;
assert!(!VERSION.is_empty());
}
#[cfg(feature = "tytan")]
#[test]
fn test_prelude_tytan_available() {
use crate::prelude::tytan::*;
assert!(!VERSION.is_empty());
}
#[cfg(feature = "full")]
#[test]
fn test_prelude_full_available() {
#[allow(unused_imports)]
use crate::prelude::full;
}
#[test]
fn test_facade_modules_always_available() {
use crate::bench;
use crate::config;
use crate::deprecation;
use crate::diagnostics;
use crate::error;
use crate::testing;
use crate::utils;
use crate::version;
let _ = error::ErrorCategory::Core;
let _ = version::VERSION;
let _ = config::Config::global();
let _ = diagnostics::is_ready();
let _ = utils::estimate_statevector_memory(10);
let _ = testing::test_seed();
let _timer = bench::BenchmarkTimer::start();
let _ = deprecation::is_deprecated("test");
}
#[cfg(all(
not(feature = "circuit"),
not(feature = "sim"),
not(feature = "anneal"),
not(feature = "device"),
not(feature = "ml"),
not(feature = "tytan"),
not(feature = "symengine"),
not(feature = "full")
))]
#[test]
fn test_default_feature_set() {
use crate::core;
let _qubit = core::QubitId::new(0);
assert!(!VERSION.is_empty());
}
#[test]
fn test_version_constants_consistent() {
assert_eq!(VERSION, QUANTRS2_VERSION);
assert_eq!(VERSION, version::VERSION);
assert_eq!(VERSION, version::QUANTRS2_VERSION);
}
#[test]
fn test_error_module_integration() {
use crate::error::*;
let err = QuantRS2Error::InvalidInput("test".into());
assert!(err.is_invalid_input());
let category = err.category();
assert_eq!(category.name(), "Core");
}
#[test]
fn test_config_module_integration() {
use crate::config::*;
let cfg = Config::global();
let _ = cfg.num_threads();
}
#[test]
fn test_diagnostics_module_integration() {
use crate::diagnostics::*;
let report = run_diagnostics();
assert!(!report.summary().is_empty());
}
#[test]
fn test_utils_module_integration() {
use crate::utils::*;
let mem = estimate_statevector_memory(10);
assert!(mem > 0);
let formatted = format_memory(1024 * 1024);
assert!(formatted.contains("MB") || formatted.contains("KiB"));
}
#[test]
fn test_testing_module_integration() {
use crate::testing::*;
assert_approx_eq(1.0, 1.0, 1e-10);
let seed = test_seed();
assert!(seed > 0);
}
#[test]
fn test_bench_module_integration() {
use crate::bench::*;
use std::time::Duration;
let timer = BenchmarkTimer::start();
std::thread::sleep(Duration::from_micros(1));
let elapsed = timer.stop();
assert!(elapsed > Duration::ZERO);
let mut stats = BenchmarkStats::new("test");
stats.record(Duration::from_millis(10));
assert_eq!(stats.count(), 1);
}
#[test]
fn test_deprecation_module_integration() {
use crate::deprecation::*;
let is_deprecated = is_deprecated("nonexistent");
assert!(!is_deprecated);
let stability = get_module_stability("quantrs2::core");
assert!(stability.is_some());
}
#[cfg(all(feature = "circuit", feature = "sim"))]
#[test]
fn test_feature_combination_circuit_sim() {
#[allow(unused_imports)]
use crate::{circuit, sim};
}
#[cfg(all(feature = "sim", feature = "ml"))]
#[test]
fn test_feature_combination_sim_ml() {
#[allow(unused_imports)]
use crate::{anneal, ml, sim};
}
#[cfg(all(feature = "anneal", feature = "tytan"))]
#[test]
fn test_feature_combination_anneal_tytan() {
#[allow(unused_imports)]
use crate::{anneal, tytan};
}
#[cfg(all(feature = "device", feature = "circuit"))]
#[test]
fn test_feature_combination_device_circuit() {
#[allow(unused_imports)]
use crate::{circuit, device};
}