Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 63b2173

Browse files
committed
math-example: Fix tests that have been broken
1 parent 0b1a4d0 commit 63b2173

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

libraries/math-example/tests/instruction_count.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use {
1010

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

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

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

3333
pc.set_compute_max_units(170_000);
3434

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

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

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

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

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

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

8383
pc.set_compute_max_units(7_000);
8484

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

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

9797
pc.set_compute_max_units(1350);
9898

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

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

111111
pc.set_compute_max_units(1650);
112112

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

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

125125
pc.set_compute_max_units(1600);
126126

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

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

141141
pc.set_compute_max_units(1650);
142142

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

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

157157
pc.set_compute_max_units(1400);
158158

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

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

173173
pc.set_compute_max_units(3500);
174174

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

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

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

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

205205
pc.set_compute_max_units(30_000);
206206

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

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

221221
pc.set_compute_max_units(10000);
222222

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

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

237237
pc.set_compute_max_units(10000);
238238

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

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

253253
pc.set_compute_max_units(10000);
254254

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

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

269269
pc.set_compute_max_units(10000);
270270

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

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

285285
pc.set_compute_max_units(1200);
286286

0 commit comments

Comments
 (0)