Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
math-example: Fix tests that have been broken
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque committed Jan 10, 2025
1 parent 0b1a4d0 commit 63b2173
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions libraries/math-example/tests/instruction_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use {

#[tokio::test]
async fn test_precise_sqrt_u64_max() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

// This is way too big! It's possible to dial down the numbers to get to
// something reasonable, but the better option is to do everything in u64
Expand All @@ -28,7 +28,7 @@ async fn test_precise_sqrt_u64_max() {

#[tokio::test]
async fn test_precise_sqrt_u32_max() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(170_000);

Expand All @@ -44,7 +44,7 @@ async fn test_precise_sqrt_u32_max() {

#[tokio::test]
async fn test_sqrt_u64() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

// Dial down the BPF compute budget to detect if the operation gets bloated in
// the future
Expand All @@ -60,7 +60,7 @@ async fn test_sqrt_u64() {

#[tokio::test]
async fn test_sqrt_u128() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

// Dial down the BPF compute budget to detect if the operation gets bloated in
// the future
Expand All @@ -78,7 +78,7 @@ async fn test_sqrt_u128() {

#[tokio::test]
async fn test_sqrt_u128_max() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(7_000);

Expand All @@ -92,7 +92,7 @@ async fn test_sqrt_u128_max() {

#[tokio::test]
async fn test_u64_multiply() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(1350);

Expand All @@ -106,7 +106,7 @@ async fn test_u64_multiply() {

#[tokio::test]
async fn test_u64_divide() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(1650);

Expand All @@ -120,7 +120,7 @@ async fn test_u64_divide() {

#[tokio::test]
async fn test_f32_multiply() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(1600);

Expand All @@ -136,7 +136,7 @@ async fn test_f32_multiply() {

#[tokio::test]
async fn test_f32_divide() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(1650);

Expand All @@ -152,7 +152,7 @@ async fn test_f32_divide() {

#[tokio::test]
async fn test_f32_exponentiate() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(1400);

Expand All @@ -168,7 +168,7 @@ async fn test_f32_exponentiate() {

#[tokio::test]
async fn test_f32_natural_log() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(3500);

Expand All @@ -184,7 +184,7 @@ async fn test_f32_natural_log() {

#[tokio::test]
async fn test_f32_normal_cdf() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

// Dial down the BPF compute budget to detect if the operation gets bloated in
// the future
Expand All @@ -200,7 +200,7 @@ async fn test_f32_normal_cdf() {

#[tokio::test]
async fn test_f64_pow() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(30_000);

Expand All @@ -216,7 +216,7 @@ async fn test_f64_pow() {

#[tokio::test]
async fn test_u128_multiply() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(10000);

Expand All @@ -232,7 +232,7 @@ async fn test_u128_multiply() {

#[tokio::test]
async fn test_u128_divide() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(10000);

Expand All @@ -248,7 +248,7 @@ async fn test_u128_divide() {

#[tokio::test]
async fn test_f64_multiply() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(10000);

Expand All @@ -264,7 +264,7 @@ async fn test_f64_multiply() {

#[tokio::test]
async fn test_f64_divide() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(10000);

Expand All @@ -280,7 +280,7 @@ async fn test_f64_divide() {

#[tokio::test]
async fn test_noop() {
let mut pc = ProgramTest::new("spl_math", id(), processor!(process_instruction));
let mut pc = ProgramTest::new("spl_math_example", id(), processor!(process_instruction));

pc.set_compute_max_units(1200);

Expand Down

0 comments on commit 63b2173

Please sign in to comment.