Changeset 73 for trunk/test/src


Ignore:
Timestamp:
Sep 28, 2005 12:09:43 AM (19 years ago)
Author:
dkearney
Message:
  1. changes to RpUnits, modified RpUnits::define() function not to look for base units.
  2. changed python RpUnits to return string when units!="off" and a number when units=="off"
  3. modified make files, hopefully making them easier to read, removing vpaths,

cleaning up the make process, combining smaller libraries into one library,
librappture, and putting the core objects into one library - libRpObjects,
for testing.

  1. copied rpResult function into rappture_interface.c to stop compiler from

complaining about undefined references ot the function. trying to use the
function probably won't work. but that can be fixed after the repository is
reorganized.

  1. in example/app-fermi/python/fermi.py, changed exit() to sys.exit() to

stop python from complaining about no function called exit().

  1. examples/app-fermi/fortran still does not run, but new rappture parser

should take care of these problems. (same with examples/fermi_fortran)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/src/RpUnits_test.cc

    r68 r73  
    152152
    153153*/
     154
    154155    printf ("=============== TEST 4.4 ===============\n");
    155156
     
    252253    std::cout << "strValue convert(300K,C,0) = " << strValue << std::endl;
    253254
     255
     256
     257
     258    RpUnits* eV  = RpUnits::define("eV", NULL);
     259    RpUnits* joules  = RpUnits::define("J", NULL);
     260   
     261    RpUnits::define(eV, joules, electronVolt2joule, joule2electronVolt);
     262   
     263    value = joules->convert(eV,1,&result);
     264    std::cout << "1 joule = " << value << " electronVolts" << std::endl;
     265   
     266    value = eV->convert(joules,1,&result);
     267    std::cout << "1 electronVolt = " << value << " joules" << std::endl;
     268   
     269    strValue = RpUnits::convert("10eV","J",1);
     270    std::cout << "strValue convert(10eV,J,1) = " << strValue << std::endl;
     271
     272    strValue = RpUnits::convert("1eV","J",0);
     273    std::cout << "strValue convert(1eV,J,0) = " << strValue << std::endl;
     274   
     275    strValue = RpUnits::convert("10J","eV",1);
     276    std::cout << "strValue convert(10J,eV,1) = " << strValue << std::endl;
     277
     278    strValue = RpUnits::convert("1J","eV",0);
     279    std::cout << "strValue convert(1J,eV,0) = " << strValue << std::endl;
     280   
    254281    return 0;
    255282}
Note: See TracChangeset for help on using the changeset viewer.