Skip to content

Commit 5847c8c

Browse files
committed
test: add testcases to complete 100% code coverage
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed ---
1 parent 99d13a7 commit 5847c8c

File tree

4 files changed

+256
-0
lines changed

4 files changed

+256
-0
lines changed

lib/node_modules/@stdlib/blas/base/zaxpy/test/test.ndarray.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,70 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy
135135
t.end();
136136
});
137137

138+
tape( 'if dcabs1( za ) === 0.0; the function returns the second input array unchanged', function test( t ) {
139+
var expected;
140+
var viewY;
141+
var za;
142+
var zx;
143+
var zy;
144+
145+
zx = new Complex128Array( [
146+
0.7, // 1
147+
-0.8, // 1
148+
-0.4,
149+
-0.7,
150+
-0.1, // 2
151+
-0.9, // 2
152+
0.2,
153+
-0.8,
154+
-0.9, // 3
155+
-0.4, // 3
156+
0.1,
157+
0.4,
158+
-0.6, // 4
159+
0.6 // 4
160+
] );
161+
zy = new Complex128Array( [
162+
0.6, // 1
163+
-0.6, // 1
164+
-0.9, // 2
165+
0.5, // 2
166+
0.7, // 3
167+
-0.6, // 3
168+
0.1, // 4
169+
-0.5, // 4
170+
-0.1,
171+
-0.2,
172+
-0.5,
173+
-0.3,
174+
0.8,
175+
-0.7
176+
] );
177+
za = new Complex128( 0.0, 0.0 );
178+
179+
zaxpy( 4, za, zx, 2, 0, zy, 1, 0 );
180+
181+
viewY = new Float64Array( zy.buffer );
182+
expected = new Float64Array( [
183+
0.6, // 1
184+
-0.6, // 1
185+
-0.9, // 2
186+
0.5, // 2
187+
0.7, // 3
188+
-0.6, // 3
189+
0.1, // 4
190+
-0.5, // 4
191+
-0.1,
192+
-0.2,
193+
-0.5,
194+
-0.3,
195+
0.8,
196+
-0.7
197+
] );
198+
isApprox( t, viewY, expected, 14.0 );
199+
t.end();
200+
});
201+
138202
tape( 'the function supports a `zx` stride', function test( t ) {
139203
var expected;
140204
var viewY;

lib/node_modules/@stdlib/blas/base/zaxpy/test/test.ndarray.native.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,70 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy
144144
t.end();
145145
});
146146

147+
tape( 'if dcabs1( za ) === 0.0; the function returns the second input array unchanged', opts, function test( t ) {
148+
var expected;
149+
var viewY;
150+
var za;
151+
var zx;
152+
var zy;
153+
154+
zx = new Complex128Array( [
155+
0.7, // 1
156+
-0.8, // 1
157+
-0.4,
158+
-0.7,
159+
-0.1, // 2
160+
-0.9, // 2
161+
0.2,
162+
-0.8,
163+
-0.9, // 3
164+
-0.4, // 3
165+
0.1,
166+
0.4,
167+
-0.6, // 4
168+
0.6 // 4
169+
] );
170+
zy = new Complex128Array( [
171+
0.6, // 1
172+
-0.6, // 1
173+
-0.9, // 2
174+
0.5, // 2
175+
0.7, // 3
176+
-0.6, // 3
177+
0.1, // 4
178+
-0.5, // 4
179+
-0.1,
180+
-0.2,
181+
-0.5,
182+
-0.3,
183+
0.8,
184+
-0.7
185+
] );
186+
za = new Complex128( 0.0, 0.0 );
187+
188+
zaxpy( 4, za, zx, 2, 0, zy, 1, 0 );
189+
190+
viewY = new Float64Array( zy.buffer );
191+
expected = new Float64Array( [
192+
0.6, // 1
193+
-0.6, // 1
194+
-0.9, // 2
195+
0.5, // 2
196+
0.7, // 3
197+
-0.6, // 3
198+
0.1, // 4
199+
-0.5, // 4
200+
-0.1,
201+
-0.2,
202+
-0.5,
203+
-0.3,
204+
0.8,
205+
-0.7
206+
] );
207+
isApprox( t, viewY, expected, 14.0 );
208+
t.end();
209+
});
210+
147211
tape( 'the function supports a `zx` stride', opts, function test( t ) {
148212
var expected;
149213
var viewY;

lib/node_modules/@stdlib/blas/base/zaxpy/test/test.zaxpy.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,70 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy
135135
t.end();
136136
});
137137

