source: sasview/sansmodels/test/library_test.cpp @ afd45674

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since afd45674 was 62dc94b, checked in by Mathieu Doucet <doucetm@…>, 13 years ago

Add quick test for the C++ library

  • Property mode set to 100644
File size: 555 bytes
Line 
1/*
2 * Sanity check to verify that one can link to the library
3 * and get models.
4 *
5 */
6#include <stdio.h>
7#include <iostream>
8#include "cylinder.h"
9#include <math.h>
10int main( int argc, const char* argv[] )
11{
12        std::cout << "Testing Cylinder Model" << std::endl;
13        CylinderModel * model = new CylinderModel();
14        double value = (*model)(0.001);
15        double reference = 450.355;
16
17        std::cout << "   I(q=0.001) = " << value;
18        if (fabs(value-reference)>0.01)
19                std::cout << "  ERROR: Expected " << reference << std::endl;
20        else
21                std::cout << "  OK" << std::endl;
22}
Note: See TracBrowser for help on using the repository browser.