Changeset 73 for trunk/test


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)

Location:
trunk/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/make.inc

    r41 r73  
    1313
    1414RpBoolean_test: $(SRC_TEST)/RpBoolean_test.cc libRpBoolean
    15         $(CPP) $(DEBUG) $(INCL_CORE) -o $(BIN_DIR)/$@ $< $(LIB_RP_BOOLEAN)
     15        $(CPP) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_BOOLEAN)
    1616   
    1717RpChoice_test: $(SRC_TEST)/RpChoice_test.cc libRpChoice
    18         $(CPP) $(DEBUG) $(INCL_CORE) -o $(BIN_DIR)/$@ $< $(LIB_RP_CHOICE)
     18        $(CPP) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_CHOICE)
    1919   
    2020RpNumber_test: $(SRC_TEST)/RpNumber_test.cc libRpNumber
    21         $(CPP) $(DEBUG) $(INCL_CORE) -o $(BIN_DIR)/$@ $< $(LIB_RP_NUMBER)
     21        $(CPP) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_NUMBER)
    2222
    2323RpString_test: $(SRC_TEST)/RpString_test.cc libRpString
    24         $(CPP) $(DEBUG) $(INCL_CORE) -o $(BIN_DIR)/$@ $< $(LIB_RP_STRING)
     24        $(CPP) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_STRING)
    2525
    2626RpUnits_test: $(SRC_TEST)/RpUnits_test.cc libRpUnits
    27         $(CPP) $(DEBUG) $(INCL_CORE) -o $(BIN_DIR)/$@ $< $(LIB_RP_UNITS)
     27        $(CPP) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_UNITS)
    2828
    2929RpVariable_test: $(SRC_TEST)/RpVariable_test.cc libRpVariable
    30         $(CPP) $(DEBUG) $(INCL_CORE) -o $(BIN_DIR)/$@ $< $(LIB_RP_VARIABLE)
     30        $(CPP) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_VARIABLE)
    3131
    32 RpUnitsC_test: $(SRC_TEST)/RpUnitsC_test.c $(WORK_DIR)/RpUnitsCInterface.o
    33         $(CC) $(DEBUG) $(INCL_CEE) $(INCL_CORE) -o $(BIN_DIR)/$@ $^ $(LIB_RP_UNITS)
     32RpUnitsC_test: $(SRC_TEST)/RpUnitsC_test.c RpUnitsCInterface.o
     33        $(CC) $(DEBUG) $(INCL_CEE) $(INCL_CORE) -o $@ $^ $(LIB_RP_UNITS)
    3434
  • 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.