Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: repair cargo test #898

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions sdk/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,15 +429,10 @@ impl Manifest {
/// Example: Find an Actions Assertion
/// ```
/// # use c2pa::Result;
/// use c2pa::{
/// assertions::{c2pa_action, Action, Actions},
/// Manifest,
/// };
/// use c2pa::{assertions::Actions, Manifest, Reader};
/// # fn main() -> Result<()> {
/// let mut manifest = Manifest::new("my_app");
/// let actions = Actions::new().add_action(Action::new(c2pa_action::EDITED));
/// manifest.add_assertion(&actions)?;
///
/// let reader = Reader::from_file("tests/fixtures/CA.jpg")?;
/// let manifest = reader.active_manifest().unwrap();
/// let actions: Actions = manifest.find_assertion(Actions::LABEL)?;
/// for action in actions.actions {
/// println!("{}", action.action());
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/manifest_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl ManifestStore {
}

/// creates a ManifestStore from a Store writing resources to resource_path
#[cfg(feature = "file_io")]
#[cfg(all(feature = "file_io", feature = "v1_api"))]
pub(crate) fn from_store_with_resources(
store: Store,
validation_log: &impl StatusTracker,
Expand Down Expand Up @@ -355,7 +355,7 @@ impl ManifestStore {
Ok(Self::from_store(store, &validation_log))
}

#[cfg(feature = "file_io")]
#[cfg(all(feature = "file_io", feature = "v1_api"))]
/// Loads a ManifestStore from a file adding resources to a folder
/// Example:
///
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/manifest_store_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,11 @@ mod tests {
#[cfg(feature = "v1_api")]
use std::fs;

#[cfg(feature = "v1_api")]
use crate::{manifest_store_report::ManifestStoreReport, utils::test::fixture_path};

#[test]
#[cfg(feature = "v1_api")]
fn manifest_store_report() {
let path = fixture_path("CIE-sig-CA.jpg");
let report = ManifestStoreReport::from_file(path).expect("load_from_asset");
Expand Down
7 changes: 5 additions & 2 deletions sdk/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,15 @@ mod integration_1 {
Ok(())
}

#[cfg(feature = "v1_api")]
struct PlacedCallback {
path: String,
}

#[cfg(feature = "v1_api")]
use c2pa::{Error, Manifest, ManifestPatchCallback};

#[cfg(feature = "v1_api")]
impl ManifestPatchCallback for PlacedCallback {
fn patch_manifest(&self, manifest_store: &[u8]) -> Result<Vec<u8>> {
use ::jumbf::parser::SuperBox;
Expand Down Expand Up @@ -294,7 +297,7 @@ mod integration_1 {
}
}
#[test]
#[cfg(feature = "file_io")]
#[cfg(all(feature = "file_io", feature = "v1_api"))]
fn test_placed_manifest() -> Result<()> {
// set up parent and destination paths

Expand Down Expand Up @@ -362,7 +365,7 @@ mod integration_1 {
}

#[test]
#[cfg(feature = "file_io")]
#[cfg(all(feature = "file_io", feature = "v1_api"))]
fn test_placed_manifest_bmff() -> Result<()> {
// set up parent and destination paths

Expand Down