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

Update test to enhance code coverage #90

Merged
merged 5 commits into from
Feb 17, 2025

Conversation

galin-chung-nguyen
Copy link
Collaborator

  • Fix Swap instruction impl in machine.rs
  • Fix memory layout allocation in config.rs

}

#[cfg(test)]
mod tests {
use super::ConfigArgs;
use crate::base::{Base, B256};
use crate::config::{Config, DefaultConfig};
extern crate std;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No std

@@ -122,13 +125,19 @@ where
self.register.low() + (T::from(index) * self.word_size),
)
}

/// Get the buffer size in bytes
pub fn buffer_size_in_bytes(&self) -> T {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't modify program to test

@@ -1,4 +1,5 @@
extern crate alloc;
extern crate std;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No std

@@ -927,6 +936,8 @@ mod tests {
for instruction in program {
sm.exec(&instruction);
}
assert_eq!(sm.get_memory_address().0, B256::from(35840));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any better way to compare?

@@ -77,11 +78,12 @@ where
/// Create a new config for given arguments
pub fn new(word_size: T, args: ConfigArgs<T>) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this @chiro-hiro

@galin-chung-nguyen galin-chung-nguyen force-pushed the feature/update_zkmemory_code_coverage branch from d487bb3 to 8ede785 Compare February 14, 2025 09:55
@@ -32,3 +32,7 @@ nova-snark = { workspace = true }
bellpepper-core = { workspace = true }
poseidon = { path = "../poseidon" }
arecibo = { workspace = true }

[features]
default = ["no_std"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

@chiro-hiro chiro-hiro merged commit dfb9a9f into main Feb 17, 2025
4 checks passed
@chiro-hiro chiro-hiro deleted the feature/update_zkmemory_code_coverage branch February 17, 2025 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants