//! Simple test to verify CP2K initialization works
//!
//! This example just tests that we can initialize and finalize CP2K
//! without running any calculations.

use cp2k_rs::{finalize, get_version, init};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    println!("CP2K-RS Simple Initialization Test");
    println!("==================================");

    // Test initialization
    println!("Initializing CP2K...");
    match init() {
        Ok(_) => println!("✓ CP2K initialized successfully"),
        Err(e) => {
            println!("✗ CP2K initialization failed: {}", e);
            return Err(Box::new(e));
        }
    }

    // Test version retrieval
    match get_version() {
        Ok(version) => println!("✓ CP2K Version: {}", version),
        Err(e) => println!("Warning: Could not get CP2K version: {}", e),
    }

    // Test finalization
    println!("Finalizing CP2K...");
    match finalize() {
        Ok(_) => println!("✓ CP2K finalized successfully"),
        Err(e) => {
            println!("✗ CP2K finalization failed: {}", e);
            return Err(Box::new(e));
        }
    }

    println!("✓ All tests passed!");
    Ok(())
}
