MCPcopy Create free account
hub / github.com/LASzip/LASzip / run_test

Function run_test

example/laszippertest.cpp:720–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

718//---------------------------------------------------------------------------
719
720static void run_test(const char* filename, PointData& data, unsigned short compressor, int requested_version=-1, int chunk_size=-1, bool random_seeks=false)
721{
722 //
723 // COMPRESSION
724 //
725
726 // setting up LASzip parameters
727 LASzip laszip;
728 if (!laszip.setup(data.point_type, data.point_size, compressor))
729 {
730 log("ERROR on laszip.setup(): %s\n", laszip.get_error());
731 }
732 if (requested_version > -1) laszip.request_version((unsigned short)requested_version);
733 if (chunk_size > -1) laszip.set_chunk_size((unsigned int)chunk_size);
734
735 // packing up LASzip
736 unsigned char* bytes;
737 int num;
738 if (!laszip.pack(bytes, num))
739 {
740 log("ERROR on laszip.pack(): %s\n", laszip.get_error());
741 }
742
743 // creating the output stream
744 OStream* ost = new OStream(settings->use_iostream, filename);
745
746 // creating the zipper
747 LASzipper* laszipper = make_zipper(ost, &laszip);
748
749 // allocating the data to read from
750 data.setup(laszip.num_items, laszip.items);
751
752 // writing the points
753 if (chunk_size == 0)
754 {
755 if (random_seeks)
756 write_points_explicit_chunk_seek(laszipper, data);
757 else
758 write_points_explicit_chunk(laszipper, data);
759 }
760 else
761 {
762 if (random_seeks)
763 write_points_seek(laszipper, data);
764 else
765 write_points(laszipper, data);
766 }
767
768 // cleaning up
769 delete laszipper;
770 delete ost;
771
772 //
773 // DECOMPRESSION
774 //
775
776 // setting up LASzip parameters
777 LASzip laszip_dec;

Callers 1

mainFunction · 0.85

Calls 15

logFunction · 0.85
make_zipperFunction · 0.85
write_points_seekFunction · 0.85
write_pointsFunction · 0.85
make_unzipperFunction · 0.85
read_points_seekFunction · 0.85
read_pointsFunction · 0.85
request_versionMethod · 0.80
set_chunk_sizeMethod · 0.80
setupMethod · 0.45

Tested by

no test coverage detected