//! Integration tests for CP2K-RS
//!
//! These tests verify that the CP2K bindings work correctly.
//! Note: These tests require a working CP2K installation and library.

use cp2k_rs::*;

#[test]
fn test_library_compilation() {
    // This test just ensures the library compiles and basic functions exist
    // It doesn't actually call CP2K functions since we don't have the library linked

    // Just test that the functions exist and have the right return types
    let result1 = std::panic::catch_unwind(|| {
        let _ = init_without_mpi as fn() -> Result<(), CP2KError>;
        let _ = finalize_without_mpi as fn() -> Result<(), CP2KError>;
        let _ = get_version as fn() -> Result<String, CP2KError>;
    });

    assert!(result1.is_ok());
}

#[test]
fn test_force_env_type_exists() {
    // Test that ForceEnv type exists and has expected methods
    // This uses reflection-like checks without actually creating instances

    use std::any::TypeId;
    let force_env_type = TypeId::of::<ForceEnv>();

    // Test passes if the type exists
    assert_ne!(force_env_type, TypeId::of::<()>());
}

#[cfg(test)]
mod error_tests {
    use super::*;

    #[test]
    fn test_error_types() {
        // Test that our error types work correctly
        let error = CP2KError::InvalidParameter("test".to_string());
        assert!(format!("{}", error).contains("test"));
    }
}
