Skip to content

Commit

Permalink
Fix BuildFile and code-format
Browse files Browse the repository at this point in the history
  • Loading branch information
aloeliger committed Feb 25, 2023
1 parent 736cee3 commit 84ea9e1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 29 deletions.
1 change: 0 additions & 1 deletion L1Trigger/L1TCaloLayer1/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@
<use name="hls4mlEmulatorExtras"/>
<use name="CICADA"/>
<use name="cppunit"/>
<use name="Utilities/Testing"/>
</bin>
51 changes: 23 additions & 28 deletions L1Trigger/L1TCaloLayer1/test/testCICADAEmulation.cppunit.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//Test of the external CICADA model emulation model loading and model unloading
//Developed by Andrew Loeliger, Princeton University, Feb 23, 2023

//We can't test a load of a bad model here, since that is a segfault, not an exception, which is
//We can't test a load of a bad model here, since that is a segfault, not an exception, which is
//OS level and cppunit cannot test against that in any way that qualifies as a success

//TODO: However, it would be good in the future to assure that loading multiple CICADA models at the
Expand All @@ -19,39 +19,34 @@
#include <memory>
#include "Utilities/Testing/interface/CppUnit_testdriver.icpp"

class test_CICADA: public CppUnit::TestFixture{
CPPUNIT_TEST_SUITE(test_CICADA);
CPPUNIT_TEST(doModelV1Load);
CPPUNIT_TEST(doModelV2Load);
CPPUNIT_TEST(doMultiModelLoad);
CPPUNIT_TEST_SUITE_END();

public:
void doModelV1Load();
void doModelV2Load();
void doMultiModelLoad();


class test_CICADA : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(test_CICADA);
CPPUNIT_TEST(doModelV1Load);
CPPUNIT_TEST(doModelV2Load);
CPPUNIT_TEST(doMultiModelLoad);
CPPUNIT_TEST_SUITE_END();

public:
void doModelV1Load();
void doModelV2Load();
void doMultiModelLoad();
};

CPPUNIT_TEST_SUITE_REGISTRATION(test_CICADA);

void test_CICADA::doModelV1Load(){
auto loader = hls4mlEmulator::ModelLoader("CICADAModel_v1");
auto model = loader.load_model();
void test_CICADA::doModelV1Load() {
auto loader = hls4mlEmulator::ModelLoader("CICADAModel_v1");
auto model = loader.load_model();
}

void test_CICADA::doModelV2Load(){
auto loader = hls4mlEmulator::ModelLoader("CICADAModel_v2");
auto model = loader.load_model();
void test_CICADA::doModelV2Load() {
auto loader = hls4mlEmulator::ModelLoader("CICADAModel_v2");
auto model = loader.load_model();
}

void test_CICADA::doMultiModelLoad(){
auto loader_v1 = hls4mlEmulator::ModelLoader("CICADAModel_v1");
auto loader_v2 = hls4mlEmulator::ModelLoader("CICADAModel_v2");
auto model_v1 = loader_v1.load_model();
auto model_v2 = loader_v2.load_model();
void test_CICADA::doMultiModelLoad() {
auto loader_v1 = hls4mlEmulator::ModelLoader("CICADAModel_v1");
auto loader_v2 = hls4mlEmulator::ModelLoader("CICADAModel_v2");
auto model_v1 = loader_v1.load_model();
auto model_v2 = loader_v2.load_model();
}



0 comments on commit 84ea9e1

Please sign in to comment.