138+
tape( 'if dcabs1( za ) === 0.0; the function returns the second input array unchanged', function test( t ) {
139+
var expected;
140+
var viewY;
141+
var za;
142+
var zx;
143+
var zy;
144+
145+
zx = new Complex128Array( [
146+
0.7, // 1
147+
-0.8, // 1
148+
-0.4,
149+
-0.7,
150+
-0.1, // 2
151+
-0.9, // 2
152+
0.2,
153+
-0.8,
154+
-0.9, // 3
155+
-0.4, // 3
156+
0.1,
157+
0.4,
158+
-0.6, // 4
159+
0.6 // 4
160+
] );
161+
zy = new Complex128Array( [
162+
0.6, // 1
163+
-0.6, // 1
164+
-0.9, // 2
165+
0.5, // 2
166+
0.7, // 3
167+
-0.6, // 3
168+
0.1, // 4
169+
-0.5, // 4
170+
-0.1,
171+
-0.2,
172+
-0.5,
173+
-0.3,
174+
0.8,
175+
-0.7
176+
] );
177+
za = new Complex128( 0.0, 0.0 );
178+
179+
zaxpy( 4, za, zx, 2, zy, 1 );
180+
181+
viewY = new Float64Array( zy.buffer );
182+
expected = new Float64Array( [
183+
0.6, // 1
184+
-0.6, // 1
185+
-0.9, // 2
186+
0.5, // 2
187+
0.7, // 3
188+
-0.6, // 3
189+
0.1, // 4
190+
-0.5, // 4
191+
-0.1,
192+
-0.2,
193+
-0.5,
194+
-0.3,
195+
0.8,
196+
-0.7
197+
] );
198+
isApprox( t, viewY, expected, 14.0 );
199+
t.end();
200+
});
201+
138202
tape( 'the function supports a `zx` stride', function test( t ) {
139203
var expected;
140204
var viewY;

lib/node_modules/@stdlib/blas/base/zaxpy/test/test.zaxpy.native.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,70 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy
144144
t.end();
145145
});
146146

147+
tape( 'if dcabs1( za ) === 0.0; the function returns the second input array unchanged', opts, function test( t ) {
148+
var expected;
149+
var viewY;
150+
var za;
151+
var zx;
152+
var zy;
153+
154+
zx = new Complex128Array( [
155+
0.7, // 1
156+
-0.8, // 1
157+
-0.4,
158+
-0.7,
159+
-0.1, // 2
160+
-0.9, // 2
161+
0.2,
162+
-0.8,
163+
-0.9, // 3
164+
-0.4, // 3
165+
0.1,
166+
0.4,
167+
-0.6, // 4
168+
0.6 // 4
169+
] );
170+
zy = new Complex128Array( [
171+
0.6, // 1
172+
-0.6, // 1
173+
-0.9, // 2
174+
0.5, // 2
175+
0.7, // 3
176+
-0.6, // 3
177+
0.1, // 4
178+
-0.5, // 4
179+
-0.1,
180+
-0.2,
181+
-0.5,
182+
-0.3,
183+
0.8,
184+
-0.7
185+
] );
186+
za = new Complex128( 0.0, 0.0 );
187+
188+
zaxpy( 4, za, zx, 2, zy, 1 );
189+
190+
viewY = new Float64Array( zy.buffer );
191+
expected = new Float64Array( [
192+
0.6, // 1
193+
-0.6, // 1
194+
-0.9, // 2
195+
0.5, // 2
196+
0.7, // 3
197+
-0.6, // 3
198+
0.1, // 4
199+
-0.5, // 4
200+
-0.1,
201+
-0.2,
202+
-0.5,
203+
-0.3,
204+
0.8,
205+
-0.7
206+
] );
207+
isApprox( t, viewY, expected, 14.0 );
208+
t.end();
209+
});
210+
147211
tape( 'the function supports a `zx` stride', opts, function test( t ) {
148212
var expected;
149213
var viewY;

0 commit comments

Comments
 (0)