/[svn]/linuxsampler/trunk/src/scriptvm/tests/NKSPCoreLangTest.cpp
ViewVC logotype

Log of /linuxsampler/trunk/src/scriptvm/tests/NKSPCoreLangTest.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:

Revision 3727 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jan 27 16:34:44 2020 UTC (4 years, 1 month ago) by schoenebeck
File length: 220734 byte(s)
Diff to previous 3693
Tests: Added thorough NKSP test cases for variable declarations.


Revision 3693 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jan 3 14:53:32 2020 UTC (4 years, 2 months ago) by schoenebeck
File length: 188605 byte(s)
Diff to previous 3678
Added NKSP test cases for core built-in variables.


Revision 3678 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 27 22:46:08 2019 UTC (4 years, 2 months ago) by schoenebeck
File length: 185616 byte(s)
Diff to previous 3600
* NKSP: Added built-in script functions "msb()" and "lsb()".

* Bumped version (2.1.1.svn26).


Revision 3600 - (view) (download) (annotate) - [select for diffs]
Modified Sun Sep 15 22:25:17 2019 UTC (4 years, 6 months ago) by schoenebeck
File length: 183414 byte(s)
Copied from: linuxsampler/trunk/src/scriptvm/tests/NKSPTest.cpp revision 3599
Diff to previous 3592
Just renamed NKSPTest.cpp -> NKSPCoreLangTest.cpp.


Revision 3592 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 2 09:40:44 2019 UTC (4 years, 6 months ago) by schoenebeck
Original Path: linuxsampler/trunk/src/scriptvm/tests/NKSPTest.cpp
File length: 183414 byte(s)
Diff to previous 3590
* NKSP language: Allow unary '+' operator.

* Test cases: Added NKSP tests for unary '+' operator.

* Bumped version (2.1.1.svn15).


Revision 3590 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 2 09:03:31 2019 UTC (4 years, 6 months ago) by schoenebeck
Original Path: linuxsampler/trunk/src/scriptvm/tests/NKSPTest.cpp
File length: 182731 byte(s)
Diff to previous 3586
NKSP: Implemented common real number math functions.

* Added built-in real number functions "round()", "ceil()", "floor()",
  "sqrt()", "log()", "log2()", "log10()", "exp()", "pow()", "sin()",
  "cos()", "tan()", "asin()", "acos()", "atan()".

* Added built-in script real number constant "~NI_MATH_PI".

* Added built-in script real number constant "~NI_MATH_E".

* Added NKSP test cases for built-in functions "round()", "ceil()",
  "floor()", "sqrt()", "log()", "log2()", "log10()", "exp()", "pow()",
  "sin()", "cos()", "tan()", "asin()", "acos()", "atan()".

* Bumped version (2.1.1.svn14).


Revision 3586 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 30 18:59:21 2019 UTC (4 years, 6 months ago) by schoenebeck
Original Path: linuxsampler/trunk/src/scriptvm/tests/NKSPTest.cpp
File length: 155489 byte(s)
Diff to previous 3582
* NKSP language: Fixed assignment to array variables which was
  broken by floating point support introduction (svn r3573).

* Test cases: Added NKSP int array and real array tests for value
  assignment and initialization of arrays.

* Bumped version (2.1.1.svn11).


Revision 3582 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 30 12:23:40 2019 UTC (4 years, 6 months ago) by schoenebeck
Original Path: linuxsampler/trunk/src/scriptvm/tests/NKSPTest.cpp
File length: 153390 byte(s)
Diff to previous 3581
NKSP VM refactoring: Renamed all methods, functions and
classes matching pattern '*ScalarNumber*' to simply '*Number*':

- Renamed classes VMScalarNumberExpr -> VMNumberExpr,
  ScalarNumberExpr -> NumberExpr, ScalarNumberVariable ->
  NumberVariable, ScalarNumberBinaryOp -> NumberBinaryOp,
  VMScalarNumberResultFunction -> VMNumberResultFunction.

- Renamed method VMExpr::asScalarNumberExpr() -> VMExpr::asNumber().

- Renamed function isScalarNumber() -> isNumber().


Revision 3581 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 30 11:40:25 2019 UTC (4 years, 6 months ago) by schoenebeck
Original Path: linuxsampler/trunk/src/scriptvm/tests/NKSPTest.cpp
File length: 153438 byte(s)
Diff to previous 3577
NKSP: Allow more wider support of standard measuring units & 'final'ness.

* Raised compiler requirement to be C++14 compliant (due to severe
  restrictions regarding C-style aggregate initializer lists in C++11
  which are now massively used throughout the code base).

* NKSP VM API: Allow units and 'final'ness to be returned as result from
  built-in functions (added methods VMFunction::returnUnitType() and
  VMFunction::returnsFinal() for that purpose which must be implemented by
  built-in function implementations).

* NKSP language: Allow metric unit prefixes of numeric scalar and array
  variables to be changed freely at runtime (unlike unit types like Hz etc.
  which are still sticky parse-time features of variables which cannot be
  changed at runtime for the intentional sake of determinism).

* NKSP language: 'final' values are prohibited for array variables for now
  (attempt causes a parsers error).

* NKSP language: expressions with unit types (e.g. Hz) are prohibited for
  conditions of runtime control structures like if(), while(), select()
  (attempt causes a parser error).

