function testresult = KMLcontour3_test()
%KMLCONTOUR3_TEST  unit test for KMLcontour3
%  
%See also: KMLcontour3

MTestCategory.Unit;
disp(['... running test:',mfilename])

   [lat,lon] = meshgrid(54:.1:57,2:.1:5);
   z = peaks(31);
   z = abs(z);

   %% z==c

   KMLcontour3(lat+5 ,lon,   z,'fileName',KML_testdir('KMLcontour3_1c.kml'),'writeLabels',false,'colorMap',@(m) gray(m));
   KMLcontour3(lat   ,lon,   z,'fileName',KML_testdir('KMLcontour3_2c.kml'),'zScaleFun',@(z) (z+1)*2000,'writeLabels',true,'labelInterval',10);
   KMLcontour3(lat+10,lon,   z,'fileName',KML_testdir('KMLcontour3_3c.kml'),'writeLabels',false,'cLim',[-10 10],'lineWidth',3,'colorMap',@(m) colormap_cpt('temperature',m));
   KMLcontour3(lat+ 5,lon*10,z,'fileName',KML_testdir('KMLcontour3_4c.kml'),'zScaleFun',@(z) (z.^2)*10000,'writeLabels',true,'cLim',[200 300],'labelDecimals',4);

   %% z is not c

   KMLcontour3(lat   ,lon,   z,z','description','indentical z, different c','fileName',KML_testdir('KMLcontour3_2zc.kml'),'zScaleFun',@(z) (z+1)*2000,'writeLabels',false,'labelInterval',10);
   KMLcontour3(lat+ 5,lon*10,z,z','description','indentical z, different c','fileName',KML_testdir('KMLcontour3_4zc.kml'),'zScaleFun',@(z) (z.^2)*10000,'writeLabels',false,'cLim',[200 300],'labelDecimals',4);

   KMLcontour3(lat   ,lon,   z',z,'description','indentical c, different z','fileName',KML_testdir('KMLcontour3_2cz.kml'),'zScaleFun',@(z) (z+1)*2000,'writeLabels',false,'labelInterval',10);
   KMLcontour3(lat+ 5,lon*10,z',z,'description','indentical c, different z','fileName',KML_testdir('KMLcontour3_4cz.kml'),'zScaleFun',@(z) (z.^2)*10000,'writeLabels',false,'cLim',[200 300],'labelDecimals',4);

testresult = true;
