Skip to content

Commit

Permalink
Now exiting in test programs when failing to open data files
Browse files Browse the repository at this point in the history
  • Loading branch information
hosseinmoein committed Jan 26, 2025
1 parent 6c2c9a1 commit 2e964d0
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/HTML/DataFrame.html
Original file line number Diff line number Diff line change
Expand Up @@ -1999,8 +1999,15 @@ <H2 ID="9"><font color="blue">Build Instructions <font size="+4">&#x1F6E0;</font
<font size="+1"><B>Using Package Managers:</B></font><BR>
DataFrame is available on <a href="https://conan.io/center/recipes/dataframe"<I>Conan</I></a> platform. See the <a href="https://docs.conan.io/2/"<I>Conan docs</I></a> for more information.<BR>
DataFrame is also available on <a href="https://vcpkg.link/ports/dataframe"<I>VCPKG</I></a> platform. See <a href="https://learn.microsoft.com/en-us/vcpkg/"<I>VCPKG docs</i></a> for more information<BR>

<BR><font size="+1"><B>Cloning Repo:</B></font><BR>
<font size="+1">
<pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"> <span style="color:#bb7977; font-weight:bold; ">git clone https</span><span style="color:#800000; font-weight:bold; ">:</span><span style="color:#808030; ">/</span><span style="color:#808030; ">/</span><span style="color:#0000e6; ">github</span><span style="color:#808030; ">.</span><span style="color:#0000e6; ">com</span><span style="color:#808030; ">/</span><span style="color:#0000e6; ">hosseinmoein</span><span style="color:#808030; ">/</span><span style="color:#0000e6; ">DataFrame</span><span style="color:#808030; ">.</span><span style="color:#0000e6; ">git</span></span>
<span class="line_wrapper"></span></pre>
</font>
</P>


<BR><a href="https://github.com/hosseinmoein/DataFrame?tab=readme-ov-file">&#8592; Back to Github</a><BR>

</body></html>
Expand Down
9 changes: 9 additions & 0 deletions test/dataframe_tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ static void test_read() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
df_read.write<std::ostream,
int,
Expand All @@ -548,6 +549,7 @@ static void test_read() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
df_read_str.write<std::ostream,
int,
Expand All @@ -571,6 +573,7 @@ static void test_read() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
df_read_dt.write<std::ostream,
int,
Expand Down Expand Up @@ -1318,6 +1321,7 @@ static void test_dataframe_friend_plus_operator() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}

MyDataFrame result =
Expand Down Expand Up @@ -1374,6 +1378,7 @@ static void test_dataframe_friend_minus_operator() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}

// Notice I am omitting std::string here, since minus is not defined for
Expand Down Expand Up @@ -1495,6 +1500,7 @@ static void test_dataframe_friend_scaler_operator() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}

const auto col_size = df.get_index().size();
Expand Down Expand Up @@ -3548,6 +3554,7 @@ static void test_reading_writing_json() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -5296,6 +5303,7 @@ static void test_data_frame_newlines() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
assert(df2.get_index().size() == 8);
assert(df2.get_column<int>("n1")[0] == 68);
Expand All @@ -5316,6 +5324,7 @@ static void test_data_frame_newlines() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
assert(df1.get_index().size() == 8);
assert(df1.get_column<std::string>("abc")[0] == "A");
Expand Down
38 changes: 38 additions & 0 deletions test/dataframe_tester_2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,7 @@ static void test_RSIVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -1110,6 +1111,7 @@ static void test_bucketize() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -1485,6 +1487,7 @@ static void test_io_format_csv2() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
df_read.write<std::ostream,
int,
Expand Down Expand Up @@ -2729,6 +2732,7 @@ static void test_DT_IBM_data() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -2990,6 +2994,7 @@ static void test_WilliamPrcRVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3030,6 +3035,7 @@ static void test_PSLVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3061,6 +3067,7 @@ static void test_CCIVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3129,6 +3136,7 @@ static void test_GarmanKlassVolVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3161,6 +3169,7 @@ static void test_YangZhangVolVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3321,6 +3330,7 @@ static void test_no_index_reads() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3353,6 +3363,7 @@ static void test_KamaVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3385,6 +3396,7 @@ static void test_FisherTransVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3417,6 +3429,7 @@ static void test_PercentPriceOSCIVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3449,6 +3462,7 @@ static void test_SlopeVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3480,6 +3494,7 @@ static void test_UltimateOSCIVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3572,6 +3587,7 @@ static void test_UlcerIndexVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3605,6 +3621,7 @@ static void test_RSXVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3638,6 +3655,7 @@ static void test_TTMTrendVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3695,6 +3713,7 @@ static void test_ParabolicSARVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3726,6 +3745,7 @@ static void test_EBSineWaveVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3773,6 +3793,7 @@ static void test_EhlerSuperSmootherVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3807,6 +3828,7 @@ static void test_VarIdxDynAvgVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3938,6 +3960,7 @@ static void test_PivotPointSRVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -3970,6 +3993,7 @@ static void test_AvgDirMovIdxVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4029,6 +4053,7 @@ static void test_HoltWinterChannelVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4088,6 +4113,7 @@ static void test_HeikinAshiCndlVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4177,6 +4203,7 @@ static void test_FastFourierTransVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4209,6 +4236,7 @@ static void test_CenterOfGravityVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4241,6 +4269,7 @@ static void test_ArnaudLegouxMAVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4273,6 +4302,7 @@ static void test_RateOfChangeVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4307,6 +4337,7 @@ static void test_AccumDistVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4342,6 +4373,7 @@ static void test_ChaikinMoneyFlowVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4374,6 +4406,7 @@ static void test_VertHorizFilterVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4409,6 +4442,7 @@ static void test_OnBalanceVolumeVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4465,6 +4499,7 @@ static void test_TrueRangeVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4497,6 +4532,7 @@ static void test_DecayVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4530,6 +4566,7 @@ static void test_HodgesTompkinsVolVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down Expand Up @@ -4563,6 +4600,7 @@ static void test_ParkinsonVolVisitor() {
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
::exit(-1);
}
}

Expand Down
Loading

0 comments on commit 2e964d0

Please sign in to comment.