PageRenderTime 44ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/octave/overload_complicated_runme.m

#
MATLAB | 58 lines | 43 code | 15 blank | 0 comment | 12 complexity | 7d6650b29f7511ef07a5cac3c03171a8 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. overload_complicated
  2. pInt = None;
  3. # Check the correct constructors are available
  4. p = Pop(pInt);
  5. p = Pop(pInt, 0);
  6. # Check overloaded in const only and pointers/references which target languages cannot disambiguate
  7. if (p.hip(0) != 701)
  8. error("Test 1 failed")
  9. endif
  10. if (p.hip(pInt) != 702)
  11. error("Test 2 failed")
  12. endif
  13. # Reverse the order for the above
  14. if (p.hop(pInt) != 805)
  15. error("Test 3 failed")
  16. endif
  17. if (p.hop(0) != 801)
  18. error("Test 4 failed")
  19. endif
  20. # Few more variations and order shuffled
  21. if (p.pop(0) != 901)
  22. error("Test 5 failed")
  23. endif
  24. if (p.pop(pInt) != 902)
  25. error("Test 6 failed")
  26. endif
  27. if (p.pop() != 905)
  28. error("Test 7 failed")
  29. endif
  30. # Overload on const only
  31. if (p.bop(pInt) != 1001)
  32. error("Test 8 failed")
  33. endif
  34. if (p.bip(pInt) != 2001)
  35. error("Test 9 failed")
  36. endif
  37. # Globals
  38. if (muzak(0) != 3001)
  39. error("Test 10 failed")
  40. endif
  41. if (muzak(pInt) != 3002)
  42. error("Test 11 failed")
  43. endif