Skip to content

Commit

Permalink
Merge pull request #7147 from maloel/linux
Browse files Browse the repository at this point in the history
Fix AC unit-tests file separators in Linux
  • Loading branch information
ev-mp authored Aug 24, 2020
2 parents ee2dfa6 + e305494 commit 78f4fea
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
8 changes: 4 additions & 4 deletions unit-tests/algo/d2rgb/d2rgb-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ void init_algo( algo::optimizer & cal,
if( profiler )
profiler->section( "Preprocessing YUY" );
cal.set_yuy_data(
read_image_file< algo::yuy_t >( dir + yuy, camera.rgb.width, camera.rgb.height ),
read_image_file< algo::yuy_t >( dir + yuy_prev, camera.rgb.width, camera.rgb.height ),
read_image_file< algo::yuy_t >( join( dir, yuy ), camera.rgb.width, camera.rgb.height ),
read_image_file< algo::yuy_t >( join( dir, yuy_prev ), camera.rgb.width, camera.rgb.height ),
std::move(yuy_last_successful_frame),
calibration
);
Expand All @@ -63,7 +63,7 @@ void init_algo( algo::optimizer & cal,
if( profiler )
profiler->section( "Preprocessing IR" );
cal.set_ir_data(
read_image_file< algo::ir_t >( dir + ir, camera.z.width, camera.z.height ),
read_image_file< algo::ir_t >( join( dir, ir ), camera.z.width, camera.z.height ),
camera.z.width, camera.z.height
);
if( profiler )
Expand All @@ -72,7 +72,7 @@ void init_algo( algo::optimizer & cal,
if( profiler )
profiler->section( "Preprocessing DEPTH" );
cal.set_z_data(
read_image_file< algo::z_t >( dir + z, camera.z.width, camera.z.height ),
read_image_file< algo::z_t >( join( dir, z ), camera.z.width, camera.z.height ),
camera.z, camera.dsm_params, camera.cal_info, camera.cal_regs, camera.z_units
);
if( profiler )
Expand Down
3 changes: 2 additions & 1 deletion unit-tests/algo/d2rgb/scene-data.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
#include <fstream>
#include <string>
#include "../../../src/algo/depth-to-rgb-calibration/k-to-dsm.h"
#include "../../filesystem.h"

inline std::string bin_dir( std::string const & scene_dir )
{
return scene_dir + "binFiles\\ac2\\";
return join( join( scene_dir, "binFiles" ), "ac2" );
}


Expand Down
14 changes: 6 additions & 8 deletions unit-tests/algo/d2rgb/test-reproduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
template< typename T >
void read_binary_file( char const * dir, char const * bin, T * data )
{
std::string filename = dir;
filename += "\\";
filename += bin;
std::string filename = join( dir, bin );
AC_LOG( DEBUG, "... " << filename );
std::fstream f = std::fstream( filename, std::ios::in | std::ios::binary );
if( ! f )
Expand Down Expand Up @@ -212,11 +210,11 @@ int main( int argc, char * argv[] )
memory_profiler profiler;
init_algo( cal,
dir,
"\\rgb.raw",
"\\rgb_prev.raw",
"\\rgb_last_successful.raw",
"\\ir.raw",
"\\depth.raw",
"rgb.raw",
"rgb_prev.raw",
"rgb_last_successful.raw",
"ir.raw",
"depth.raw",
camera,
&profiler );

Expand Down
2 changes: 1 addition & 1 deletion unit-tests/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ static void glob_rec( const std::string & directory,
}
else
{
throw std::runtime_error( to_string() << "could not open directory: " << directory.c_str() );
throw std::runtime_error( librealsense::to_string() << "could not open directory: " << directory.c_str() );
}
}

Expand Down

0 comments on commit 78f4fea

Please sign in to comment.