comparison base/test/TestScaleTickIntervals.h @ 1416:9a8995785827 scale-ticks

Another test, that needs some more work
author Chris Cannam
date Thu, 04 May 2017 13:19:57 +0100
parents 12316a9bcc8f
children 359147a50853
comparison
equal deleted inserted replaced
1415:12316a9bcc8f 1416:9a8995785827
452 compareTicks(ticks.ticks, expected); 452 compareTicks(ticks.ticks, expected);
453 } 453 }
454 454
455 void linear_0_1_0() 455 void linear_0_1_0()
456 { 456 {
457 // senseless input
457 auto ticks = ScaleTickIntervals::linear({ 0, 1, 0 }); 458 auto ticks = ScaleTickIntervals::linear({ 0, 1, 0 });
458 vector<ScaleTickIntervals::Tick> expected { 459 vector<ScaleTickIntervals::Tick> expected {
459 }; 460 };
460 compareTicks(ticks.ticks, expected); 461 compareTicks(ticks.ticks, expected);
461 } 462 }
462 463
463 void linear_0_1_m1() 464 void linear_0_1_m1()
464 { 465 {
466 // senseless input
465 auto ticks = ScaleTickIntervals::linear({ 0, 1, -1 }); 467 auto ticks = ScaleTickIntervals::linear({ 0, 1, -1 });
466 vector<ScaleTickIntervals::Tick> expected { 468 vector<ScaleTickIntervals::Tick> expected {
467 }; 469 };
468 compareTicks(ticks.ticks, expected); 470 compareTicks(ticks.ticks, expected);
469 } 471 }
470 472
473 void linear_0p465_778_10()
474 {
475 // a case that gave unsatisfactory results in real life
476 auto ticks = ScaleTickIntervals::linear({ 0.465, 778.08, 10 });
477 vector<ScaleTickIntervals::Tick> expected {
478 };
479 compareTicks(ticks.ticks, expected);
480 }
481
471 void log_1_10_2() 482 void log_1_10_2()
472 { 483 {
473 auto ticks = ScaleTickIntervals::logarithmic({ 1, 10, 2 }); 484 auto ticks = ScaleTickIntervals::logarithmic({ 1, 10, 2 });
474 vector<ScaleTickIntervals::Tick> expected { 485 vector<ScaleTickIntervals::Tick> expected {
475 { 1.0, "1.0" }, 486 { 1.0, "1.0" },