/*
* The Spar Library - A comprehensive math application framework
* Copyright (C) 2000,2001 Davide Angelocola <davide178@inwind.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <spar/sl_application.h>
#include <spar/sl_test.h>
int
complex_main (void)
{
sl_complex z1 = sl_complex_def (8, 8);
sl_complex z2 = sl_complex_def (6., 2.);
sl_test_init ();
{
sl_complex z = sl_complex_add (z1, z2);
sl_complex e = sl_complex_def (14., 10.);
sl_test_complex_with_message ("Complex ADD", z, e);
}
{
sl_complex z = sl_complex_sub (z1, z2);
sl_complex e = sl_complex_def (2., 6.);
sl_test_complex_with_message ("Complex SUB", z, e);
}
sl_test_summary_with_message ("Complex Test");
return SL_SUCCESS;
}
sl_application complex = {
name:"complex test",
version:"0.1",
author:"Davide Angelocola",
description:"Tests complex library",
welcome:NULL,
options: SL_APP_GETOPT | SL_APP_PRECISION,
modules_config_file:"",
main:(int (*)(int, char **)) complex_main,
init:NULL,
de_init:NULL
};
SL_APPLICATION (complex);
syntax highlighted by Code2HTML, v. 0.9.1