File: TestHeader.cs

package info (click to toggle)
liblas 1.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,888 kB
  • ctags: 4,614
  • sloc: cpp: 31,630; xml: 4,195; python: 2,928; ansic: 2,439; cs: 2,411; sh: 143; makefile: 37
file content (74 lines) | stat: -rwxr-xr-x 2,885 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Liblas;
using System.Diagnostics;

namespace swig_test
{
   static internal class TestHeader
   {
      static private void Test(Header header)
      {
         Debug.Assert(Program.IsApprox(header.GetMinX(), 635619.85, 0.01));
         Debug.Assert(Program.IsApprox(header.GetMinY(), 848899.70, 0.01));
         Debug.Assert(Program.IsApprox(header.GetMinZ(), 406.59, 0.01));
           
         Debug.Assert(Program.IsApprox(header.GetMaxX(), 638982.55, 0.01));
         Debug.Assert(Program.IsApprox(header.GetMaxY(), 853535.43, 0.01));
         Debug.Assert(Program.IsApprox(header.GetMaxZ(), 586.38, 0.01));

         Debug.Assert(Program.IsApprox(header.GetScaleX(), 0.01, 0.01));
         Debug.Assert(Program.IsApprox(header.GetScaleY(), 0.01, 0.01));
         Debug.Assert(Program.IsApprox(header.GetScaleZ(), 0.01, 0.01));

         Debug.Assert(Program.IsApprox(header.GetOffsetX(), 0.0, 0.001));
         Debug.Assert(Program.IsApprox(header.GetOffsetY(), 0.0, 0.001));
         Debug.Assert(Program.IsApprox(header.GetOffsetZ(), 0.0, 0.001));

         Debug.Assert(header.GetFileSignature() == "LASF");
         Debug.Assert(header.GetFileSourceId() == 0);
         Debug.Assert(header.GetVersionMajor() == 1);
         Debug.Assert(header.GetVersionMinor() == 2);
         Debug.Assert(header.GetDataFormatId() == PointFormatName.ePointFormat3);
         Debug.Assert(header.GetPointRecordsCount() == 1065);

         return;
      }

      static public void Test_A(Header header)
      {
         Test(header);
         Debug.Assert(header.GetCreationDOY() == 0);
         Debug.Assert(header.GetCreationYear() == 0);
         Debug.Assert(header.GetRecordsCount() == 0);
         Debug.Assert(!header.Compressed());
         Debug.Assert(header.GetSystemId(false) == "");
         Debug.Assert(header.GetSoftwareId(true) == "TerraScan");
      }

      static public void Test_B(Header header)
      {
         Test(header);
         Debug.Assert(header.GetCreationDOY() == 0);
         Debug.Assert(header.GetCreationYear() == 0);
         Debug.Assert(header.GetRecordsCount() == 1);
         Debug.Assert(header.Compressed());
         Debug.Assert(header.GetSystemId(false) == "");
         Debug.Assert(header.GetSoftwareId(true) == "TerraScan");
      }

      static public void Test_T(Header header)
      {
         Test(header);
         Debug.Assert(header.GetCreationDOY() == 12);
         Debug.Assert(header.GetCreationYear() == 2011);
         Debug.Assert(header.GetRecordsCount() == 1);
         Debug.Assert(header.Compressed());
         Debug.Assert(header.GetSystemId(false) == "liblas test");
         Debug.Assert(header.GetSoftwareId(true) == "swig test");
      }
   }
}