ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/gr2lib/trunk/gr2lib_UnitTest/Program.cs
(Generate patch)

Comparing trunk/gr2lib_UnitTest/Program.cs (file contents):
Revision 49 by william, Thu Jul 15 04:37:58 2010 UTC vs.
Revision 50 by william, Thu Jul 15 07:39:22 2010 UTC

# Line 4 | Line 4 | using System.Text;
4  
5   using gr2lib.core;
6   using gr2lib.core.apiversion;
7 + using gr2lib.core.exceptions;
8  
9   namespace gr2lib_UnitTest
10   {
# Line 11 | Line 12 | namespace gr2lib_UnitTest
12      {
13          static void Main(string[] args)
14          {
15 <            // Setup access to check loaded Granny2 API Version
15 <            granny2apiversion apiversion = new granny2apiversion();
16 <
17 <            // Check if the Loaded API Version Matches
18 <            if (!apiversion.apiversionsmatch)
15 >            try
16              {
17 <                // the loaded version does not match
18 <                Console.WriteLine("Warning:\n" +
19 <                    "\t Loaded Granny2 DLL Version: " + apiversion.apiversion.version + "\n" +
20 <                    "\t Expected Version: " + apiversion.expectedapiversion.version);
21 <                // return from void to exit application
22 <                return;
17 >                // Setup access to check loaded Granny2 API Version
18 >                granny2apiversion apiversion = new granny2apiversion();
19 >
20 >                // Check if the Loaded API Version Matches
21 >                if (!apiversion.apiversionsmatch)
22 >                {
23 >                    // the loaded version does not match
24 >                    Console.WriteLine("Warning:\n" +
25 >                        "\t Loaded Granny2 DLL Version: " + apiversion.apiversion.version + "\n" +
26 >                        "\t Expected Version: " + apiversion.expectedapiversion.version);
27 >                    // return from void to exit application
28 >                    return;
29 >                }
30 >                else
31 >                {
32 >                    // the loaded version matches
33 >                    Console.WriteLine("Loaded granny2.dll: " + apiversion.apiversion.version);
34 >                }
35 >                // if we have arrived at this point, the loaded api version matches the what the library was built against
36              }
37 <            else
37 >            catch (granny2apiloadexception ex)
38              {
39 <                // the loaded version matches
30 <                Console.WriteLine("Loaded granny2.dll: " + apiversion.apiversion.version);
39 >                Console.WriteLine(ex.Message);
40              }
32            // if we have arrived at this point, the loaded api version matches the what the library was built against
41          }
42      }
43   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines