@@ -12,7 +12,7 @@ TEST_CASE("A json item is correctly output", "[Isotope]")
12
12
13
13
// Pick a random isotope to check output of
14
14
const int id{ 56 };
15
- std::string data{
15
+ const std::string data{
16
16
" {\" A\" :14,\" Z\" :5,\" N\" :9,\" Symbol\" :\" B\" ,\" Decay\" :\" B-\" ,\" Experimental\" :0,\" NubaseMassExcess\" :23664.0000,"
17
17
" \" ErrorNubaseMassExcess\" :21.0000,\" AMEMassExcess\" :23663.6830,\" ErrorAMEMassExcess\" :21.2130,\" HalfLife\" :1."
18
18
" 250e-02,\" SingleNeutronSeparationEnergy\" :969.8000,\" ErrorSingleNeutronSeparationEnergy\" :21.2400,"
@@ -28,3 +28,34 @@ TEST_CASE("A json item is correctly output", "[Isotope]")
28
28
};
29
29
REQUIRE (table.fullDataTable .at (id).writeAsJSON (false ) == data);
30
30
}
31
+
32
+
33
+ TEST_CASE (" A csv item is correctly output" , " [Isotope]" )
34
+ {
35
+ MassTable table (2020 );
36
+ table.setFilePaths ();
37
+ REQUIRE (table.populateInternalMassTable ());
38
+
39
+ // Pick a random isotope to check output of
40
+ const int id{ 95 };
41
+ const std::string data{
42
+ " 19,8,11,O,B-,0,3332.9000,2.6000,3332.8580,2.6370,2.647e+01,3955.6439,2.6370,17069.2807,18.7558,12001.0141,2.6370,"
43
+ " 32276.9638,17.5639,7566.4952,0.1388,3577.9690,2.8300,4820.3029,2.6370,-8965.2032,2.7556,1580.8043,2.6418,-28875."
44
+ " 3789,30.1157,-5611.5727,2.6774,-28505.5362,60.0590,6173.5861,15.2300,2513.0058,3.5000,-4714.8732,4.4445,1936"
45
+ };
46
+ REQUIRE (table.fullDataTable .at (id).writeAsCSV () == data);
47
+ }
48
+
49
+
50
+ TEST_CASE (" The csv header is populated correctly" , " [Isotope]" )
51
+ {
52
+ const std::string header{
53
+ " A,Z,N,Symbol,Decay,Experimental,NubaseMassExcess,ErrorNubaseMassExcess,AMEMassExcess,ErrorAMEMassExcess,HalfLife,"
54
+ " SingleNeutronSeparationEnergy,ErrorSingleNeutronSeparationEnergy,SingleProtonSeparationEnergy,"
55
+ " ErrorSingleProtonSeparationEnergy,DoubleNeutronSeparationEnergy,ErrorDoubleNeutronSeparationEnergy,"
56
+ " DoubleProtonSeparationEnergy,ErrorDoubleProtonSeparationEnergy,BindingEnergyPerA,ErrorBindingEnergyPerA,"
57
+ " AtomicMass,ErrorAtomicMass,BetaDecayEnergy,ErrorBetaDecayEnergy,QAlpha,ErrorQAlpha,Q2B-,ErrorQ2B-,Qepsilon_p,"
58
+ " ErrorQepsilon_p,QB-n,ErrorQB-n,Q4B-,ErrorQ4B-,QdAlpha,ErrorQdAlpha,QpAlpha,ErrorQpAlpha,QnAlpha,ErrorQnAlpha,Year"
59
+ };
60
+ REQUIRE (Isotope::writeCSVHeader () == header);
61
+ }
0 commit comments