~ubuntu-branches/ubuntu/oneiric/mpqc/oneiric

« back to all changes in this revision

Viewing changes to src/lib/util/misc/unittest.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2005-11-27 11:41:49 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051127114149-zgz9r3gk50w8ww2q
Tags: 2.3.0-1
* New upstream release.
* debian/rules (SONAME): Activate awk snippet for automatic so-name
  detection again, resulting in a bump to `7' and making a `c2a' for
  the C++ allocator change unnecessary; closes: #339232.
* debian/patches/00list (08_gcc-4.0_fixes): Removed, no longer needed.
* debian/rules (test): Remove workarounds, do not abort build if tests
  fail.
* debian/ref: Removed.
* debian/control.in (libsc): Added Conflict against libsc6c2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#include <util/misc/units.h>
6
6
#include <util/misc/formio.h>
7
7
 
 
8
#include <util/state/state.h>
 
9
#include <util/state/stateout.h>
 
10
static void (sc::SavableState::*force_state_link)(sc::StateOut&)
 
11
    = &sc::SavableState::save_state;
 
12
#include <util/state/linkage.h>
 
13
 
8
14
using namespace std;
9
15
using namespace sc;
10
16
 
12
18
// Unit conversion test program 
13
19
 
14
20
int main(int argc, char **argv) {
15
 
  if (argc != 2) {
 
21
  const char *unitstr = "kcal/mol";
 
22
 
 
23
  if (argc == 2) unitstr = argv[1];
 
24
 
 
25
  if (argc != 1) {
16
26
      cerr << "One argument, the unit to be converted, must be given" << endl;
17
27
      abort();
18
28
    }
19
29
  
20
 
  Ref<Units> unit = new Units(argv[1]);
 
30
  Ref<Units> unit = new Units(unitstr);
21
31
  cout << indent << "Conversion between " << unit->string_rep() << " and atomic units:" << endl;
22
32
  cout << setprecision(10);
23
33
  cout << indent << "From atomic units: " << unit->from_atomic_units() << endl;