Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:18

0001 // ./SName_test.sh
0002 #include <iostream>
0003 #include <iomanip>
0004 #include <cstring>
0005 #include <string>
0006 
0007 #include "SName.h"
0008 
0009 void test_args(int argc, char** argv)
0010 {
0011     const char* name = argv[0] ;     
0012     char* sname = strdup(name); 
0013 
0014     int nj = int(strlen(sname)) ; 
0015     
0016     for(int j=0 ; j < nj ; j++) std::cout << std::setw(2) << j << " " << sname[j] << std::endl  ; 
0017     std::cout << std::endl ; 
0018 
0019 
0020     for(int j=0 ; j < nj ; j++) 
0021     {
0022         sname[nj-1-j] = '\0' ; 
0023         std::cout 
0024              << std::setw(3) << strlen(sname)
0025              << " : "
0026              << sname 
0027              << std::endl 
0028              ; 
0029     }
0030 }
0031 
0032 void test_Load()
0033 {
0034     const char* idp = "$HOME/.opticks/GEOM/$GEOM/CSGFoundry/meshname.txt" ; 
0035     SName* id = SName::Load(idp); 
0036     std::cout << id->detail() << std::endl ; 
0037 }
0038 
0039 void test_GEOMLoad()
0040 {
0041     SName* id = SName::GEOMLoad(); 
0042     std::cout 
0043         << "test_GEOMLoad"
0044         << std::endl 
0045         << "SName* id = SName::GEOMLoad() ; id->detail() " 
0046         << std::endl 
0047         << id->detail()
0048         << std::endl 
0049         ; 
0050 }
0051 
0052 int main(int argc, char** argv)
0053 {
0054     /*
0055     test_args(argc, argv); 
0056     test_Load(); 
0057     */
0058     test_GEOMLoad(); 
0059 
0060     return 0 ; 
0061 }