* NKSP VM API: Allow built-in functions to perform their own, individual
  parse time checks of arguments going to be passed to the function at
  runtime (added method VMFunction::checkArgs() for that purpose).

* NKSP language: raise parser warning if only one operand of binary
  operators (like logical 'or' comparison) contain a 'final' value (because
  it would always yield in a 'final' result in such cases).

* NKSP language: Allow comparison (=, #, <, >, <=, >=) of values with
  different metric unit prefixes, which will behave as expected (e.g.
  result of expression '1000us < 2ms' is true).

* NKSP language: Allow adding values with different metric unit prefixes
  (e.g. result of expression '100Hz + 5kHz' is '5100Hz').

* NKSP language: Allow subtracting values with different metric unit
  prefixes (e.g. result of expression '1ms - 20us' is '980us').

* NKSP language: Allow multiplying with any metric unit prefixes
  (e.g. result of expression '2k * 3ms' is '6s'), however multiplications
  with unit types on both sides (e.g. '2s * 2s') is still prohibited since
  we don't have any considerable practical use for a term like '4s^2'
  (hence any attempt multiplying two unit types still causes parser error).

* NKSP language: Allow dividing by any metric unit prefixes and allow
  division of same unit type on both sides (e.g. expression '8kHz / 1000Hz'
  yields in unit free result '8'). So this is now a way to cast units away
  e.g. for passing the result to other expressions, certain function calls
  or variables which are not accepting any units (or that specific unit).

* NKSP language: integer arrays and real number arrays can now be converted
  to strings (e.g. for dumping their content with message() calls for
  script debugging purposes).

* NKSP language: expressions and variables with units are now correctly
  casted to strings (e.g. with message() calls).

* NKSP language: comparing real numbers for equalness (e.g. '~foo = 3.1') or
  unequalness (e.g. '~foo # 3.1') is now less strict and takes the expected
  floating point tolerances into account.

* NKSP VM API: Added methods VMScalarNumberExpr::evalCastInt() and
  VMScalarNumberExpr::evalCastReal().

* NKSP VM API: Added base class 'VMNumberArrayExpr' for classes
  'VMIntArrayExpr' and 'VMRealArrayExpr'.

* NKSP VM API: replaced all unitPrefix() (parse time) methods by
  unitFactor() (runtime) methods.

* Built-in function "exit()" supports now returning units and 'final'ness
  exclusively for test cases.

* The following built-in functions support now units as well: "abs()",
  "random()", "inc()", "dec()", "in_range()", "min()", "max()",
  "real_to_int()", "int()", "int_to_real()" and "real()".

* Built-in functions "array_equal()", "search()" and "sort()" support now
  real number arrays (correctly) as well.

* Added individual parse time checks of arguments to be passed to built-in
  functions "random()", "inc()", "dec()", "in_range()", "min()", "max()",
  "array_equal()" and "search()" specific for their individual purposes.

* Test cases: Added massive amount of NKSP test cases for standard
  measuring units and 'final' operator usage cases.

* Test cases: Added NKSP test cases for (floating point tolerance aware)
  real number equalness / unequalness comparison.

* Bumped version (2.1.1.svn8).


Revision 3577 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 28 15:23:23 2019 UTC (4 years, 6 months ago) by schoenebeck
Original Path: linuxsampler/trunk/src/scriptvm/tests/NKSPTest.cpp
File length: 58933 byte(s)
Diff to previous 3575
NKSP: Introducing variable return type for built-in functions.

* Changed method signature VMFunction::returnType() ->
  VMFunction::returnType(VMFnArgs* args) to allow built-in
  functions to proclaim a different result value type depending
  on the arguments to be passed to the function.

* Built-in script function abs() optionally accepts and returns
  real number.

* Built-in script functions min() and max() optionally accept
  real number arguments and return real number as result in that
  case.

* Added real number test cases for the built-in abs(), min() and
  max() functions.

* Bumped version (2.1.1.svn7).


Revision 3575 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 28 11:12:04 2019 UTC (4 years, 6 months ago) by schoenebeck
Original Path: linuxsampler/trunk/src/scriptvm/tests/NKSPTest.cpp
File length: 56067 byte(s)
Diff to previous 3551
NKSP: Added some initial floating point test cases.

* RTMath: Implemented floating point comparison methods
  fEqual32(float,float) and fEqual64(double,double)
  which take the expected floating point tolerances
  into account.

* NKSP: Allow built-in exit() function to potentially
  accept real type argument as well.

* NKSP: Added real number test cases for built-in
  functions exit(), int_to_real(), real(), real_to_int()
  and int(), as well as for the plus, minus and negate
  language operators.


Revision 3551 - (view) (download) (annotate) - [select for diffs]
Added Thu Aug 1 10:22:56 2019 UTC (4 years, 7 months ago) by schoenebeck
Original Path: linuxsampler/trunk/src/scriptvm/tests/NKSPTest.cpp
File length: 33993 byte(s)
* Added test cases for NKSP core language aspects and core built-in
  functions.
* NKSP: Added method ScriptVM::setExitResultEnabled() which allows
  to explicitly enable the built-in exit() function to optionally
  accept one function argument; the value of the passed exit()
  function argument will then become available by calling
  VMExecContext::exitResult() after script execution.
* Bumped version (2.1.1.svn2).


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

  ViewVC Help
Powered by ViewVC