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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3744 by schoenebeck, Sat Feb 15 11:50:02 2020 UTC revision 3745 by schoenebeck, Sat Feb 15 12:21:34 2020 UTC
# Line 8904  end on Line 8904  end on
8904          .expectStringExitResult = "7000ms",          .expectStringExitResult = "7000ms",
8905      });      });
8906    
8907        runScript({
8908            .code = R"NKSP_CODE(
8909    on init
8910      declare $foo := 700ms
8911      exit( int_to_real($foo) / 7.0 )
8912    end on
8913    )NKSP_CODE",
8914            .expectRealExitResult = 100.0,
8915            .expectExitResultUnitPrefix = { VM_MILLI },
8916            .expectExitResultUnit = VM_SECOND
8917        });
8918    
8919        runScript({
8920            .code = R"NKSP_CODE(
8921    on init
8922      declare $foo := 700ms
8923      exit( int_to_real($foo) / 7.0 & "" )
8924    end on
8925    )NKSP_CODE",
8926            .expectStringExitResult = "100ms"
8927        });
8928    
8929      // 'final' ('!') operator tests ...      // 'final' ('!') operator tests ...
8930    
8931      runScript({      runScript({
# Line 9005  end on Line 9027  end on
9027          .expectStringExitResult = "7000ms",          .expectStringExitResult = "7000ms",
9028      });      });
9029    
9030        runScript({
9031            .code = R"NKSP_CODE(
9032    on init
9033      declare $foo := 700ms
9034      exit( real($foo) / 7.0 )
9035    end on
9036    )NKSP_CODE",
9037            .expectRealExitResult = 100.0,
9038            .expectExitResultUnitPrefix = { VM_MILLI },
9039            .expectExitResultUnit = VM_SECOND
9040        });
9041    
9042        runScript({
9043            .code = R"NKSP_CODE(
9044    on init
9045      declare $foo := 700ms
9046      exit( real($foo) / 7.0 & "" )
9047    end on
9048    )NKSP_CODE",
9049            .expectStringExitResult = "100ms"
9050        });
9051    
9052      // 'final' ('!') operator tests ...      // 'final' ('!') operator tests ...
9053    
9054      runScript({      runScript({
# Line 9095  end on Line 9139  end on
9139          .expectStringExitResult = "9000us",          .expectStringExitResult = "9000us",
9140      });      });
9141    
9142        runScript({
9143            .code = R"NKSP_CODE(
9144    on init
9145      declare ~foo := 700.0ms
9146      exit( real_to_int(~foo) / 7 )
9147    end on
9148    )NKSP_CODE",
9149            .expectIntExitResult = 100,
9150            .expectExitResultUnitPrefix = { VM_MILLI },
9151            .expectExitResultUnit = VM_SECOND
9152        });
9153    
9154        runScript({
9155            .code = R"NKSP_CODE(
9156    on init
9157      declare ~foo := 700.0ms
9158      exit( real_to_int(~foo) / 7 & "" )
9159    end on
9160    )NKSP_CODE",
9161            .expectStringExitResult = "100ms"
9162        });
9163    
9164      // 'final' ('!') operator tests ...      // 'final' ('!') operator tests ...
9165    
9166      runScript({      runScript({
# Line 9185  end on Line 9251  end on
9251          .expectStringExitResult = "9000us",          .expectStringExitResult = "9000us",
9252      });      });
9253    
9254        runScript({
9255            .code = R"NKSP_CODE(
9256    on init
9257      declare ~foo := 700.0ms
9258      exit( int(~foo) / 7 )
9259    end on
9260    )NKSP_CODE",
9261            .expectIntExitResult = 100,
9262            .expectExitResultUnitPrefix = { VM_MILLI },
9263            .expectExitResultUnit = VM_SECOND
9264        });
9265    
9266        runScript({
9267            .code = R"NKSP_CODE(
9268    on init
9269      declare ~foo := 700.0ms
9270      exit( int(~foo) / 7 & "" )
9271    end on
9272    )NKSP_CODE",
9273            .expectStringExitResult = "100ms"
9274        });
9275    
9276      // 'final' ('!') operator tests ...      // 'final' ('!') operator tests ...
9277    
9278      runScript({      runScript({
# Line 9880  end on Line 9968  end on
9968          .expectExitResultUnit = VM_HERTZ          .expectExitResultUnit = VM_HERTZ
9969      });      });
9970    
9971        runScript({
9972            .code = R"NKSP_CODE(
9973    on init
9974      exit( ceil(9.4ms / 2.0) )
9975    end on
9976    )NKSP_CODE",
9977            .expectRealExitResult = 5.0,
9978            .expectExitResultUnitPrefix = { VM_MILLI },
9979            .expectExitResultUnit = VM_SECOND
9980        });
9981    
9982        runScript({
9983            .code = R"NKSP_CODE(
9984    on init
9985      exit( ceil( ceil(8.4us) / 2.0) )
9986    end on
9987    )NKSP_CODE",
9988            .expectRealExitResult = 5.0,
9989            .expectExitResultUnitPrefix = { VM_MICRO },
9990            .expectExitResultUnit = VM_SECOND
9991        });
9992    
9993      // 'final' ('!') operator tests ...      // 'final' ('!') operator tests ...
9994    
9995      runScript({      runScript({
# Line 9978  end on Line 10088  end on
10088          .expectExitResultUnit = VM_HERTZ          .expectExitResultUnit = VM_HERTZ
10089      });      });
10090    
10091        runScript({
10092            .code = R"NKSP_CODE(
10093    on init
10094      exit( floor(4.4ms / 2.0) )
10095    end on
10096    )NKSP_CODE",
10097            .expectRealExitResult = 2.0,
10098            .expectExitResultUnitPrefix = { VM_MILLI },
10099            .expectExitResultUnit = VM_SECOND
10100        });
10101    
10102        runScript({
10103            .code = R"NKSP_CODE(
10104    on init
10105      exit( floor( floor(8.4us) / 4.0) )
10106    end on
10107    )NKSP_CODE",
10108            .expectRealExitResult = 2.0,
10109            .expectExitResultUnitPrefix = { VM_MICRO },
10110            .expectExitResultUnit = VM_SECOND
10111        });
10112    
10113      // 'final' ('!') operator tests ...      // 'final' ('!') operator tests ...
10114    
10115      runScript({      runScript({

Legend:
Removed from v.3744  
changed lines
  Added in v.3745

  ViewVC Help
Powered by ViewVC