Skip to content

Commit 2940c20

Browse files
committed
fix tests and typo
1 parent 184d8b3 commit 2940c20

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cc/core/Vec.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ NAN_MODULE_INIT(Vec::Init) {
4444
Vec6::constructor.Reset(vec6Ctor);
4545
vec6Ctor->InstanceTemplate()->SetInternalFieldCount(1);
4646
vec6Ctor->SetClassName(Nan::New("Vec6").ToLocalChecked());
47-
Nan::SetAccessor(vec6Ctor->InstanceTemplate(), Nan::New("u").ToLocalChecked(), Vec6::w_getter);
48-
Nan::SetAccessor(vec6Ctor->InstanceTemplate(), Nan::New("v").ToLocalChecked(), Vec6::w_getter);
47+
Nan::SetAccessor(vec6Ctor->InstanceTemplate(), Nan::New("u").ToLocalChecked(), Vec6::u_getter);
48+
Nan::SetAccessor(vec6Ctor->InstanceTemplate(), Nan::New("v").ToLocalChecked(), Vec6::v_getter);
4949
Nan::SetAccessor(vec6Ctor->InstanceTemplate(), Nan::New("w").ToLocalChecked(), Vec6::w_getter);
5050
Nan::SetAccessor(vec6Ctor->InstanceTemplate(), Nan::New("x").ToLocalChecked(), Vec6::x_getter);
5151
Nan::SetAccessor(vec6Ctor->InstanceTemplate(), Nan::New("y").ToLocalChecked(), Vec6::y_getter);

cc/core/Vec6.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#include "NativeNodeUtils.h"
44
#include "macros.h"
55

6-
#ifndef __FF_Vec6_H__
7-
#define __FF_Vec6_H__
6+
#ifndef __FF_VEC6_H__
7+
#define __FF_VEC6_H__
88

99
class Vec6 : public FF::ObjectWrap<Vec6, cv::Vec6d> {
1010
public:

test/tests/core/Vec/operatorTests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,25 +355,25 @@ module.exports = function ({ cv, utils }) {
355355
operatorRequiresArg('absdiff');
356356

357357
it('apply absdiff to matrices', () => {
358-
assertPropsWithValue(new cv.Vec(0, 100, 50, 25, 150, 10).absdiff(new cv.Vec(50, 25, 75, 25, 50, 20)))({ u: 50, v: 75, w: 25, x: 0, y: 50, z: 10 });
358+
assertPropsWithValue(new cv.Vec(0, 100, 50, 25, 150, 10).absdiff(new cv.Vec(50, 25, 75, 25, 50, 20)))({ u: 50, v: 75, w: 25, x: 0, y: 100, z: 10 });
359359
});
360360
});
361361

362362
describe('exp', () => {
363363
it('apply exp to vector', () => {
364-
assertPropsWithValue(new cv.Vec(Math.log(1), Math.log(4), 0, Math.log(0), Math.log(3), Math.log(2)).exp())({ u: 1, v: 4, w: 1, x: 0, y: 3, z: 2 });
364+
assertPropsWithValue(new cv.Vec(Math.log(1), Math.log(4), 0, Math.log(0), Math.log(4), Math.log(4)).exp())({ u: 1, v: 4, w: 1, x: 0, y: 4, z: 4 });
365365
});
366366
});
367367

368368
describe('sqrt', () => {
369369
it('apply sqrt to vector', () => {
370-
assertPropsWithValue(new cv.Vec(0, 4, 16, 64, 255, 510).sqrt())({ u: 0, v: 2, w: 4, x: 8, y: 16, z: 32 });
370+
assertPropsWithValue(new cv.Vec(0, 4, 16, 64, 256, 1024).sqrt())({ u: 0, v: 2, w: 4, x: 8, y: 16, z: 32 });
371371
});
372372
});
373373

374374
describe('norm', () => {
375375
it('should return magnitude', () => {
376-
expect(new cv.Vec(Math.sqrt(4), Math.sqrt(4), Math.sqrt(4), Math.sqrt(4), Math.sqrt(4), Math.sqrt(4)).norm()).to.equal(4);
376+
expect(new cv.Vec(Math.sqrt(8), Math.sqrt(8), Math.sqrt(8), Math.sqrt(8), Math.sqrt(16), Math.sqrt(16)).norm()).to.equal(8);
377377
});
378378
});
379379
});

0 commit comments

Comments
 (0)