Расширить общие API графиков и GAS обмена
This commit is contained in:
@@ -9,7 +9,7 @@ int main(void) {
|
||||
const double y[] = {15, 10, 30, 1};
|
||||
const double drag[] = {0, 100, 500, -10, 10, 1};
|
||||
double back[4], bad[] = {NAN, 10, 8};
|
||||
assert(set_plot_abi_version() == 1);
|
||||
assert(set_plot_abi_version() == 2);
|
||||
assert(set_plot_eval(SET_PLOT_TRANSFORM, zoom, 10, output, 4) == 4);
|
||||
assert(output[0] == .125 && output[1] == 0 && output[2] == .5 && output[3] == 1);
|
||||
assert(output[4] == 12345);
|
||||
@@ -26,6 +26,13 @@ int main(void) {
|
||||
assert(output[0] == y[0]);
|
||||
assert(set_plot_eval(SET_PLOT_DRAG, drag, 6, output, 4) == 1);
|
||||
assert(output[0] == -4);
|
||||
{
|
||||
const double limits[] = {0, 500, -2, 2};
|
||||
const double reversed[] = {1, 1, -2, 2};
|
||||
assert(set_plot_eval(SET_PLOT_LIMITS, limits, 4, output, 4) == 4);
|
||||
assert(output[0] == 0 && output[1] == 500 && output[2] == -2 && output[3] == 2);
|
||||
assert(set_plot_eval(SET_PLOT_LIMITS, reversed, 4, output, 4) == 0);
|
||||
}
|
||||
puts("shared plot: OK");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user