Ignore:
Timestamp:
Oct 14, 2005 9:43:27 AM (18 years ago)
Author:
dkearney
Message:

This update brings us one step closer to being const correct in the RpUnits
class. Added a few more comments. All other files touched were made to
comply with the new const correct RpUnits.[h,cc]

File:
1 edited

Legend:

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

    r73 r104  
    3333    //
    3434    printf ("=============== TEST 1 ===============\n");
    35     RpUnits * meters = RpUnits::define("m", NULL);
     35    const RpUnits * meters = RpUnits::define("m", NULL);
    3636    // (meters) ? success() : fail();
    3737    // RpUnits * centimeter = RpUnits::define("cm", NULL);
     
    5454*/
    5555   
    56     RpUnits* mobility = RpUnits::define("cm2/Vs", NULL);
     56    const RpUnits* mobility = RpUnits::defineCmplx("cm2/Vs", NULL);
    5757    std::cout << "mobility = :" << mobility->getUnitsName() <<":"<< std::endl;
    5858
    59     RpUnits* mobility2 = RpUnits::find("cm2V-1s-1");
     59    const RpUnits* mobility2 = RpUnits::find("cm2V-1s-1");
    6060    if (mobility2) {
    6161        std::cout << "mobility2 exists" << std::endl;
     
    6767    }
    6868
    69     RpUnits* cmeters = RpUnits::find("cm");
    70     RpUnits* angstrom = RpUnits::define("A", NULL);
     69    const RpUnits* cmeters = RpUnits::find("cm");
     70    const RpUnits* angstrom = RpUnits::define("A", NULL);
    7171    RpUnits::define(angstrom, meters, angstrom2meter, meter2angstrom);
    7272
     
    7979
    8080
    81     RpUnits* fahrenheit  = RpUnits::define("F", NULL);
    82     RpUnits* celcius  = RpUnits::define("C", NULL);
    83     RpUnits* kelvin  = RpUnits::define("K", NULL);
     81    const RpUnits* fahrenheit  = RpUnits::define("F", NULL);
     82    const RpUnits* celcius  = RpUnits::define("C", NULL);
     83    const RpUnits* kelvin  = RpUnits::define("K", NULL);
    8484   
    8585    RpUnits::define(fahrenheit, celcius, fahrenheit2centigrade, centigrade2fahrenheit);
     
    155155    printf ("=============== TEST 4.4 ===============\n");
    156156
    157     RpUnits * millimeter = RpUnits::find("mm");
    158     RpUnits * micrometer = RpUnits::find("um");
    159     RpUnits * nanometer  = RpUnits::find("nm");
    160     RpUnits * picometer  = RpUnits::find("pm");
    161     RpUnits * femtometer = RpUnits::find("fm");
    162     RpUnits * attometer  = RpUnits::find("am");
    163     RpUnits * kilometer  = RpUnits::find("km");
    164     RpUnits * megameter  = RpUnits::find("Mm");
    165     RpUnits * gigameter  = RpUnits::find("Gm");
    166     RpUnits * terameter  = RpUnits::find("Tm");
    167     RpUnits * petameter  = RpUnits::find("Pm");
     157    const RpUnits * millimeter = RpUnits::find("mm");
     158    const RpUnits * micrometer = RpUnits::find("um");
     159    const RpUnits * nanometer  = RpUnits::find("nm");
     160    const RpUnits * picometer  = RpUnits::find("pm");
     161    const RpUnits * femtometer = RpUnits::find("fm");
     162    const RpUnits * attometer  = RpUnits::find("am");
     163    const RpUnits * kilometer  = RpUnits::find("km");
     164    const RpUnits * megameter  = RpUnits::find("Mm");
     165    const RpUnits * gigameter  = RpUnits::find("Gm");
     166    const RpUnits * terameter  = RpUnits::find("Tm");
     167    const RpUnits * petameter  = RpUnits::find("Pm");
    168168
    169169    value = 1.0e+3;
     
    256256
    257257
    258     RpUnits* eV  = RpUnits::define("eV", NULL);
    259     RpUnits* joules  = RpUnits::define("J", NULL);
     258    const RpUnits* eV  = RpUnits::define("eV", NULL);
     259    const RpUnits* joules  = RpUnits::define("J", NULL);
    260260   
    261261    RpUnits::define(eV, joules, electronVolt2joule, joule2electronVolt);
Note: See TracChangeset for help on using the changeset viewer.