Compare commits

...
10 Commits
Author SHA1 Message Date
Wade Berrier e69a3c5078 version bump
svn path=/branches/mono-1-1-17/mono/; revision=66315
2006-10-05 20:19:01 +00:00
Wade Berrier 10eff7d79c Merge 65441 from HEAD:
svn merge -r 65440:65441 $MSVN/trunk/mcs .

       * TempFileCollection.cs: Create files in a temporary subdirectory,
       for security reasons.
       * CodeCompiler.cs: Let TempFileCollection choose the temp dir.


svn path=/branches/mono-1-1-17/mcs/; revision=66314
2006-10-05 20:18:07 +00:00
Gonzalo Paniagua Javier 94ea5afb28 from HEAD
svn path=/branches/mono-1-1-17/mono/; revision=65024
2006-09-06 18:55:23 +00:00
Miguel de Icaza 3f259856c6 Backport this fix
svn path=/branches/mono-1-1-17/mono/; revision=64641
2006-08-31 17:12:46 +00:00
Wade Berrier a23e065b1c Merge 64520 from trunk to 1.1.17 branch
* configure.in: Add required CFLAGS for s390[x] (-mbackchain)


svn path=/branches/mono-1-1-17/mono/; revision=64638
2006-08-31 17:03:17 +00:00
Wade Berrier 6c81eb310d Add file from trunk (r64593)
svn path=/branches/mono-1-1-17/mcs/; revision=64622
2006-08-31 15:27:56 +00:00
Wade Berrier 5d7a3cd0c2 configure.in: version bump
svn path=/branches/mono-1-1-17/mono/; revision=64620
2006-08-31 14:57:56 +00:00
Gonzalo Paniagua Javier 0c180c51ad 2006-08-30 Gonzalo Paniagua Javier <[email protected]>
* HttpConnection.cs: when the content length is available, keep it
	updated after synchronous read. Renamed 'available' to 'remaining_body'.
	* RequestStream.cs: when creating the stream, pass the remaining length
	starting from the offset in the buffer.


svn path=/branches/mono-1-1-17/mcs/; revision=64585
2006-08-31 00:05:22 +00:00
Miguel de Icaza 1de2da2173 Backport
svn path=/branches/mono-1-1-17/mcs/; revision=64579
2006-08-30 22:53:08 +00:00
Gonzalo Paniagua Javier 841e66160e from HEAD
svn path=/branches/mono-1-1-17/mcs/; revision=64569
2006-08-30 18:39:18 +00:00
209 changed files with 3800 additions and 16713 deletions

No files matched your search

-15
View File
@@ -1,18 +1,3 @@
2006-08-31 Zoltan Varga <[email protected]>
* libmono.vcproj: Add aot-compiler.c and aot-runtime.c as source files.
* README.vsnet: Fix a typo.
2006-08-31 Zoltan Varga <[email protected]>
* configure.in (PLATFORM_WIN32): Add -mno-cygwin to libmono_cflags/ldflags. Fixes
#79180.
2006-08-15 Miguel de Icaza <[email protected]>
* configure.in: Add support for an altenative version of glib.
2006-08-29 Wade Berrier <[email protected]>
* configure.in: Add required CFLAGS for s390[x] (-mbackchain)
+1 -1
View File
@@ -111,7 +111,7 @@ reporting those changes.
[7] Probably a lot more I didn't discover... or has changed since.
MORE INFORMATION
MORE INFORMATIONS
Please email <[email protected]> if you have any problem
and/or if there's something wrong/missing in the instructions.
+1 -3
View File
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono,1.1.17)
AM_INIT_AUTOMAKE(mono,1.1.17.2)
AM_MAINTAINER_MODE
AC_PROG_LN_S
@@ -67,8 +67,6 @@ case "$host" in
fi
HOST_CC="gcc"
CPPFLAGS="$CPPFLAGS -DWIN32_THREADS -DFD_SETSIZE=1024"
libmono_cflags="-mno-cygwin"
libmono_ldflags="-mno-cygwin"
libdl=
libgc_threads=win32
gc_default=included
File diff suppressed because it is too large. Load diff
-81
View File
@@ -1,84 +1,3 @@
2006-08-31 Gonzalo Paniagua Javier <[email protected]>
* test/file.c: remove useless test.
* test/spawn.c: new g_spawn_async_with_pipes test.
* src/glib.h: Modified file.
* src/gspawn.c: implemented g_spawn_async_with_pipes. Needs fine tuning.
2006-08-28 Gonzalo Paniagua Javier <[email protected]>
* TODO: Modified file.
* test/tests.h:
* test/pattern.c:
* test/dir.c:
* test/Makefile.am:
* src/Makefile.am:
* src/glib.h:
* src/gdir.c:
* src/gfile.c: implemented g_dir_*, unix version.
2006-08-27 Gonzalo Paniagua Javier <[email protected]>
* src/glib.h:
* test/Makefile.am: Modified file.
* test/tests.h:
* src/Makefile.am: Modified file.
* test/pattern.c:
* src/gpattern.c: implemented the 3 pattern matching functions used.
* test/ptrarray.c: fix the compare function to work with qsort.
* test/file.c:
* test/path.c:
* src/gspawn.c:
* src/gpath.c: made valgrind happy.
2006-08-26 Gonzalo Paniagua Javier <[email protected]>
* test/file.c:
* src/glib.h:
* src/gfile.c: implemented g_file_test. Changed the default mask to
.XXXXXX. Add tests.
2006-08-26 Raja R Harinath <[email protected]>
* src/sort.frag.h (digit): Declare here based on externally
provided typedef 'list_node'.
(MAX_DIGITS): Use 'sizeof (list_node)'.
* src/gslist.c (list_node): Declare instead of 'digit'.
* src/glist.c: Likewise.
* test/slist.c (verify_sort): Verify the length of the list too.
(test_slist_sort): Free the correct list.
* test/list.c: Likewise.
* src/sort.frag.h (MAX_DIGITS): Rename from N_DIGITS.
(combine_sort): Change 'max_pos' argument to more natural
'n_digits'.
(increment): Likewise. Use 'n_digits' to avoid reading at an
offset that hasn't been initialized.
(do_sort): Remove memset.
2006-08-25 Gonzalo Paniagua Javier <[email protected]>
* TODO:
* test/file.c:
* src/glib.h:
* src/gfile.c: implement g_file_open_tmp.
2006-08-25 Gonzalo Paniagua Javier <[email protected]>
* TODO:
* src/glib.h:
* src/gdate.c: New file.
* src/gfile.c: New file.
* src/Makefile.am: implemented g_file_get_contents and
g_get_current_time.
* test/tests.h:
* test/file.c: New file.
* test/Makefile.am: tests for the above.
2006-08-26 Raja R Harinath <[email protected]>
* src/sort.frag.h: Add copyright notice and some explanation.
+23 -4
View File
@@ -3,9 +3,13 @@
Directory, File manipulation:
g_dir_open, g_dir_close, g_dir_read_name
g_dir_open, g_dir_close, g_dir_read_name,
G_FILE_ERROR_*
We're missing a native windows implementation. The unix one is in place.
These will be replaced in io-layer with direct Unix calls.
These will be replaced in metadata with two code paths, native
Unix and native Windows.
Locking:
@@ -17,6 +21,11 @@
Important Groups:
* Pattern Matching
2 g_pattern_spec_new
2 g_pattern_spec_free
2 g_pattern_match_string
* Markup, used to load config files.
2 g_markup_parse_context_parse
2 g_markup_parse_context_new
@@ -24,6 +33,7 @@ Important Groups:
2 g_markup_parse_context_end_parse
* Process launching
1 g_spawn_async_with_pipes
3 g_shell_quote
1 g_shell_unquote
@@ -36,6 +46,7 @@ Important Groups:
2 g_filename_from_uri
* Information retrieval
2 g_get_current_time
1 g_get_charset
1 g_win32_getlocale
@@ -48,23 +59,31 @@ Important Groups:
1 g_strescape
* Character encoding
24 g_utf16_to_utf8 -> soon to be done
20 g_utf8_to_utf16 -> soon to be done
24 g_utf16_to_utf8
20 g_utf8_to_utf16
3 g_utf8_validate
3 g_locale_to_utf8
3 g_convert
1 g_locale_from_utf8
* File
5 g_file_get_contents
11 g_file_test
3 g_file_open_tmp
* Miscelaneous
5 g_newa
3 g_spaced_primes_closest
2 g_set_prgname
2 g_printerr
1 g_mem_set_vtable
1 g_log_set_handler
Macros:
7 G_FILE_TEST_IS_DIR
6 G_UNLIKELY
4 G_LIKELY
4 G_FILE_TEST_IS_REGULAR
2 G_USEC_PER_SEC
2 G_STRLOC
1 G_SPAWN_SEARCH_PATH
+1 -5
View File
@@ -20,11 +20,7 @@ libeglib_la_SOURCES = \
gpath.c \
gshell.c \
gspawn.c \
gtimer.c \
gdate.c \
gfile.c \
gpattern.c \
gdir.c
gtimer.c
libeglib_la_CFLAGS = -Wall -Werror -D_FORTIFY_SOURCE=2
-42
View File
@@ -1,42 +0,0 @@
/*
* Date and time utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected]
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <glib.h>
#include <sys/time.h>
void
g_get_current_time (GTimeVal *result)
{
struct timeval tv;
g_return_if_fail (result != NULL);
gettimeofday (&tv, NULL);
result->tv_sec = tv.tv_sec;
result->tv_usec = tv.tv_usec;
}
-108
View File
@@ -1,108 +0,0 @@
/*
* Directory utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
struct _GDir {
#ifdef G_OS_WIN32
#else
DIR *dir;
#endif
};
GDir *
g_dir_open (const gchar *path, guint flags, GError **error)
{
#ifdef G_OS_WIN32
return NULL;
#else
GDir *dir;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
(void) flags; /* this is not used */
dir = g_new (GDir, 1);
dir->dir = opendir (path);
if (dir->dir == NULL) {
if (error) {
gint err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), strerror (err));
}
g_free (dir);
return NULL;
}
return dir;
#endif
}
const gchar *
g_dir_read_name (GDir *dir)
{
#ifdef G_OS_WIN32
return NULL;
#else
struct dirent *entry;
g_return_val_if_fail (dir != NULL && dir->dir != NULL, NULL);
entry = readdir (dir->dir);
if (entry == NULL)
return NULL;
return entry->d_name;
#endif
}
void
g_dir_rewind (GDir *dir)
{
#ifdef G_OS_WIN32
#else
g_return_if_fail (dir != NULL && dir->dir != NULL);
rewinddir (dir->dir);
#endif
}
void
g_dir_close (GDir *dir)
{
#ifdef G_OS_WIN32
#else
g_return_if_fail (dir != NULL && dir->dir != NULL);
closedir (dir->dir);
dir->dir = NULL;
g_free (dir);
#endif
}
-245
View File
@@ -1,245 +0,0 @@
/*
* File utility functions.
*
* Author:
* Gonzalo Paniagua Javier ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
GFileError
g_file_error_from_errno (gint err_no)
{
switch (err_no) {
case EEXIST:
return G_FILE_ERROR_EXIST;
case EISDIR:
return G_FILE_ERROR_ISDIR;
case EACCES:
return G_FILE_ERROR_ACCES;
case ENAMETOOLONG:
return G_FILE_ERROR_NAMETOOLONG;
case ENOENT:
return G_FILE_ERROR_NOENT;
case ENOTDIR:
return G_FILE_ERROR_NOTDIR;
case ENXIO:
return G_FILE_ERROR_NXIO;
case ENODEV:
return G_FILE_ERROR_NODEV;
case EROFS:
return G_FILE_ERROR_ROFS;
#ifdef ETXTBSY
case ETXTBSY:
return G_FILE_ERROR_TXTBSY;
#endif
case EFAULT:
return G_FILE_ERROR_FAULT;
#ifdef ELOOP
case ELOOP:
return G_FILE_ERROR_LOOP;
#endif
case ENOSPC:
return G_FILE_ERROR_NOSPC;
case ENOMEM:
return G_FILE_ERROR_NOMEM;
case EMFILE:
return G_FILE_ERROR_MFILE;
case ENFILE:
return G_FILE_ERROR_NFILE;
case EBADF:
return G_FILE_ERROR_BADF;
case EINVAL:
return G_FILE_ERROR_INVAL;
case EPIPE:
return G_FILE_ERROR_PIPE;
case EAGAIN:
return G_FILE_ERROR_AGAIN;
case EINTR:
return G_FILE_ERROR_INTR;
case EIO:
return G_FILE_ERROR_IO;
case EPERM:
return G_FILE_ERROR_PERM;
case ENOSYS:
return G_FILE_ERROR_NOSYS;
default:
return G_FILE_ERROR_FAILED;
}
}
#ifndef O_LARGEFILE
#define OPEN_FLAGS (O_RDONLY)
#else
#define OPEN_FLAGS (O_RDONLY | O_LARGEFILE)
#endif
gboolean
g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error)
{
gchar *str;
int fd;
struct stat st;
long offset;
int nread;
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (contents != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
*contents = NULL;
if (length)
*length = 0;
fd = open (filename, OPEN_FLAGS);
if (fd == -1) {
if (error != NULL) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error opening file");
}
return FALSE;
}
if (fstat (fd, &st) != 0) {
if (error != NULL) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in fstat()");
}
close (fd);
return FALSE;
}
str = g_malloc (st.st_size + 1);
offset = 0;
do {
nread = read (fd, str + offset, st.st_size - offset);
if (nread > 0) {
offset += nread;
}
} while ((nread > 0 && offset < st.st_size) || (nread == -1 && errno == EINTR));
close (fd);
str [st.st_size] = '\0';
if (length) {
*length = st.st_size;
}
*contents = str;
return TRUE;
}
gint
g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
{
const static gchar *default_tmpl = ".XXXXXX";
gchar *t;
gint fd;
gint len;
g_return_val_if_fail (error == NULL || *error == NULL, -1);
if (tmpl == NULL)
tmpl = default_tmpl;
if (strchr (tmpl, G_DIR_SEPARATOR) != NULL) {
if (error) {
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should not have any " G_DIR_SEPARATOR_S);
}
return -1;
}
len = strlen (tmpl);
if (len < 6 || strcmp (tmpl + len - 6, "XXXXXX")) {
if (error) {
*error = g_error_new (G_LOG_DOMAIN, 24, "Template should end with XXXXXX");
}
return -1;
}
t = g_build_filename (g_get_tmp_dir (), tmpl, NULL);
fd = mkstemp (t);
if (fd == -1) {
if (error) {
int err = errno;
*error = g_error_new (G_LOG_DOMAIN, g_file_error_from_errno (err), "Error in mkstemp()");
}
g_free (t);
return -1;
}
if (name_used) {
*name_used = t;
} else {
g_free (t);
}
return fd;
}
gboolean
g_file_test (const gchar *filename, GFileTest test)
{
struct stat st;
gboolean have_stat;
if (filename == NULL || test == 0)
return FALSE;
have_stat = FALSE;
#ifdef G_OS_WIN32
#else
if ((test & G_FILE_TEST_EXISTS) != 0) {
if (access (filename, F_OK) == 0)
return TRUE;
}
if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) {
if (access (filename, X_OK) == 0)
return TRUE;
}
if ((test & G_FILE_TEST_IS_SYMLINK) != 0) {
have_stat = (lstat (filename, &st) == 0);
if (have_stat && S_ISLNK (st.st_mode))
return TRUE;
}
#endif
if ((test & G_FILE_TEST_IS_REGULAR) != 0) {
if (!have_stat)
have_stat = (stat (filename, &st) == 0);
if (have_stat && S_ISREG (st.st_mode))
return TRUE;
}
if ((test & G_FILE_TEST_IS_DIR) != 0) {
if (!have_stat)
have_stat = (stat (filename, &st) == 0);
if (have_stat && S_ISDIR (st.st_mode))
return TRUE;
}
return FALSE;
}
+2 -140
View File
@@ -87,8 +87,8 @@ void g_unsetenv(const gchar *variable);
/*
* Precondition macros
*/
#define g_return_if_fail(x) G_STMT_START { if (!(x)) { printf ("%s:%d: assertion '%s' failed", __FILE__, __LINE__, #x); return; } } G_STMT_END
#define g_return_val_if_fail(x,e) G_STMT_START { if (!(x)) { printf ("%s:%d: assertion '%s' failed", __FILE__, __LINE__, #x); return (e); } } G_STMT_END
#define g_return_if_fail(x) G_STMT_START { if (!(x)) { printf ("%s:%d: assertion %s failed", __FILE__, __LINE__, #x); return; } } G_STMT_END
#define g_return_val_if_fail(x,e) G_STMT_START { if (!(x)) { printf ("%s:%d: assertion %s failed", __FILE__, __LINE__, #x); return (e); } } G_STMT_END
/*
* Hashtables
@@ -442,7 +442,6 @@ gchar *g_path_get_dirname (const gchar *filename);
gchar *g_path_get_basename (const char *filename);
gchar *g_find_program_in_path (const gchar *program);
gchar *g_get_current_dir (void);
gboolean g_path_is_absolute (const char *filename);
const gchar *g_get_home_dir (void);
const gchar *g_get_tmp_dir (void);
@@ -457,23 +456,8 @@ gboolean g_shell_parse_argv (const gchar *command_line, gint *argcp, gchar ***ar
/*
* Spawn
*/
typedef enum {
G_SPAWN_LEAVE_DESCRIPTORS_OPEN = 1,
G_SPAWN_DO_NOT_REAP_CHILD = 1 << 1,
G_SPAWN_SEARCH_PATH = 1 << 2,
G_SPAWN_STDOUT_TO_DEV_NULL = 1 << 3,
G_SPAWN_STDERR_TO_DEV_NULL = 1 << 4,
G_SPAWN_CHILD_INHERITS_STDIN = 1 << 5,
G_SPAWN_FILE_AND_ARGV_ZERO = 1 << 6
} GSpawnFlags;
typedef pid_t GPid;
typedef void (*GSpawnChildSetupFunc) (gpointer user_data);
gboolean g_spawn_command_line_sync (const gchar *command_line, gchar **standard_output, gchar **standard_error, gint *exit_status, GError **error);
gboolean g_spawn_async_with_pipes (const gchar *working_directory, gchar **argv, gchar **envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup,
gpointer user_data, GPid *child_pid, gint *standard_input, gint *standard_output, gint *standard_error, GError **error);
/*
@@ -487,127 +471,5 @@ gdouble g_timer_elapsed (GTimer *timer, gulong *microseconds);
void g_timer_stop (GTimer *timer);
void g_timer_start (GTimer *timer);
/*
* Date and time
*/
typedef struct {
glong tv_sec;
glong tv_usec;
} GTimeVal;
void g_get_current_time (GTimeVal *result);
/*
* File
*/
typedef enum {
G_FILE_ERROR_EXIST,
G_FILE_ERROR_ISDIR,
G_FILE_ERROR_ACCES,
G_FILE_ERROR_NAMETOOLONG,
G_FILE_ERROR_NOENT,
G_FILE_ERROR_NOTDIR,
G_FILE_ERROR_NXIO,
G_FILE_ERROR_NODEV,
G_FILE_ERROR_ROFS,
G_FILE_ERROR_TXTBSY,
G_FILE_ERROR_FAULT,
G_FILE_ERROR_LOOP,
G_FILE_ERROR_NOSPC,
G_FILE_ERROR_NOMEM,
G_FILE_ERROR_MFILE,
G_FILE_ERROR_NFILE,
G_FILE_ERROR_BADF,
G_FILE_ERROR_INVAL,
G_FILE_ERROR_PIPE,
G_FILE_ERROR_AGAIN,
G_FILE_ERROR_INTR,
G_FILE_ERROR_IO,
G_FILE_ERROR_PERM,
G_FILE_ERROR_NOSYS,
G_FILE_ERROR_FAILED
} GFileError;
typedef enum {
G_FILE_TEST_IS_REGULAR = 1 << 0,
G_FILE_TEST_IS_SYMLINK = 1 << 1,
G_FILE_TEST_IS_DIR = 1 << 2,
G_FILE_TEST_IS_EXECUTABLE = 1 << 3,
G_FILE_TEST_EXISTS = 1 << 4
} GFileTest;
gboolean g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error);
GFileError g_file_error_from_errno (gint err_no);
gint g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error);
gboolean g_file_test (const gchar *filename, GFileTest test);
/*
* Pattern matching
*/
typedef struct _GPatternSpec GPatternSpec;
GPatternSpec * g_pattern_spec_new (const gchar *pattern);
void g_pattern_spec_free (GPatternSpec *pspec);
gboolean g_pattern_match_string (GPatternSpec *pspec, const gchar *string);
/*
* Directory
*/
typedef struct _GDir GDir;
GDir *g_dir_open (const gchar *path, guint flags, GError **error);
const gchar *g_dir_read_name (GDir *dir);
void g_dir_rewind (GDir *dir);
void g_dir_close (GDir *dir);
/*
* GMarkup
*/
typedef struct _GMarkupParseContext GMarkupParseContext;
typedef enum
{
G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0,
G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1
} GMarkupParseFlags;
typedef struct {
void (*start_element) (GMarkupParseContext *context,
const gchar *element_name,
const gchar **attribute_names,
const gchar **attribute_values,
gpointer user_data,
GError **error);
void (*end_element) (GMarkupParseContext *context,
const gchar *element_name,
gpointer user_data,
GError **error);
void (*text) (GMarkupParseContext *context,
const gchar *text,
gsize text_len,
gpointer user_data,
GError **error);
void (*passthrough) (GMarkupParseContext *context,
const gchar *passthrough_text,
gsize text_len,
gpointer user_data,
GError **error);
void (*error) (GMarkupParseContext *context,
GError *error,
gpointer user_data);
} GMarkupParser;
GMarkupParseContext *g_markup_parse_context_new (const GMarkupParser *parser,
GMarkupParseFlags flags,
gpointer user_data,
GDestroyNotify user_data_dnotify);
void g_markup_parse_context_free (GMarkupParseContext *context);
gboolean g_markup_parse_context_parse (GMarkupParseContext *context,
const gchar *text, gssize text_len,
GError **error);
#endif
+1 -1
View File
@@ -289,7 +289,7 @@ g_list_copy (GList *list)
return copy;
}
typedef GList list_node;
typedef GList *digit;
#include "sort.frag.h"
GList*
-125
View File
@@ -1,125 +0,0 @@
/*
* gmakrup.c: Minimal XML markup reader.
*
* Unlike the GLib one, this can not be restarted with more text
* as the Mono use does not require it
*
* Author:
* Miguel de Icaza ([email protected])
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <glib.h>
#define set_error(msg...) do { if (error != NULL) *error = g_error_new (1, 1, msg); } while (0);
typedef enum {
START,
} ParseState;
struct _GMarkupParseContext {
GMarkupParser parser;
gpointer user_data;
GDestroyNotify user_data_dnotify;
ParseState state;
};
GMarkupParseContext *
g_markup_parse_context_new (const GMarkupParser *parser,
GMarkupParseFlags flags,
gpointer user_data,
GDestroyNotify user_data_dnotify)
{
GMarkupParseContext *context = g_new0 (GMarkupParseContext, 1);
context->parser = *parser;
context->user_data = user_data;
context->user_data_dnotify = user_data_dnotify;
return context;
}
void
g_markup_parse_context_free (GMarkupParseContext *context)
{
g_free (context);
}
gboolean
g_markup_parse_context_parse (GMarkupParseContext *context,
const gchar *text, gssize text_len, GError **error)
{
char *p, *end;
g_return_val_if_fail (context != NULL, FALSE);
g_return_val_if_fail (text != NULL, FALSE);
g_return_val_if_fail (text_len >= 0, FALSE);
end = text + text_len;
for (p = text; p < end; p++){
char c = *p;
switch (context->state){
case START:
if (c == ' ' || c == '\t' || c == '\f' || c == '\n')
continue;
if (c == '<'){
context->state = START_ELEMENT;
continue;
}
set_error ("Expected < to start the document");
return FALSE;
case START_ELEMENT: {
char *element_start = p;
char **names, *values;
if (!(isascii (*p) && isalpha (*p)))
set_error ("Must start with a letter");
for (++p; p < end && isalnum (*p); p++)
;
if (p == end){
set_error ("Expected an element");
return FALSE;
}
for (; p < end && isspace (*p); p++)
;
if (p == end){
set_error ("Unfinished element");
return FALSE;
}
p = parse_attributes (p, end, &names, &values);
if (p == end){
set_error ("unfinished element");
return FALSE;
}
}
}
}
}
+4 -7
View File
@@ -136,14 +136,12 @@ g_find_program_in_path (const gchar *program)
{
char *p = g_strdup (getenv ("PATH"));
char *x = p, *l;
gchar *curdir = NULL;
char *save;
g_return_val_if_fail (program != NULL, NULL);
if (x == NULL || *x == '\0') {
curdir = g_get_current_dir ();
x = curdir;
x = g_get_current_dir ();
}
while ((l = strtok_r (x, G_SEARCHPATH_SEPARATOR_S, &save)) != NULL){
@@ -152,13 +150,11 @@ g_find_program_in_path (const gchar *program)
x = NULL;
probe_path = g_build_path (G_DIR_SEPARATOR_S, l, program, NULL);
if (access (probe_path, X_OK) == 0){
g_free (curdir);
g_free (p);
return probe_path;
}
g_free (probe_path);
}
g_free (curdir);
g_free (p);
return NULL;
}
@@ -190,6 +186,7 @@ const gchar *
g_get_home_dir (void)
{
if (home_dir == NULL){
struct passwd *p;
uid_t uid;
pthread_mutex_lock (&home_lock);
@@ -202,8 +199,8 @@ g_get_home_dir (void)
setpwent ();
while (getpwent_r (&pwbuf, buf, sizeof (buf), &track) == 0){
if (pwbuf.pw_uid == uid){
home_dir = g_strdup (pwbuf.pw_dir);
if (p->pw_uid == uid){
home_dir = g_strdup (p->pw_dir);
break;
}
}
-209
View File
@@ -1,209 +0,0 @@
/*
* Simple pattern matching
*
* Author:
* Gonzalo Paniagua Javier ([email protected]
*
* (C) 2006 Novell, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
typedef enum {
MATCH_LITERAL,
MATCH_ANYCHAR,
MATCH_ANYTHING,
MATCH_ANYTHING_END
} MatchType;
typedef struct {
MatchType type;
gchar *str;
} PData;
struct _GPatternSpec {
GSList *pattern;
};
static GSList *
compile_pattern (const gchar *pattern)
{
GSList *list;
gint i, len;
PData *data;
gchar c;
MatchType last = -1;
GString *str;
gboolean free_str;
if (pattern == NULL)
return NULL;
data = NULL;
list = NULL;
free_str = TRUE;
str = g_string_new ("");
for (i = 0, len = strlen (pattern); i < len; i++) {
c = pattern [i];
if (c == '*' || c == '?') {
if (str->len > 0) {
data = g_new0 (PData, 1);
data->type = MATCH_LITERAL;
data->str = g_string_free (str, FALSE);
list = g_slist_append (list, data);
str = g_string_new ("");
}
if (last == MATCH_ANYTHING && c == '*')
continue;
data = g_new0 (PData, 1);
data->type = (c == '*') ? MATCH_ANYTHING : MATCH_ANYCHAR;
list = g_slist_append (list, data);
last = data->type;
} else {
g_string_append_c (str, c);
last = MATCH_LITERAL;
}
}
if (last == MATCH_ANYTHING && str->len == 0) {
data->type = MATCH_ANYTHING_END;
free_str = TRUE;
} else if (str->len > 0) {
data = g_new0 (PData, 1);
data->type = MATCH_LITERAL;
data->str = str->str;
free_str = FALSE;
list = g_slist_append (list, data);
}
g_string_free (str, free_str);
return list;
}
#ifdef DEBUG_PATTERN
static void
print_pattern (gpointer data, gpointer user_data)
{
PData *d = (PData *) data;
printf ("Type: %s", d->type == MATCH_LITERAL ? "literal" : d->type == MATCH_ANYCHAR ? "any char" : "anything");
if (d->type == MATCH_LITERAL)
printf (" String: %s", d->str);
printf ("\n");
}
#endif
GPatternSpec *
g_pattern_spec_new (const gchar *pattern)
{
GPatternSpec *spec;
g_return_val_if_fail (pattern != NULL, NULL);
spec = g_new0 (GPatternSpec, 1);
if (pattern) {
spec->pattern = compile_pattern (pattern);
#ifdef DEBUG_PATTERN
g_slist_foreach (spec->pattern, print_pattern, NULL);
printf ("\n");
#endif
}
return spec;
}
static void
free_pdata (gpointer data, gpointer user_data)
{
PData *d = (PData *) data;
if (d->str)
g_free (d->str);
g_free (d);
}
void
g_pattern_spec_free (GPatternSpec *pspec)
{
if (pspec) {
g_slist_foreach (pspec->pattern, free_pdata, NULL);
g_slist_free (pspec->pattern);
pspec->pattern = NULL;
}
g_free (pspec);
}
static gboolean
match_string (GSList *list, const gchar *str, gint idx, gint max)
{
gint len;
while (list && idx < max) {
PData *data = (PData *) list->data;
if (data->type == MATCH_ANYTHING_END)
return TRUE;
if (data->type == MATCH_LITERAL) {
len = strlen (data->str);
if (strncmp (&str [idx], data->str, len) != 0)
return FALSE;
idx += len;
list = list->next;
if (list) {
/*
* When recursing, we need this to avoid returning FALSE
* because 'list' will not be NULL
*/
data = (PData *) list->data;
if (data->type == MATCH_ANYTHING_END)
return TRUE;
}
} else if (data->type == MATCH_ANYCHAR) {
idx++;
list = list->next;
} else if (data->type == MATCH_ANYTHING) {
while (idx < max) {
if (match_string (list->next, str, idx++, max))
return TRUE;
}
return FALSE;
} else {
g_assert_not_reached ();
}
}
return (list == NULL && idx >= max);
}
gboolean
g_pattern_match_string (GPatternSpec *pspec, const gchar *string)
{
g_return_val_if_fail (pspec != NULL, FALSE);
g_return_val_if_fail (string != NULL, FALSE);
if (pspec->pattern == NULL)
return FALSE;
return match_string (pspec->pattern, string, 0, strlen (string));
}
+2 -2
View File
@@ -300,7 +300,7 @@ g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func)
return list;
}
typedef GSList list_node;
typedef GSList *digit;
#include "sort.frag.h"
GSList*
@@ -308,5 +308,5 @@ g_slist_sort (GSList *list, GCompareFunc func)
{
if (!list || !list->next)
return list;
return do_sort (list, func);
return do_sort (list, func);
}
+25 -222
View File
@@ -31,16 +31,11 @@
#include <errno.h>
#include <unistd.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <glib.h>
#define set_error(msg...) do { if (error != NULL) *error = g_error_new (G_LOG_DOMAIN, 1, msg); } while (0);
#define set_error_cond(cond,msg...) do { if ((cond) && error != NULL) *error = g_error_new (G_LOG_DOMAIN, 1, msg); } while (0);
#define set_error_status(status,msg...) do { if (error != NULL) *error = g_error_new (G_LOG_DOMAIN, status, msg); } while (0);
static int
safe_read (int fd, gchar *buffer, gint count, GError **error)
{
@@ -50,7 +45,9 @@ safe_read (int fd, gchar *buffer, gint count, GError **error)
res = read (fd, buffer, count);
} while (res == -1 && errno == EINTR);
set_error_cond (res == -1, "Error reading from pipe.");
if (res == -1 && error) {
*error = g_error_new (G_LOG_DOMAIN, errno, "Error reading from pipe.");
}
return res;
}
@@ -132,16 +129,6 @@ read_pipes (int outfd, gchar **out_str, int errfd, gchar **err_str, GError **err
return 0;
}
static gboolean
create_pipe (int *fds, GError **error)
{
if (pipe (fds) == -1) {
set_error ("Error creating pipe.");
return FALSE;
}
return TRUE;
}
gboolean
g_spawn_command_line_sync (const gchar *command_line,
gchar **standard_output,
@@ -152,23 +139,35 @@ g_spawn_command_line_sync (const gchar *command_line,
pid_t pid;
gchar **argv;
gint argc;
int stdout_pipe [2] = { -1, -1 };
int stderr_pipe [2] = { -1, -1 };
int stdout_pipe [2];
int stderr_pipe [2];
int status;
int res;
if (!g_shell_parse_argv (command_line, &argc, &argv, error))
return FALSE;
if (standard_output && !create_pipe (stdout_pipe, error))
return FALSE;
if (standard_error && !create_pipe (stderr_pipe, error)) {
if (standard_output) {
close (stdout_pipe [1]);
close (stdout_pipe [0]);
stdout_pipe [0] = -1;
stdout_pipe [1] = -1;
stderr_pipe [0] = -1;
stderr_pipe [1] = -1;
if (standard_output) {
if (pipe (stdout_pipe) == -1) {
if (error)
*error = g_error_new (G_LOG_DOMAIN, errno, "Error creating out pipe.");
return FALSE;
}
}
if (standard_error) {
if (pipe (stderr_pipe) == -1) {
if (standard_output) {
close (stdout_pipe [1]);
close (stdout_pipe [0]);
}
if (error)
*error = g_error_new (G_LOG_DOMAIN, errno, "Error creating out pipe.");
return FALSE;
}
return FALSE;
}
pid = fork ();
@@ -191,7 +190,6 @@ g_spawn_command_line_sync (const gchar *command_line,
exit (1); /* TODO: What now? */
}
g_strfreev (argv);
if (standard_output)
close (stdout_pipe [1]);
@@ -218,198 +216,3 @@ g_spawn_command_line_sync (const gchar *command_line,
return TRUE;
}
/*
* This is the only use we have in mono/metadata
!g_spawn_async_with_pipes (NULL, (char**)addr_argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &child_pid, &ch_in, &ch_out, NULL, NULL)
*/
gboolean
g_spawn_async_with_pipes (const gchar *working_directory,
gchar **argv,
gchar **envp,
GSpawnFlags flags,
GSpawnChildSetupFunc child_setup,
gpointer user_data,
GPid *child_pid,
gint *standard_input,
gint *standard_output,
gint *standard_error,
GError **error)
{
pid_t pid;
int info_pipe [2];
int in_pipe [2] = { -1, -1 };
int out_pipe [2] = { -1, -1 };
int err_pipe [2] = { -1, -1 };
int status;
g_return_val_if_fail (argv != NULL, FALSE); /* Only mandatory arg */
if (!create_pipe (info_pipe, error))
return FALSE;
if (standard_output && !create_pipe (out_pipe, error)) {
close (info_pipe [0]);
close (info_pipe [1]);
return FALSE;
}
if (standard_error && !create_pipe (err_pipe, error)) {
close (out_pipe [0]);
close (out_pipe [1]);
close (info_pipe [0]);
close (info_pipe [1]);
return FALSE;
}
if (standard_input && !create_pipe (in_pipe, error)) {
close (err_pipe [0]);
close (err_pipe [1]);
close (out_pipe [0]);
close (out_pipe [1]);
close (info_pipe [0]);
close (info_pipe [1]);
return FALSE;
}
pid = fork ();
if (pid == -1) {
close (info_pipe [0]);
close (info_pipe [1]);
close (err_pipe [0]);
close (err_pipe [1]);
close (out_pipe [0]);
close (out_pipe [1]);
close (in_pipe [0]);
close (in_pipe [1]);
set_error ("Error in fork ()");
return FALSE;
}
if (pid == 0) {
/* No zombie left behind */
if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0) {
pid = fork ();
}
if (pid != 0) {
exit (pid == -1 ? 1 : 0);
} else {
gint i;
int fd;
gchar *arg0;
gchar **actual_args;
close (info_pipe [1]);
close (in_pipe [1]);
close (out_pipe [0]);
close (err_pipe [0]);
/* when exec* succeeds, we want to close this fd, which will return
* a 0 read on the parent. We're not supposed to keep it open forever.
* If exec fails, we still can write the error to it before closing.
*/
fcntl (info_pipe [1], F_SETFD, FD_CLOEXEC);
if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0)
write (info_pipe [1], &pid, sizeof (pid_t));
if (working_directory && chdir (working_directory) == -1) {
int err = errno;
write (info_pipe [1], &err, sizeof (int));
exit (0);
}
if (standard_output) {
dup2 (*standard_output, STDOUT_FILENO);
} else if ((flags & G_SPAWN_STDOUT_TO_DEV_NULL) != 0) {
fd = open ("/dev/null", O_WRONLY);
dup2 (fd, STDOUT_FILENO);
}
if (standard_error) {
dup2 (*standard_error, STDERR_FILENO);
} else if ((flags & G_SPAWN_STDERR_TO_DEV_NULL) != 0) {
fd = open ("/dev/null", O_WRONLY);
dup2 (fd, STDERR_FILENO);
}
if (standard_input) {
dup2 (*standard_input, STDERR_FILENO);
} else if ((flags & G_SPAWN_CHILD_INHERITS_STDIN) == 0) {
fd = open ("/dev/null", O_RDONLY);
dup2 (fd, STDERR_FILENO);
}
if ((flags & G_SPAWN_LEAVE_DESCRIPTORS_OPEN) != 0) {
for (i = getdtablesize () - 1; i >= 3; i--)
close (i);
}
actual_args = ((flags & G_SPAWN_FILE_AND_ARGV_ZERO) == 0) ? argv : argv + 1;
if (envp == NULL)
envp = environ;
if (child_setup)
child_setup (user_data);
arg0 = argv [0];
if (!g_path_is_absolute (arg0) || (flags & G_SPAWN_SEARCH_PATH) != 0) {
arg0 = g_find_program_in_path (argv [0]);
if (arg0 == NULL) {
int err = ENOENT;
write (info_pipe [1], &err, sizeof (int));
exit (0);
}
}
execve (arg0, actual_args, envp);
write (info_pipe [1], &errno, sizeof (int));
exit (0);
}
} else if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0) {
/* Wait for the first child if two are created */
waitpid (pid, &status, 0);
if (status == 1) {
close (info_pipe [0]);
close (info_pipe [1]);
close (err_pipe [0]);
close (err_pipe [1]);
close (out_pipe [0]);
close (out_pipe [1]);
close (in_pipe [0]);
close (in_pipe [1]);
set_error ("Error in fork (): %d", status);
return FALSE;
}
}
close (info_pipe [1]);
close (in_pipe [1]);
close (out_pipe [0]);
close (err_pipe [0]);
if ((flags & G_SPAWN_DO_NOT_REAP_CHILD) == 0)
read (info_pipe [0], &pid, sizeof (pid_t)); /* if we read < sizeof (pid_t)... */
if (child_pid) {
*child_pid = pid;
}
if (read (info_pipe [0], &status, sizeof (int)) != 0) {
close (info_pipe [0]);
close (in_pipe [0]);
close (out_pipe [1]);
close (err_pipe [1]);
set_error_status (status, "Error in exec (%d)", status);
return FALSE;
}
close (info_pipe [0]);
if (standard_input)
*standard_input = in_pipe [1];
if (standard_output)
*standard_output = out_pipe [0];
if (standard_error)
*standard_error = err_pipe [0];
return TRUE;
}
+16 -20
View File
@@ -27,7 +27,7 @@
*/
/*
* This code requires a typedef named 'list_node' for the list node. It
* This code requires a typedef named 'digit' for the list type. It
* is assumed that the list type is the type of a pointer to a list
* node, and that the node has a field named 'next' that implements to
* the linked list. No additional invariant is maintained (e.g. the
@@ -39,18 +39,16 @@
* maintaining the invariants of the core data structure parallels the
* code for incrementing the binary representation of a number.
*/
typedef list_node *digit;
/*
* The maximum possible depth of the merge tree
* = ceiling (log2 (maximum number of list nodes))
* = ceiling (log2 (maximum possible memory size/size of each list node))
* = number of bits in 'size_t' - floor (log2 (sizeof digit))
* Also, each "digit" is at least 2 nodes long: we can reduce the depth by 1
*/
#define FLOOR_LOG2(x) (((x)>=2) + ((x)>=4) + ((x)>=8) + ((x)>=16) + ((x)>=32) + ((x)>=64) + ((x)>=128))
#define MAX_DIGITS ((sizeof (size_t) * 8) - FLOOR_LOG2(sizeof (list_node)) - 1)
#define N_DIGITS ((sizeof (size_t) * 8) - FLOOR_LOG2(sizeof (digit)))
static inline digit
add_digits (digit first, digit second, GCompareFunc func)
@@ -73,10 +71,10 @@ add_digits (digit first, digit second, GCompareFunc func)
}
static inline digit
combine_digits (digit *digits, digit list, int n_digits, GCompareFunc func)
combine_digits (digit *digits, digit list, int max_pos, GCompareFunc func)
{
int i;
for (i = 0; i < n_digits; ++i)
for (i = 0; i <= max_pos; ++i)
list = add_digits (digits [i], list, func);
return list;
}
@@ -86,20 +84,17 @@ combine_digits (digit *digits, digit list, int n_digits, GCompareFunc func)
* Invariant: digit[i] == NULL || length(digit[i]) == k * 2**i
*/
static inline int
increment (digit *digits, digit list, int n_digits, GCompareFunc func)
increment (digit *digits, digit list, int max_pos, GCompareFunc func)
{
int i;
for (i = 0; i < n_digits && digits [i]; i++) {
for (i = 0; digits [i]; i++) {
list = add_digits (digits [i], list, func);
digits [i] = NULL;
if (i == N_DIGITS-1) /* Will _never_ happen: so we can just devolve into quadratic ;-) */
break;
}
if (i == MAX_DIGITS) /* Will _never_ happen: so we can just devolve into quadratic ;-) */
--i;
if (i == n_digits)
++n_digits;
digits [i] = list;
return n_digits;
return i > max_pos ? i : max_pos;
}
/*
@@ -111,8 +106,9 @@ increment (digit *digits, digit list, int n_digits, GCompareFunc func)
static inline digit
do_sort (digit list, GCompareFunc func)
{
int n_digits = 0;
digit digits [MAX_DIGITS]; /* ~ 128 bytes on 32bit, ~ 512 bytes on 64bit */
int max_pos = 0;
digit digits [N_DIGITS]; /* ~ 128 bytes on 32bit, ~ 512 bytes on 64bit */
memset (digits, 0, sizeof digits);
while (list && list->next) {
digit next = list->next;
@@ -125,13 +121,13 @@ do_sort (digit list, GCompareFunc func)
}
next->next = NULL;
n_digits = increment (digits, list, n_digits, func);
max_pos = increment (digits, list, max_pos, func);
list = tail;
}
return combine_digits (digits, list, n_digits, func);
return combine_digits (digits, list, max_pos, func);
}
#undef MAX_DIGITS
#undef FLOOR_LOG2
#undef N_DIGITS
#undef LOG2_FLOOR
+1 -4
View File
@@ -18,10 +18,7 @@ SOURCES = \
queue.c \
shell.c \
spawn.c \
timer.c \
file.c \
pattern.c \
dir.c
timer.c
test_eglib_SOURCES = $(SOURCES)
test_glib_SOURCES = $(SOURCES)
-55
View File
@@ -1,55 +0,0 @@
#include <glib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include "test.h"
/* This test is just to be used with valgrind */
RESULT
test_dir ()
{
GDir *dir;
GError *error;
const gchar *name;
/*
dir = g_dir_open (NULL, 0, NULL);
*/
dir = g_dir_open ("", 0, NULL);
if (dir != NULL)
return FAILED ("1 Should be an error");
dir = g_dir_open ("", 9, NULL);
if (dir != NULL)
return FAILED ("2 Should be an error");
error = NULL;
dir = g_dir_open (".ljasdslakjd", 9, &error);
if (dir != NULL)
return FAILED ("3 opendir should fail");
if (error == NULL)
return FAILED ("4 got no error");
g_error_free (error);
error = NULL;
dir = g_dir_open (g_get_tmp_dir (), 9, &error);
if (dir == NULL)
return FAILED ("5 opendir should succeed");
if (error != NULL)
return FAILED ("6 got an error");
name = NULL;
name = g_dir_read_name (dir);
if (name == NULL)
return FAILED ("7 didn't read a file name");
g_dir_close (dir);
return OK;
}
static Test dir_tests [] = {
{"g_dir_*", test_dir},
{NULL, NULL}
};
DEFINE_TEST_GROUP_INIT(dir_tests_init, dir_tests)
-208
View File
@@ -1,208 +0,0 @@
#include <glib.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include "test.h"
RESULT
test_file_get_contents ()
{
GError *error;
gchar *content;
gboolean ret;
gsize length;
/*
filename != NULL
ret = g_file_get_contents (NULL, NULL, NULL, NULL);
contents != NULL
ret = g_file_get_contents ("", NULL, NULL, NULL);
error no such file and fails for 'error' not being null too
ret = g_file_get_contents ("", &content, NULL, &error);
*/
error = NULL;
ret = g_file_get_contents ("", &content, NULL, &error);
if (ret)
return FAILED ("HAH!");
if (error == NULL)
return FAILED ("Got nothing as error.");
if (content != NULL)
return FAILED ("Content is uninitialized");
g_error_free (error);
error = NULL;
ret = g_file_get_contents ("/etc/hosts", &content, &length, &error);
if (!ret)
return FAILED ("The error is %d %s\n", error->code, error->message);
if (error != NULL)
return FAILED ("Got an error returning TRUE");
if (content == NULL)
return FAILED ("Content is NULL");
if (strlen (content) != length)
return FAILED ("length is %d but the string is %d", length, strlen (content));
g_free (content);
return OK;
}
RESULT
test_open_tmp ()
{
GError *error;
gint fd;
gchar *name = GINT_TO_POINTER (-1);
/*
* Okay, this works, but creates a .xxx file in /tmp on every run. Disabled.
* fd = g_file_open_tmp (NULL, NULL, NULL);
* if (fd < 0)
* return FAILED ("Default failed.");
* close (fd);
*/
error = NULL;
fd = g_file_open_tmp ("invalidtemplate", NULL, &error);
if (fd != -1)
return FAILED ("The template was invalid and accepted");
if (error == NULL)
return FAILED ("No error returned.");
g_error_free (error);
error = NULL;
fd = g_file_open_tmp ("i/nvalidtemplate", &name, &error);
if (fd != -1)
return FAILED ("The template was invalid and accepted");
if (error == NULL)
return FAILED ("No error returned.");
if (name == NULL)
return FAILED ("'name' is not reset");
g_error_free (error);
error = NULL;
fd = g_file_open_tmp ("valid-XXXXXX", &name, &error);
if (fd == -1)
return FAILED ("This should be valid");
if (error != NULL)
return FAILED ("No error returned.");
if (name == NULL)
return FAILED ("No name returned.");
close (fd);
unlink (name);
g_free (name);
return OK;
}
RESULT
test_file ()
{
gboolean res;
const gchar *tmp;
gchar *path, *sympath;
gint ignored;
res = g_file_test (NULL, 0);
if (res)
return FAILED ("Should return FALSE HERE");
res = g_file_test ("file.c", 0);
if (res)
return FAILED ("Should return FALSE HERE");
tmp = g_get_tmp_dir ();
res = g_file_test (tmp, G_FILE_TEST_EXISTS);
if (!res)
return FAILED ("tmp does not exist.");
res = g_file_test (tmp, G_FILE_TEST_IS_REGULAR);
if (res)
return FAILED ("tmp is regular");
res = g_file_test (tmp, G_FILE_TEST_IS_DIR);
if (!res)
return FAILED ("tmp is not a directory");
res = g_file_test (tmp, G_FILE_TEST_IS_EXECUTABLE);
if (!res)
return FAILED ("tmp is not a executable");
res = g_file_test (tmp, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_SYMLINK);
if (!res)
return FAILED ("2 tmp does not exist.");
res = g_file_test (tmp, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK);
if (res)
return FAILED ("2 tmp is regular");
res = g_file_test (tmp, G_FILE_TEST_IS_DIR | G_FILE_TEST_IS_SYMLINK);
if (!res)
return FAILED ("2 tmp is not a directory");
res = g_file_test (tmp, G_FILE_TEST_IS_EXECUTABLE | G_FILE_TEST_IS_SYMLINK);
if (!res)
return FAILED ("2 tmp is not a executable");
close (g_file_open_tmp (NULL, &path, NULL)); /* create an empty file */
res = g_file_test (path, G_FILE_TEST_EXISTS);
if (!res)
return FAILED ("3 %s should exist", path);
res = g_file_test (path, G_FILE_TEST_IS_REGULAR);
/* This is strange. Empty file is reported as not existing! */
if (!res)
return FAILED ("3 %s IS_REGULAR", path);
res = g_file_test (path, G_FILE_TEST_IS_DIR);
if (res)
return FAILED ("3 %s should not be a directory", path);
res = g_file_test (path, G_FILE_TEST_IS_EXECUTABLE);
if (res)
return FAILED ("3 %s should not be executable", path);
res = g_file_test (path, G_FILE_TEST_IS_SYMLINK);
if (res)
return FAILED ("3 %s should not be a symlink", path);
sympath = g_strconcat (path, "-link", NULL);
ignored = symlink (path, sympath);
res = g_file_test (sympath, G_FILE_TEST_EXISTS);
if (!res)
return FAILED ("4 %s should not exist", sympath);
res = g_file_test (sympath, G_FILE_TEST_IS_REGULAR);
if (!res)
return FAILED ("4 %s should not be a regular file", sympath);
res = g_file_test (sympath, G_FILE_TEST_IS_DIR);
if (res)
return FAILED ("4 %s should not be a directory", sympath);
res = g_file_test (sympath, G_FILE_TEST_IS_EXECUTABLE);
if (res)
return FAILED ("4 %s should not be executable", sympath);
res = g_file_test (sympath, G_FILE_TEST_IS_SYMLINK);
if (!res)
return FAILED ("4 %s should be a symlink", sympath);
unlink (path);
res = g_file_test (sympath, G_FILE_TEST_EXISTS);
if (res)
return FAILED ("5 %s should exist", sympath);
res = g_file_test (sympath, G_FILE_TEST_IS_REGULAR);
if (res)
return FAILED ("5 %s should be a regular file", sympath);
res = g_file_test (sympath, G_FILE_TEST_IS_DIR);
if (res)
return FAILED ("5 %s should not be a directory", sympath);
res = g_file_test (sympath, G_FILE_TEST_IS_EXECUTABLE);
if (res)
return FAILED ("5 %s should not be executable", sympath);
res = g_file_test (sympath, G_FILE_TEST_IS_SYMLINK);
if (!res)
return FAILED ("5 %s should be a symlink", sympath);
unlink (sympath);
g_free (path);
g_free (sympath);
return OK;
}
static Test file_tests [] = {
{"g_file_get_contents", test_file_get_contents},
{"g_file_open_tmp", test_open_tmp},
{"g_file_test", test_file},
{NULL, NULL}
};
DEFINE_TEST_GROUP_INIT(file_tests_init, file_tests)
+12 -30
View File
@@ -313,13 +313,13 @@ static int intcompare (gconstpointer p1, gconstpointer p2)
return GPOINTER_TO_INT (p1) - GPOINTER_TO_INT (p2);
}
static gboolean verify_sort (GList *list, int len)
static gboolean verify_sort (GList *list)
{
list = g_list_sort (list, intcompare);
if (list->prev)
return FALSE;
int prev = GPOINTER_TO_INT (list->data);
len--;
for (list = list->next; list; list = list->next) {
int curr = GPOINTER_TO_INT (list->data);
if (prev > curr)
@@ -328,24 +328,19 @@ static gboolean verify_sort (GList *list, int len)
if (!list->prev || list->prev->next != list)
return FALSE;
if (len == 0)
return FALSE;
len--;
}
return len == 0;
return TRUE;
}
RESULT
test_list_sort ()
{
int i, j, mul;
int i = 0;
GList *list = NULL;
for (i = 0; i < N_ELEMS; ++i)
list = g_list_prepend (list, GINT_TO_POINTER (i));
list = g_list_sort (list, intcompare);
if (!verify_sort (list, N_ELEMS))
if (!verify_sort (list))
return FAILED ("decreasing list");
g_list_free (list);
@@ -353,33 +348,20 @@ test_list_sort ()
list = NULL;
for (i = 0; i < N_ELEMS; ++i)
list = g_list_prepend (list, GINT_TO_POINTER (-i));
list = g_list_sort (list, intcompare);
if (!verify_sort (list, N_ELEMS))
if (!verify_sort (list))
return FAILED ("increasing list");
g_list_free (list);
list = g_list_prepend (NULL, GINT_TO_POINTER (0));
for (i = 1; i < N_ELEMS; ++i) {
list = g_list_prepend (list, GINT_TO_POINTER (i));
list = g_list_prepend (list, GINT_TO_POINTER (-i));
}
list = g_list_sort (list, intcompare);
if (!verify_sort (list, 2*N_ELEMS-1))
return FAILED ("alternating list");
g_list_free (list);
list = NULL;
mul = 1;
for (i = 1; i < N_ELEMS; ++i) {
int mul = 1;
for (i = 0; i < N_ELEMS; ++i) {
list = g_list_prepend (list, GINT_TO_POINTER (mul * i));
mul = -mul;
for (j = 0; j < i; ++j)
list = g_list_prepend (list, GINT_TO_POINTER (mul * j));
}
list = g_list_sort (list, intcompare);
if (!verify_sort (list, (N_ELEMS*N_ELEMS - N_ELEMS)/2))
return FAILED ("wavering list");
if (!verify_sort (list))
return FAILED ("alternating list");
g_list_free (list);
-45
View File
@@ -1,45 +0,0 @@
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include "test.h"
#define do_test(s) do { char *r = markup_test (s); if (r != NULL) FAILED (r); } while (0)
static char *
markup_test (const char *s)
{
GMarkupParser *parser = g_new0 (GMarkupParser, 1);
GMarkupParseContext *context;
GError *error = NULL;
context = g_markup_parse_context_new (parser, 0, 0, 0);
g_markup_parse_context_parse (context, s, strlen (s), &error);
g_markup_parse_context_free (context);
if (error != NULL)
return error->message;
return NULL;
}
RESULT invalid_documents (void)
{
/* These should fail */
do_test ("<1>");
do_test ("<a<");
do_test ("</a>");
return OK;
}
static Test markup_tests [] = {
{"invalid_documents", invalid_documents},
{"t2", hash_t2},
{"grow", hash_grow},
{"default", hash_default},
{"null_lookup", hash_null_lookup},
{NULL, NULL}
};
DEFINE_TEST_GROUP_INIT(hashtable_tests_init, hashtable_tests)
-2
View File
@@ -159,13 +159,11 @@ test_ppath2 ()
g_setenv ("PATH", path, TRUE);
return FAILED ("Found something interesting here: %s", s);
}
g_free (s);
s = g_find_program_in_path ("test-glib");
if (s == NULL) {
g_setenv ("PATH", path, TRUE);
return FAILED ("It should find 'test-glib' in the current directory.");
}
g_free (s);
g_setenv ("PATH", path, TRUE);
return OK;
}
-57
View File
@@ -1,57 +0,0 @@
#include <glib.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include "test.h"
#define MATCH(pat,string,error_if,msg) \
spec = g_pattern_spec_new (pat); \
res = g_pattern_match_string (spec, string); \
if (res == error_if) \
return FAILED (msg " returned %s", res ? "TRUE" : "FALSE"); \
g_pattern_spec_free (spec);
#define TEST_MATCH(pat,string,n) MATCH (pat, string, FALSE, "MATCH " #n)
#define TEST_NO_MATCH(pat,string,n) MATCH (pat, string,TRUE, "NO_MATCH " #n)
RESULT
test_pattern_spec ()
{
GPatternSpec *spec;
gboolean res;
/* spec = g_pattern_spec_new (NULL); */
TEST_MATCH ("*", "hola", 1);
TEST_MATCH ("hola", "hola", 2);
TEST_MATCH ("????", "hola", 3);
TEST_MATCH ("???a", "hola", 4);
TEST_MATCH ("h??a", "hola", 5);
TEST_MATCH ("h??*", "hola", 6);
TEST_MATCH ("h*", "hola", 7);
TEST_MATCH ("*hola", "hola", 8);
TEST_MATCH ("*l*", "hola", 9);
TEST_MATCH ("h*??", "hola", 10);
TEST_MATCH ("h*???", "hola", 11);
TEST_MATCH ("?o??", "hola", 12);
TEST_MATCH ("*h*o*l*a*", "hola", 13);
TEST_MATCH ("h*o*l*a", "hola", 14);
TEST_MATCH ("h?*?", "hola", 15);
TEST_NO_MATCH ("", "hola", 1);
TEST_NO_MATCH ("?????", "hola", 2);
TEST_NO_MATCH ("???", "hola", 3);
TEST_NO_MATCH ("*o", "hola", 4);
TEST_NO_MATCH ("h", "hola", 5);
TEST_NO_MATCH ("h*????", "hola", 6);
return OK;
}
static Test pattern_tests [] = {
{"g_pattern_spec*", test_pattern_spec},
{NULL, NULL}
};
DEFINE_TEST_GROUP_INIT(pattern_tests_init, pattern_tests)
+1 -3
View File
@@ -198,9 +198,7 @@ RESULT ptrarray_remove()
static gint ptrarray_sort_compare(gconstpointer a, gconstpointer b)
{
gchar *stra = *(gchar **) a;
gchar *strb = *(gchar **) b;
return strcmp(stra, strb);
return strcmp(a, b);
}
RESULT ptrarray_sort()
+16 -36
View File
@@ -6,14 +6,11 @@
RESULT
test_slist_append ()
{
GSList *foo;
GSList *list = g_slist_append (NULL, "first");
GSList *list = g_slist_prepend (NULL, "first");
if (g_slist_length (list) != 1)
return FAILED ("append(null,...) failed");
return FAILED ("Prepend failed");
foo = g_slist_append (list, "second");
if (foo != list)
return FAILED ("changed list head on non-empty");
g_slist_append (list, "second");
if (g_slist_length (list) != 2)
return FAILED ("Append failed");
@@ -171,33 +168,29 @@ static int intcompare (gconstpointer p1, gconstpointer p2)
return GPOINTER_TO_INT (p1) - GPOINTER_TO_INT (p2);
}
static gboolean verify_sort (GSList *list, int len)
static gboolean verify_sort (GSList *list)
{
list = g_slist_sort (list, intcompare);
int prev = GPOINTER_TO_INT (list->data);
len--;
for (list = list->next; list; list = list->next) {
int curr = GPOINTER_TO_INT (list->data);
if (prev > curr)
return FALSE;
prev = curr;
if (len == 0)
return FALSE;
len--;
}
return len == 0;
return TRUE;
}
RESULT
test_slist_sort ()
{
int i, j, mul;
int i = 0;
GSList *list = NULL;
for (i = 0; i < N_ELEMS; ++i)
list = g_slist_prepend (list, GINT_TO_POINTER (i));
list = g_slist_sort (list, intcompare);
if (!verify_sort (list, N_ELEMS))
if (!verify_sort (list))
return FAILED ("decreasing list");
g_slist_free (list);
@@ -205,33 +198,20 @@ test_slist_sort ()
list = NULL;
for (i = 0; i < N_ELEMS; ++i)
list = g_slist_prepend (list, GINT_TO_POINTER (-i));
list = g_slist_sort (list, intcompare);
if (!verify_sort (list, N_ELEMS))
if (!verify_sort (list))
return FAILED ("increasing list");
g_slist_free (list);
list = g_slist_prepend (NULL, GINT_TO_POINTER (0));
for (i = 1; i < N_ELEMS; ++i) {
list = g_slist_prepend (list, GINT_TO_POINTER (-i));
list = g_slist_prepend (list, GINT_TO_POINTER (i));
}
list = g_slist_sort (list, intcompare);
if (!verify_sort (list, 2*N_ELEMS-1))
return FAILED ("alternating list");
g_slist_free (list);
list = NULL;
mul = 1;
for (i = 1; i < N_ELEMS; ++i) {
int mul = 1;
for (i = 0; i < N_ELEMS; ++i) {
list = g_slist_prepend (list, GINT_TO_POINTER (mul * i));
mul = -mul;
for (j = 0; j < i; ++j)
list = g_slist_prepend (list, GINT_TO_POINTER (mul * j));
}
list = g_slist_sort (list, intcompare);
if (!verify_sort (list, (N_ELEMS*N_ELEMS - N_ELEMS)/2))
return FAILED ("wavering list");
if (!verify_sort (list))
return FAILED ("alternating list");
g_slist_free (list);
-39
View File
@@ -1,7 +1,6 @@
#include <glib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include "test.h"
RESULT
@@ -26,46 +25,8 @@ test_spawn_sync ()
return OK;
}
RESULT
test_spawn_async ()
{
/*
gboolean
g_spawn_async_with_pipes (const gchar *working_directory,
gchar **argv,
gchar **envp,
GSpawnFlags flags,
GSpawnChildSetupFunc child_setup,
gpointer user_data,
GPid *child_pid,
gint *standard_input,
gint *standard_output,
gint *standard_error,
GError **error) */
char *argv [15];
int stdout_fd = -1;
char buffer [512];
pid_t child_pid = 0;
memset (argv, 0, 15 * sizeof (char *));
argv [0] = "ls";
if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, NULL, NULL, &child_pid, NULL, &stdout_fd, NULL, NULL))
return FAILED ("1 Failed to run ls");
if (child_pid == 0)
return FAILED ("2 child pid not returned");
if (stdout_fd == -1)
return FAILED ("3 out fd is -1");
while (read (stdout_fd, buffer, 512) > 0);
close (stdout_fd);
printf ("Child pid: %d\n", child_pid);
return OK;
}
static Test spawn_tests [] = {
{"g_shell_spawn_sync", test_spawn_sync},
{"g_shell_spawn_async_with_pipes", test_spawn_async},
{NULL, NULL}
};
-2
View File
@@ -29,7 +29,6 @@
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <sys/time.h>
#include <glib.h>
@@ -79,7 +78,6 @@ run_group(Group *group, gint iterations, gboolean quiet,
gchar *result;
gboolean iter_pass, run;
iter_pass = FALSE;
if(tests_to_run != NULL) {
gint j;
run = FALSE;
-6
View File
@@ -14,9 +14,6 @@ DEFINE_TEST_GROUP_INIT_H(path_tests_init);
DEFINE_TEST_GROUP_INIT_H(shell_tests_init);
DEFINE_TEST_GROUP_INIT_H(spawn_tests_init);
DEFINE_TEST_GROUP_INIT_H(timer_tests_init);
DEFINE_TEST_GROUP_INIT_H(file_tests_init);
DEFINE_TEST_GROUP_INIT_H(pattern_tests_init);
DEFINE_TEST_GROUP_INIT_H(dir_tests_init);
static Group test_groups [] = {
{"string", string_tests_init},
@@ -33,9 +30,6 @@ static Group test_groups [] = {
{"shell", shell_tests_init},
{"spawn", spawn_tests_init},
{"timer", timer_tests_init},
{"file", file_tests_init},
{"pattern", pattern_tests_init},
{"dir", dir_tests_init},
{NULL, NULL}
};
+1 -1
View File
@@ -22,7 +22,7 @@ test_timer ()
g_timer_stop (timer);
elapsed1 = g_timer_elapsed (timer, NULL);
elapsed2 = g_timer_elapsed (timer, &usec);
if (fabs (elapsed1 - elapsed2) > 0.000001)
if (elapsed1 != elapsed2)
return FAILED ("The elapsed times are not equal %f - %f.", elapsed1, elapsed2);
elapsed2 *= 1000000;
+1 -26
View File
@@ -1692,32 +1692,7 @@
>
</File>
<File
RelativePath="mono\mini\aot-compiler.c"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="0"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="0"
BrowseInformation="1"
/>
</FileConfiguration>
</File>
<File
RelativePath="mono\mini\aot-runtime.c"
RelativePath="mono\mini\aot.c"
>
<FileConfiguration
Name="Release|Win32"
-4
View File
@@ -1,7 +1,3 @@
2006-08-28 Wade Berrier <[email protected]>
* Makefile: Non consequential casing rename for thisdir
2006-07-20 Jonathan Chambers <[email protected]>
* Makefile:
+1 -1
View File
@@ -1,4 +1,4 @@
thisdir = class/CustomMarshalers
thisdir = class/Custommarshalers
SUBDIRS =
include ../../build/rules.make
@@ -135,9 +135,7 @@ namespace System.Windows.Forms {
Application.ApplicationExit(null, EventArgs.Empty);
}
}
lock (threads) {
threads[thread_id] = null;
}
threads[thread_id] = null;
}
#endregion // Methods
}
@@ -30,7 +30,6 @@ using System.Threading;
namespace System.Windows.Forms {
internal class AsyncMethodData {
public IntPtr Handle;
public Delegate Method;
public object [] Args;
public AsyncMethodResult Result;
@@ -1,192 +1,3 @@
2006-08-30 Peter Dennis Bartok <[email protected]>
* Control.cs:
- PerformLayout(): It would seem MS performs the fill even if the
control is not visible (part of #79218 fix)
- ResetBackColor(): Use the setter to reset the color, to allow
overriders to catch the change.
* Form.cs:
- .ctor: Call UpdateBounds to adjust client rectangle (part of #79218 fix)
- CreateHandle(): dito (part of $79218 fix)
- Don't set an icon if we have a dialog
* ScrollableControl.cs:
- set_AutoScrollMinSize: Setting the property enables AutoScroll (#79218)
- ScrollIntoView(): No need to scroll if control is already visible
(resolves fixme and fixes #79218)
2006-08-30 Carlos Alberto Cortez <[email protected]>
* MonthCalendar.cs: Change proportions in SingleMonthSize
to match the aspect of the original control.
2006-08-29 Alexander Olk <[email protected]>
* XplatUIX11.cs: Fix for a metacity/X problem where windows don't
get updated when they get maximized.
2006-08-29 Peter Dennis Bartok <[email protected]>
* XplatUIX11.cs: Handle windows with no border (Fixes part of #79160)
2006-08-29 Chris Toshok <[email protected]>
* XplatUIX11.cs: when destroying the FocusWindow, send KILLFOCUS.
2006-08-29 Jackson Harper <[email protected]>
* TreeView.cs: Need to track selected node and highlighted node,
they aren't always the same thing, when the mouse is down on a
node it is hilighted, but not selected yet.
- Do the HideSelection stuff right
- Need to focus on rbutton mouse down. And redraw selection when
right click is mouse upped.
2006-08-29 Mike Kestner <[email protected]>
* ThemeWin32Classic.cs: draw selections for columns in FullRowSelect
when SubItems.Count < Columns.Count. [Fixes #79167]
2006-08-28 Peter Dennis Bartok <[email protected]>
* TextControl.cs (FindCursor): Fix math error (Fixes #78402)
2006-08-28 Peter Dennis Bartok <[email protected]>
* XplatUIX11.cs: Preempt the roundtrip for getting the location back
from X. Only send based on ConfigureNotify if we don't have the
correct location in hwnd (if the window manager moved us)
2006-08-28 Mike Kestner <[email protected]>
* ListView.cs: remove a TODO.
* ThemeWin32Classic.cs: implement HideSelection support for ListView.
[Fixes ListView part of #79166]
2006-08-28 Mike Kestner <[email protected]>
* ListView.cs: move wheel handler to parent since it is focused
instead of the item_control now. [Fixes #79177]
2006-08-28 Mike Kestner <[email protected]>
* ThemeWin32Classic.cs: only highlight subitems in fullrowselect
when the control is focused. [Fixes #79171]
2006-08-28 Mike Kestner <[email protected]>
* ListView.cs: size the item and header controls for empty and
unscrollable views.
* ThemeWin32Classic.cs: draw disabled backgrounds.
[Fixes #79187]
2006-08-28 Chris Toshok <[email protected]>
* Form.cs: remove unused "active_form" static field.
* Hwnd.cs: lock around accesses to static windows collection.
* Application.cs: lock threads in Exit ().
2006-08-28 Chris Toshok <[email protected]>
* NativeWindow.cs: lock around accesses to window_collection.
2006-08-28 Chris Toshok <[email protected]>
* Control.cs: err, fix this the right way, by locking on controls
when using it. not by making it synchronized.
2006-08-28 Chris Toshok <[email protected]>
* Control.cs: make the static "controls" field synchronized, as it
gets updated from multiple threads.
2006-08-27 Peter Dennis Bartok <[email protected]>
* XplatUIX11.cs: PostQuitMessage is thread-specific not app-specific.
Prevent other threads from exiting when calling thread sets quit state.
* XEventQueue.cs: Added PostQuitState property
2006-08-27 Chris Toshok <[email protected]>
* AsyncMethodData.cs: add a slot for the window handle.
* XplatUIX11.cs (SendAsyncMethod): send the event to the right
window (the destination control's window, not the foster window).
* Control.cs (BeginInvokeInternal): store the window's handle in
the AsyncMethodData.
2006-08-27 Peter Dennis Bartok <[email protected]>
* XplatUIX11.cs:
- PostQuitMessage: Removed resetting S.D display handle, we might have
another loop started after calling PostQuitMessage (Fixes #79119)
- Created destructor to reset S.D handle
2006-08-27 Peter Dennis Bartok <[email protected]>
* XplatUIX11.cs (SetCursor): Issue flush after setting the cursor (#79168)
2006-08-23 Peter Dennis Bartok <[email protected]>
* TextControl.cs (Insert): Update the caret position even if we don't
have a handle yet, just don't call the driver in that case.
* TextBoxBase.cs (set_SelectedText): Set the Start and End selection
to the end of the new selection text (Fixes #79184)
2006-08-23 Peter Dennis Bartok <[email protected]>
* Form.cs (Activate): Only activate if the handle is created)
* Control.c:
- Mark window as invisible when it's disposed
- Check if window handle is created when setting window visible,
instead of relying just on the is_created variable
- Check if object is disposed when creating the control (Fixes #79155)
2006-08-23 Peter Dennis Bartok <[email protected]>
* ScrollableWindow.cs (ScrollWindow): Don't actually perform layouting
when allowing layout again. Otherwise we re-generate the anchoring
distance to the border again and actually alter what the user wanted
This is ugly, it'd be better if we used DisplayRectangle instead of
ClientRectangle for Control.UpdateDistances, but that causes us to
have other problems (initial anchoring positons would be wrong)
(Fixes #78835)
2006-08-23 Peter Dennis Bartok <[email protected]>
* Control.cs:
- The size and location setters shouldn't go directly to
SetBoundsCore, but to SetBounds, which triggers layout on the
parent, then calls SetBoundsCore. (Related to fix for #78835)
- SetBounds: Moved actual location update code into this function
from SetBoundsCore, to match MS. Added call to PerformLayout if
we have a parent (to trigger resizing of anchored parents if the
child size has changed (see testcase for #78835)
* ListBox.cs, Form.cs: Call SetBounds instead of SetBoundsCore to match
new control code
* ScrollableControl.cs (CalculateCanvasSize): Use shortcut variable
2006-08-23 Peter Dennis Bartok <[email protected]>
* XplatUIX11.cs: Don't reset the DisplayHandle that's stored in
System.Drawing when a toplevel window gets closed; there might
be other toplevel windows belonging to the same app (Fixes #78052)
2006-08-26 Alexander Olk <[email protected]>
* FileDialog.cs: After reading FileDialog settings from mwf_config
use Desktop prefix only if a real folder doesn't exist anymore.
* FontDialog.cs: Added char sets.
It is now possible to select the font, size or style with the
textboxes.
2006-08-25 Kornél Pál <[email protected]>
* PrintPreviewDialog.cs: Use assembly name constants.
2006-08-23 Peter Dennis Bartok <[email protected]>
* XplatUIWin32.cs (ScrollWindow): Use clipping rectangle arg (prevents
@@ -105,7 +105,7 @@ namespace System.Windows.Forms
internal int dist_bottom; // distance to the bottom border of the parent
// to be categorized...
static internal ArrayList controls = new ArrayList(); // All of the application's controls, in a flat list
static internal ArrayList controls = new ArrayList(); // All of the application's controls, in a flat list
internal ControlCollection child_controls; // our children
internal Control parent; // our parent control
internal AccessibleObject accessibility_object; // object that contains accessibility information about our control
@@ -733,7 +733,7 @@ namespace System.Windows.Forms
bounds.Y=top;
bounds.Width=width;
bounds.Height=height;
SetBounds(left, top, width, height, BoundsSpecified.All);
SetBoundsCore(left, top, width, height, BoundsSpecified.All);
Text=text;
}
@@ -746,7 +746,7 @@ namespace System.Windows.Forms
bounds.Y=top;
bounds.Width=width;
bounds.Height=height;
SetBounds(left, top, width, height, BoundsSpecified.All);
SetBoundsCore(left, top, width, height, BoundsSpecified.All);
Text=text;
}
@@ -773,9 +773,7 @@ namespace System.Windows.Forms
}
} else {
DestroyHandle();
lock (Control.controls) {
Control.controls.Remove(this);
}
controls.Remove(this);
}
@@ -790,7 +788,6 @@ namespace System.Windows.Forms
}
}
is_disposed = true;
is_visible = false;
base.Dispose(disposing);
}
#endregion // Public Constructors
@@ -837,7 +834,6 @@ namespace System.Windows.Forms
result = new AsyncMethodResult ();
data = new AsyncMethodData ();
data.Handle = window.Handle;
data.Method = method;
data.Args = args;
data.Result = result;
@@ -1649,7 +1645,7 @@ namespace System.Windows.Forms
}
set {
SetBounds(value.Left, value.Top, value.Width, value.Height, BoundsSpecified.All);
SetBoundsCore(value.Left, value.Top, value.Width, value.Height, BoundsSpecified.All);
}
}
@@ -2058,7 +2054,7 @@ namespace System.Windows.Forms
}
set {
SetBounds(bounds.X, bounds.Y, bounds.Width, value, BoundsSpecified.Height);
SetBoundsCore(bounds.X, bounds.Y, bounds.Width, value, BoundsSpecified.Height);
}
}
@@ -2141,7 +2137,7 @@ namespace System.Windows.Forms
}
set {
SetBounds(value, bounds.Y, bounds.Width, bounds.Height, BoundsSpecified.X);
SetBoundsCore(value, bounds.Y, bounds.Width, bounds.Height, BoundsSpecified.X);
}
}
@@ -2153,7 +2149,7 @@ namespace System.Windows.Forms
}
set {
SetBounds(value.X, value.Y, bounds.Width, bounds.Height, BoundsSpecified.Location);
SetBoundsCore(value.X, value.Y, bounds.Width, bounds.Height, BoundsSpecified.Location);
}
}
@@ -2318,7 +2314,7 @@ namespace System.Windows.Forms
}
set {
SetBounds(bounds.X, bounds.Y, value.Width, value.Height, BoundsSpecified.Size);
SetBoundsCore(bounds.X, bounds.Y, value.Width, value.Height, BoundsSpecified.Size);
}
}
@@ -2406,7 +2402,7 @@ namespace System.Windows.Forms
}
set {
SetBounds(bounds.X, value, bounds.Width, bounds.Height, BoundsSpecified.Y);
SetBoundsCore(bounds.X, value, bounds.Width, bounds.Height, BoundsSpecified.Y);
}
}
@@ -2452,7 +2448,7 @@ namespace System.Windows.Forms
}
set {
SetBounds(bounds.X, bounds.Y, value, bounds.Height, BoundsSpecified.Width);
SetBoundsCore(bounds.X, bounds.Y, value, bounds.Height, BoundsSpecified.Width);
}
}
@@ -2607,19 +2603,17 @@ namespace System.Windows.Forms
#region Public Static Methods
[EditorBrowsable(EditorBrowsableState.Advanced)]
public static Control FromChildHandle(IntPtr handle) {
lock (Control.controls) {
IEnumerator control = Control.controls.GetEnumerator();
IEnumerator control = Control.controls.GetEnumerator();
while (control.MoveNext()) {
if (((Control)control.Current).window.Handle == handle) {
// Found it
if (((Control)control.Current).Parent != null) {
return ((Control)control.Current).Parent;
}
while (control.MoveNext()) {
if (((Control)control.Current).window.Handle == handle) {
// Found it
if (((Control)control.Current).Parent != null) {
return ((Control)control.Current).Parent;
}
}
return null;
}
return null;
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
@@ -2707,9 +2701,6 @@ namespace System.Windows.Forms
}
public void CreateControl() {
if (is_disposed) {
throw new ObjectDisposedException(GetType().FullName.ToString());
}
if (is_created) {
return;
}
@@ -2930,7 +2921,7 @@ namespace System.Windows.Forms
AnchorStyles anchor;
Rectangle space;
space = DisplayRectangle;
space= DisplayRectangle;
// Deal with docking; go through in reverse, MS docs say that lowest Z-order is closest to edge
Control [] controls = child_controls.GetAllControls ();
@@ -2978,13 +2969,12 @@ namespace System.Windows.Forms
for (int i = controls.Length - 1; i >= 0; i--) {
child=controls[i];
//if (child.Visible && (child.Dock == DockStyle.Fill)) {
if (child.Dock == DockStyle.Fill) {
if (child.Visible && (child.Dock == DockStyle.Fill)) {
child.SetBounds(space.Left, space.Top, space.Width, space.Height);
}
}
space = DisplayRectangle;
space=DisplayRectangle;
for (int i=0; i < controls.Length; i++) {
int left;
@@ -3127,7 +3117,7 @@ namespace System.Windows.Forms
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual void ResetBackColor() {
BackColor = Color.Empty;
background_color = Color.Empty;
}
[EditorBrowsable(EditorBrowsableState.Never)]
@@ -3233,30 +3223,11 @@ namespace System.Windows.Forms
}
public void SetBounds(int x, int y, int width, int height) {
SetBounds(x, y, width, height, BoundsSpecified.All);
SetBoundsCore(x, y, width, height, BoundsSpecified.All);
}
public void SetBounds(int x, int y, int width, int height, BoundsSpecified specified) {
if ((specified & BoundsSpecified.X) != BoundsSpecified.X) {
x = Left;
}
if ((specified & BoundsSpecified.Y) != BoundsSpecified.Y) {
y = Top;
}
if ((specified & BoundsSpecified.Width) != BoundsSpecified.Width) {
width = Width;
}
if ((specified & BoundsSpecified.Height) != BoundsSpecified.Height) {
height = Height;
}
SetBoundsCore(x, y, width, height, specified);
if (parent != null) {
parent.PerformLayout(this, "Bounds");
}
}
public void Show() {
@@ -3299,7 +3270,7 @@ namespace System.Windows.Forms
[EditorBrowsable(EditorBrowsableState.Advanced)]
protected virtual void CreateHandle() {
if (IsDisposed) {
throw new ObjectDisposedException(GetType().FullName.ToString());
throw new ObjectDisposedException(Name);
}
if (IsHandleCreated && !is_recreating) {
@@ -3309,10 +3280,8 @@ namespace System.Windows.Forms
window.CreateHandle(CreateParams);
if (window.Handle != IntPtr.Zero) {
lock (Control.controls) {
if (!Control.controls.Contains(window.Handle)) {
Control.controls.Add(this);
}
if (!controls.Contains(window.Handle)) {
controls.Add(this);
}
creator_thread = Thread.CurrentThread;
@@ -3647,7 +3616,7 @@ namespace System.Windows.Forms
size.Height = (int)(size.Height * dy);
}
SetBounds(location.X, location.Y, size.Width, size.Height, BoundsSpecified.All);
SetBoundsCore(location.X, location.Y, size.Width, size.Height, BoundsSpecified.All);
/* Now scale our children */
Control [] controls = child_controls.GetAllControls ();
@@ -3669,6 +3638,22 @@ namespace System.Windows.Forms
[EditorBrowsable(EditorBrowsableState.Advanced)]
protected virtual void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) {
// SetBoundsCore updates the Win32 control itself. UpdateBounds updates the controls variables and fires events, I'm guessing - pdb
if ((specified & BoundsSpecified.X) != BoundsSpecified.X) {
x = Left;
}
if ((specified & BoundsSpecified.Y) != BoundsSpecified.Y) {
y = Top;
}
if ((specified & BoundsSpecified.Width) != BoundsSpecified.Width) {
width = Width;
}
if ((specified & BoundsSpecified.Height) != BoundsSpecified.Height) {
height = Height;
}
if (IsHandleCreated) {
XplatUI.SetWindowPos(Handle, x, y, width, height);
}
@@ -3692,7 +3677,7 @@ namespace System.Windows.Forms
return;
}
SetBounds(bounds.X, bounds.Y, WindowRect.Width, WindowRect.Height, BoundsSpecified.Size);
SetBoundsCore(bounds.X, bounds.Y, WindowRect.Width, WindowRect.Height, BoundsSpecified.Size);
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
@@ -3725,7 +3710,7 @@ namespace System.Windows.Forms
protected virtual void SetVisibleCore(bool value) {
if (value!=is_visible) {
if (value && (window.Handle == IntPtr.Zero) || !is_created) {
if (value && !is_created) {
CreateControl();
}
@@ -1073,7 +1073,7 @@ namespace System.Windows.Forms {
{
lastFolder = (string)MWFConfig.GetValue (filedialog_string, lastfolder_string);
if (lastFolder != null && lastFolder.IndexOf ("://") == -1) {
if (lastFolder != null && lastFolder.IndexOf ("://") != -1) {
if (!Directory.Exists (lastFolder)) {
lastFolder = MWFVFS.DesktopPrefix;
}
@@ -26,6 +26,10 @@
// NOT COMPLETE - work in progress
// TODO:
// - select values for font/style/size via the TextBoxes
// - etc
using System.ComponentModel;
using System.Drawing;
using System.Text.RegularExpressions;
@@ -102,75 +106,14 @@ namespace System.Windows.Forms
private Hashtable fontHash = new Hashtable();
private int[] a_sizes = {
6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72
8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72
};
// char set stuff is only here to make me happy :-)
private string [] char_sets_names = {
"Western",
"Symbol",
"Shift Jis",
"Hangul",
"GB2312",
"BIG5",
"Greek",
"Turkish",
"Hebrew",
"Arabic",
"Baltic",
"Vietname",
"Cyrillic",
"East European",
"Thai",
"Johab",
"Mac",
"OEM",
"VISCII",
"TCVN",
"KOI-8",
"ISO-8859-3",
"ISO-8859-4",
"ISO-8859-10",
"Celtic"
};
private string [] char_sets = {
"AaBbYyZz",
"Symbol",
"Aa" + (char)0x3042 + (char)0x3041 + (char)0x30a2 + (char)0x30a1 + (char)0x4e9c + (char)0x5b87,
(char)0xac00 + (char)0xb098 + (char)0xb2e4 + "AaBYyZz",
new String(new Char [] {(char)0x5fae, (char)0x8f6f, (char)0x4e2d, (char)0x6587, (char)0x8f6f, (char)0x4ef6}),
new String(new Char [] {(char)0x4e2d, (char)0x6587, (char)0x5b57, (char)0x578b, (char)0x7bc4, (char)0x4f8b}),
"AaBb" + (char)0x0391 + (char)0x03b1 + (char)0x0392 + (char)0x03b2,
"AaBb" + (char)0x011e + (char)0x011f + (char)0x015e + (char)0x015f,
"AaBb" + (char)0x05e0 + (char)0x05e1 + (char)0x05e9 + (char)0x05ea,
"AaBb" + (char)0x0627 + (char)0x0628 + (char)0x062c + (char)0x062f + (char)0x0647 + (char)0x0648 + (char)0x0632,
"AaBbYyZz",
"AaBb" + (char)0x01a0 + (char)0x01a1 + (char)0x01af + (char)0x01b0,
"AaBb" + (char)0x0411 + (char)0x0431 + (char)0x0424 + (char)0x0444,
"AaBb" + (char)0xc1 + (char)0xe1 + (char)0xd4 + (char)0xf4,
"AaBb" + (char)0x0e2d + (char)0x0e31 + (char)0x0e01 + (char)0x0e29 + (char)0x0e23 + (char)0x0e44 + (char)0x0e17 +(char)0x0e22,
(char)0xac00 + (char)0xb098 + (char)0xb2e4 + "AaBYyZz",
"AaBbYyZz",
"AaBb" + (char)0xf8 + (char)0xf1 + (char)0xfd,
"",
"",
"",
"",
"",
"",
""
};
private string example_panel_text;
private bool internal_change = false;
#region Public Constructors
public FontDialog( )
{
example_panel_text = char_sets [0];
okButton = new Button( );
cancelButton = new Button( );
applyButton = new Button( );
@@ -227,7 +170,6 @@ namespace System.Windows.Forms
fontsizeTextBox.Size = new Size( 52, 21 );
fontsizeTextBox.TabIndex = 7;
fontsizeTextBox.Text = "";
fontsizeTextBox.MaxLength = 2;
// schriftartListBox
fontListBox.Location = new Point( 16, 47 );
fontListBox.Size = new Size( 140, 95 );
@@ -277,7 +219,7 @@ namespace System.Windows.Forms
scriptComboBox.Location = new Point( 164, 253 );
scriptComboBox.Size = new Size( 172, 21 );
scriptComboBox.TabIndex = 14;
scriptComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
scriptComboBox.Text = "-/-";
// okButton
okButton.FlatStyle = FlatStyle.System;
okButton.Location = new Point( 352, 26 );
@@ -369,11 +311,6 @@ namespace System.Windows.Forms
CreateFontSizeListBoxItems ();
scriptComboBox.BeginUpdate ();
scriptComboBox.Items.AddRange (char_sets_names);
scriptComboBox.SelectedIndex = 0;
scriptComboBox.EndUpdate ();
applyButton.Hide( );
helpButton.Hide( );
colorComboBox.Hide( );
@@ -387,15 +324,10 @@ namespace System.Windows.Forms
fontstyleListBox.SelectedIndexChanged += new EventHandler( OnSelectedIndexChangedFontStyleListBox );
underlinedCheckBox.CheckedChanged += new EventHandler( OnCheckedChangedUnderlinedCheckBox );
strikethroughCheckBox.CheckedChanged += new EventHandler( OnCheckedChangedStrikethroughCheckBox );
scriptComboBox.SelectedIndexChanged += new EventHandler (OnSelectedIndexChangedScriptComboBox);
fontTextBox.KeyPress += new KeyPressEventHandler (OnFontTextBoxKeyPress);
fontstyleTextBox.KeyPress += new KeyPressEventHandler (OnFontStyleTextBoxKeyPress);
fontsizeTextBox.KeyPress += new KeyPressEventHandler (OnFontSizeTextBoxKeyPress);
fontTextBox.TextChanged += new EventHandler (OnFontTextBoxTextChanged);
fontstyleTextBox.TextChanged += new EventHandler (OnFontStyleTextTextChanged);
fontsizeTextBox.TextChanged += new EventHandler (OnFontSizeTextBoxTextChanged);
fontTextBox.KeyUp += new KeyEventHandler (OnFontTextBoxKeyUp);
fontstyleTextBox.KeyUp += new KeyEventHandler (OnFontStyleTextBoxKeyUp);
fontsizeTextBox.KeyUp += new KeyEventHandler (OnFontSizeTextBoxKeyUp);
Font = form.Font;
}
@@ -752,7 +684,9 @@ namespace System.Windows.Forms
e.Graphics.FillRectangle( ThemeEngine.Current.ResPool.GetSolidBrush( SystemColors.Control ), 0, 0, 156, 40 );
SizeF fontSizeF = e.Graphics.MeasureString( example_panel_text, font );
string text = "AaBbYyZz";
SizeF fontSizeF = e.Graphics.MeasureString( text, font );
int text_width = (int)fontSizeF.Width;
int text_height = (int)fontSizeF.Height;
@@ -762,7 +696,7 @@ namespace System.Windows.Forms
int y = ( examplePanel.Height / 2 ) - ( text_height / 2 );
e.Graphics.DrawString( example_panel_text, font, brush, new Point( x, y ) );
e.Graphics.DrawString( text, font, brush, new Point( x, y ) );
}
void OnSelectedIndexChangedFontListBox( object sender, EventArgs e )
@@ -869,41 +803,8 @@ namespace System.Windows.Forms
UpdateExamplePanel( );
}
bool internal_textbox_change = false;
void OnFontTextBoxKeyPress (object sender, KeyPressEventArgs e)
void OnFontTextBoxKeyUp (object sender, KeyEventArgs e)
{
internal_textbox_change = true;
if (fontListBox.SelectedIndex > -1)
fontListBox.SelectedIndex = -1;
}
void OnFontStyleTextBoxKeyPress (object sender, KeyPressEventArgs e)
{
internal_textbox_change = true;
if (fontstyleListBox.SelectedIndex > -1)
fontstyleListBox.SelectedIndex = -1;
}
void OnFontSizeTextBoxKeyPress (object sender, KeyPressEventArgs e)
{
if (Char.IsLetter (e.KeyChar) || Char.IsWhiteSpace (e.KeyChar) || Char.IsPunctuation (e.KeyChar) || e.KeyChar == ',') {
e.Handled = true;
return;
}
internal_textbox_change = true;
}
void OnFontTextBoxTextChanged (object sender, EventArgs e)
{
if (!internal_textbox_change)
return;
internal_textbox_change = false;
for (int i = 0; i < fontListBox.Items.Count; i++) {
string name = fontListBox.Items [i] as string;
@@ -918,35 +819,24 @@ namespace System.Windows.Forms
}
}
void OnFontStyleTextTextChanged (object sender, EventArgs e)
void OnFontStyleTextBoxKeyUp (object sender, KeyEventArgs e)
{
if (!internal_textbox_change)
return;
internal_textbox_change = false;
for (int i = 0; i < fontstyleListBox.Items.Count; i++) {
string name = fontstyleListBox.Items [i] as string;
if (name.StartsWith(fontstyleTextBox.Text)) {
if (name == fontstyleTextBox.Text)
fontstyleListBox.SelectedIndex = i;
else
fontstyleListBox.TopIndex = i;
break;
}
}
}
void OnFontSizeTextBoxTextChanged (object sender, EventArgs e)
void OnFontSizeTextBoxKeyUp (object sender, KeyEventArgs e)
{
if (!internal_textbox_change)
return;
internal_textbox_change = false;
if (fontsizeTextBox.Text.Length == 0)
return;
for (int i = 0; i < fontsizeListBox.Items.Count; i++) {
string name = fontsizeListBox.Items [i] as string;
@@ -961,17 +851,6 @@ namespace System.Windows.Forms
}
}
void OnSelectedIndexChangedScriptComboBox (object sender, EventArgs e)
{
string tmp_str = char_sets [scriptComboBox.SelectedIndex];
if (tmp_str.Length > 0) {
example_panel_text = tmp_str;
UpdateExamplePanel ();
}
}
void UpdateExamplePanel( )
{
if (font != null)
@@ -42,6 +42,7 @@ namespace System.Windows.Forms {
[ToolboxItem(false)]
public class Form : ContainerControl {
#region Local Variables
internal static Form active_form;
internal bool closing;
FormBorderStyle form_border_style;
private bool autoscale;
@@ -153,8 +154,6 @@ namespace System.Windows.Forms {
default_maximized_bounds = Rectangle.Empty;
owned_forms = new Form.ControlCollection(this);
transparency_key = Color.Empty;
UpdateBounds();
}
#endregion // Public Constructor & Destructor
@@ -988,7 +987,7 @@ namespace System.Windows.Forms {
case FormBorderStyle.FixedDialog: {
cp.Style |= (int)(WindowStyles.WS_CAPTION | WindowStyles.WS_BORDER);
cp.ExStyle |= (int)(WindowExStyles.WS_EX_DLGMODALFRAME | WindowExStyles.WS_EX_CONTROLPARENT);
cp.ExStyle |= (int)(WindowExStyles.WS_EX_DLGMODALFRAME);
break;
}
@@ -1133,11 +1132,9 @@ namespace System.Windows.Forms {
Form active;
// The docs say activate only activates if our app is already active
if (IsHandleCreated) {
active = ActiveForm;
if ((active != null) && (this != active)) {
XplatUI.Activate(window.Handle);
}
active = ActiveForm;
if ((active != null) && (this != active)) {
XplatUI.Activate(window.Handle);
}
}
@@ -1363,8 +1360,6 @@ namespace System.Windows.Forms {
protected override void CreateHandle() {
base.CreateHandle ();
UpdateBounds();
if (XplatUI.SupportsTransparency()) {
if (allow_transparency) {
XplatUI.SetWindowTransparency(Handle, Opacity, TransparencyKey);
@@ -1372,7 +1367,7 @@ namespace System.Windows.Forms {
}
XplatUI.SetWindowMinMax(window.Handle, maximized_bounds, minimum_size, maximum_size);
if ((FormBorderStyle != FormBorderStyle.FixedDialog) && (icon != null)) {
if (icon != null) {
XplatUI.SetIcon(window.Handle, icon);
}
@@ -1707,11 +1702,11 @@ namespace System.Windows.Forms {
if (!IsMdiChild) {
if (XplatUI.CalculateWindowRect(ref ClientRect, cp.Style, cp.ExStyle, cp.menu, out WindowRect)) {
SetBounds(bounds.X, bounds.Y, WindowRect.Width, WindowRect.Height, BoundsSpecified.Size);
SetBoundsCore(bounds.X, bounds.Y, WindowRect.Width, WindowRect.Height, BoundsSpecified.Size);
}
} else {
if (XplatUI.CalculateWindowRect(ref ClientRect, cp.Style, cp.ExStyle, cp.menu, out WindowRect)) {
SetBounds(bounds.X, bounds.Y, WindowRect.Width, WindowRect.Height, BoundsSpecified.Size);
SetBoundsCore(bounds.X, bounds.Y, WindowRect.Width, WindowRect.Height, BoundsSpecified.Size);
}
}
}
@@ -105,10 +105,8 @@ namespace System.Windows.Forms {
public void Dispose() {
expose_pending = false;
nc_expose_pending = false;
lock (windows) {
windows.Remove(client_window);
windows.Remove(whole_window);
}
windows.Remove(client_window);
windows.Remove(whole_window);
for (int i = 0; i < marshal_free_list.Count; i++) {
Marshal.FreeHGlobal((IntPtr)marshal_free_list[i]);
}
@@ -122,20 +120,12 @@ namespace System.Windows.Forms {
}
public static Hwnd ObjectFromWindow(IntPtr window) {
Hwnd rv;
lock (windows) {
rv = (Hwnd)windows[window];
}
return rv;
return (Hwnd)windows[window];
}
public static Hwnd ObjectFromHandle(IntPtr handle) {
//return (Hwnd)(((GCHandle)handle).Target);
Hwnd rv;
lock (windows) {
rv = (Hwnd)windows[handle];
}
return rv;
return (Hwnd)windows[handle];
}
public static IntPtr HandleFromObject(Hwnd obj) {
@@ -143,19 +133,13 @@ namespace System.Windows.Forms {
}
public static Hwnd GetObjectFromWindow(IntPtr window) {
Hwnd rv;
lock (windows) {
rv = (Hwnd)windows[window];
}
return rv;
return (Hwnd)windows[window];
}
public static IntPtr GetHandleFromWindow(IntPtr window) {
Hwnd hwnd;
lock (windows) {
hwnd = (Hwnd)windows[window];
}
hwnd = (Hwnd)windows[window];
if (hwnd != null) {
return hwnd.handle;
} else {
@@ -279,10 +263,8 @@ namespace System.Windows.Forms {
client_window = value;
handle = value;
lock (windows) {
if (windows[client_window] == null) {
windows[client_window] = this;
}
if (windows[client_window] == null) {
windows[client_window] = this;
}
}
}
@@ -529,10 +511,8 @@ namespace System.Windows.Forms {
set {
whole_window = value;
lock (windows) {
if (windows[whole_window] == null) {
windows[whole_window] = this;
}
if (windows[whole_window] == null) {
windows[whole_window] = this;
}
}
}
@@ -1786,7 +1786,7 @@ namespace System.Windows.Forms
if (requested_height == -1)
return;
SetBounds(0, 0, 0, requested_height, BoundsSpecified.Height);
SetBoundsCore (0, 0, 0, requested_height, BoundsSpecified.Height);
}
private void UpdateScrollBars ()
@@ -26,6 +26,7 @@
//
// TODO:
// - Feedback for item activation, change in cursor types as mouse moves.
// - HideSelection
// - LabelEdit
// - Drag and drop
@@ -167,7 +168,6 @@ namespace System.Windows.Forms
SizeChanged += new EventHandler (ListView_SizeChanged);
GotFocus += new EventHandler (FocusChanged);
LostFocus += new EventHandler (FocusChanged);
MouseWheel += new MouseEventHandler(ListView_MouseWheel);
this.SetStyle (ControlStyles.UserPaint | ControlStyles.StandardClick, false);
}
@@ -777,10 +777,6 @@ namespace System.Windows.Forms
if (!this.scrollable || this.items.Count <= 0) {
h_scroll.Visible = false;
v_scroll.Visible = false;
item_control.Location = new Point (0, header_control.Height);
item_control.Height = ClientRectangle.Width - header_control.Height;
item_control.Width = ClientRectangle.Width;
header_control.Width = ClientRectangle.Width;
return;
}
@@ -1267,6 +1263,7 @@ namespace System.Windows.Forms
MouseMove += new MouseEventHandler(ItemsMouseMove);
MouseHover += new EventHandler(ItemsMouseHover);
MouseUp += new MouseEventHandler(ItemsMouseUp);
MouseWheel += new MouseEventHandler(ItemsMouseWheel);
}
void ItemsDoubleClick (object sender, EventArgs e)
@@ -1550,6 +1547,30 @@ namespace System.Windows.Forms
checking = false;
}
private void ItemsMouseWheel (object sender, MouseEventArgs me)
{
if (owner.Items.Count == 0)
return;
int lines = me.Delta / 120;
if (lines == 0)
return;
switch (owner.View) {
case View.Details:
case View.SmallIcon:
owner.Scroll (owner.v_scroll, -owner.Items [0].Bounds.Height * SystemInformation.MouseWheelScrollLines * lines);
break;
case View.LargeIcon:
owner.Scroll (owner.v_scroll, -(owner.Items [0].Bounds.Height + ThemeEngine.Current.ListViewVerticalSpacing) * lines);
break;
case View.List:
owner.Scroll (owner.h_scroll, -owner.Items [0].Bounds.Width * lines);
break;
}
}
internal override void OnPaintInternal (PaintEventArgs pe)
{
ThemeEngine.Current.DrawListViewItems (pe.Graphics, pe.ClipRectangle, owner);
@@ -1580,30 +1601,6 @@ namespace System.Windows.Forms
item_control.Invalidate (FocusedItem.Bounds);
}
private void ListView_MouseWheel (object sender, MouseEventArgs me)
{
if (Items.Count == 0)
return;
int lines = me.Delta / 120;
if (lines == 0)
return;
switch (View) {
case View.Details:
case View.SmallIcon:
Scroll (v_scroll, -Items [0].Bounds.Height * SystemInformation.MouseWheelScrollLines * lines);
break;
case View.LargeIcon:
Scroll (v_scroll, -(Items [0].Bounds.Height + ThemeEngine.Current.ListViewVerticalSpacing) * lines);
break;
case View.List:
Scroll (h_scroll, -Items [0].Bounds.Width * lines);
break;
}
}
private void ListView_SizeChanged (object sender, EventArgs e)
{
CalculateListView (alignment);
@@ -610,8 +610,8 @@ namespace System.Windows.Forms {
int row_count = 7; // not including the today date
// set the date_cell_size and the title_size
date_cell_size = new Size ((int) Math.Ceiling (1.8 * multiplier), multiplier);
title_size = new Size ((date_cell_size.Width * column_count), 2 * multiplier);
date_cell_size = new Size ((int) Math.Ceiling (2.5 * multiplier), (int) Math.Ceiling (1.5 * multiplier));
title_size = new Size ((date_cell_size.Width * column_count), 3 * multiplier);
return new Size (column_count * date_cell_size.Width, row_count * date_cell_size.Height + title_size.Height);
}
@@ -65,30 +65,22 @@ namespace System.Windows.Forms
#region Private and Internal Methods
internal static NativeWindow FindWindow(IntPtr handle) {
NativeWindow rv;
lock (window_collection) {
rv = (NativeWindow)window_collection[handle];
}
return rv;
return (NativeWindow)window_collection[handle];
}
internal void InvalidateHandle() {
lock (window_collection) {
window_collection.Remove(window_handle);
}
window_collection.Remove(window_handle);
window_handle = IntPtr.Zero;
}
#endregion
#region Public Instance Methods
public void AssignHandle(IntPtr handle) {
lock (window_collection) {
if (window_handle != IntPtr.Zero) {
window_collection.Remove(window_handle);
}
window_handle=handle;
window_collection.Add(window_handle, this);
if (window_handle != IntPtr.Zero) {
window_collection.Remove(window_handle);
}
window_handle=handle;
window_collection.Add(window_handle, this);
OnHandleChange();
}
@@ -97,9 +89,7 @@ namespace System.Windows.Forms
window_handle=XplatUI.CreateWindow(create_params);
if (window_handle != IntPtr.Zero) {
lock (window_collection) {
window_collection.Add(window_handle, this);
}
window_collection.Add(window_handle, this);
}
}
}
@@ -115,9 +105,7 @@ namespace System.Windows.Forms
}
public virtual void ReleaseHandle() {
lock (window_collection) {
window_collection.Remove(window_handle);
}
window_collection.Remove(window_handle);
window_handle=IntPtr.Zero;
OnHandleChange();
}
@@ -146,9 +134,7 @@ namespace System.Windows.Forms
#if !ExternalExceptionHandler
try {
#endif
lock (window_collection) {
window = (NativeWindow)window_collection[hWnd];
}
window = (NativeWindow)window_collection[hWnd];
m.HWnd=hWnd;
m.Msg=(int)msg;
m.WParam=wParam;
@@ -36,7 +36,7 @@ using System.Reflection;
namespace System.Windows.Forms {
[DefaultProperty("Document")]
[Designer("System.ComponentModel.Design.ComponentDesigner, " + Consts.AssemblySystem_Design)]
[Designer("System.ComponentModel.Design.ComponentDesigner, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[DesignTimeVisible(true)]
[ToolboxItem(true)]
public class PrintPreviewDialog : Form {
@@ -328,7 +328,6 @@ namespace System.Windows.Forms {
set {
auto_scroll_min_size = value;
AutoScroll = true;
}
}
@@ -475,11 +474,7 @@ namespace System.Windows.Forms {
x += scroll_position.X;
y += scroll_position.Y;
// Don't scroll if already visible
if ((activeControl.Left >= scroll_position.X) && (activeControl.Left < (scroll_position.X + client_size.Width)) &&
(activeControl.Top >= scroll_position.Y) && (activeControl.Top < (scroll_position.Y + client_size.Height))) {
return;
}
// FIXME - Bail if the control is already visible?
// try to center
corner_x = Math.Max(0, x + activeControl.Width / 2 - client_size.Width / 2);
@@ -637,8 +632,8 @@ namespace System.Windows.Forms {
switch(child.Dock) {
case DockStyle.Left: {
if ((child.Right + extra_width) > width) {
width = child.Right + extra_width;
if ((child_controls[i].Right + extra_width) > width) {
width = child_controls[i].Right + extra_width;
}
continue;
}
@@ -662,8 +657,8 @@ namespace System.Windows.Forms {
anchor = child.Anchor;
if (((anchor & AnchorStyles.Left) != 0) && ((anchor & AnchorStyles.Right) == 0)) {
if ((child.Right + extra_width) > width) {
width = child.Right + extra_width;
if ((child_controls[i].Right + extra_width) > width) {
width = child_controls[i].Right + extra_width;
}
}
@@ -811,7 +806,7 @@ namespace System.Windows.Forms {
// Should we call XplatUI.ScrollWindow??? If so, we need to position our windows by other means above
// Since we're already causing a redraw above
Invalidate(false);
ResumeLayout(false);
ResumeLayout();
}
#endregion // Internal & Private Methods
@@ -432,8 +432,6 @@ namespace System.Windows.Forms {
set {
if (!read_only) {
document.ReplaceSelection(CaseAdjust(value));
document.SetSelectionStart(document.caret.line, document.caret.pos);
document.SetSelectionEnd(document.caret.line, document.caret.pos);
ScrollToCaret();
OnTextChanged(EventArgs.Empty);
}
@@ -2127,16 +2127,14 @@ if (owner.backcolor_set || (owner.Enabled && !owner.read_only)) {
UpdateView(line, insert_lines + 1, pos);
if (update_caret) {
if (update_caret && owner.IsHandleCreated) {
// Move caret to the end of the inserted text
if (insert_lines > 1) {
PositionCaret(GetLine(line.line_no + insert_lines - 1), ins[ins.Length - 1].Length);
} else {
PositionCaret(line, pos + ins[0].Length);
}
if (owner.IsHandleCreated) {
XplatUI.CaretVisible(owner.Handle, true);
}
XplatUI.CaretVisible(owner.Handle, true);
}
}
@@ -3590,7 +3588,7 @@ if (owner.backcolor_set || (owner.Enabled && !owner.read_only)) {
tag = line.tags;
// Adjust for alignment
x -= line.align_shift;
x += line.align_shift;
while (true) {
if (x >= tag.X && x < (tag.X+tag.width)) {
@@ -1541,11 +1541,7 @@ namespace System.Windows.Forms
{
bool details = control.View == View.Details;
if (control.Enabled)
dc.FillRectangle (GetControlBackBrush (control.BackColor), clip);
else
dc.FillRectangle (ResPool.GetSolidBrush (ColorControl), clip);
dc.FillRectangle (GetControlBackBrush (control.BackColor), clip);
int first = control.FirstVisibleIndex;
for (int i = first; i <= control.LastVisibleIndex; i ++) {
@@ -1751,8 +1747,6 @@ namespace System.Windows.Forms
if (item.Selected && control.Focused)
dc.FillRectangle (SystemBrushes.Highlight, highlight_rect);
else if (item.Selected && !control.HideSelection)
dc.FillRectangle (SystemBrushes.Control, highlight_rect);
else
dc.FillRectangle (ResPool.GetSolidBrush (item.BackColor), text_rect);
@@ -1807,20 +1801,12 @@ namespace System.Windows.Forms
sub_item_font = subItem.Font;
}
if (item.Selected && (control.Focused || !control.HideSelection) && control.FullRowSelect) {
Brush bg, text;
if (control.Focused) {
bg = SystemBrushes.Highlight;
text = SystemBrushes.HighlightText;
} else {
bg = SystemBrushes.Control;
text = sub_item_fore_br;
}
dc.FillRectangle (bg, sub_item_rect);
if (item.Selected && control.FullRowSelect) {
dc.FillRectangle (SystemBrushes.Highlight, sub_item_rect);
if (subItem.Text != null && subItem.Text.Length > 0)
dc.DrawString (subItem.Text, sub_item_font,
text, sub_item_text_rect, format);
SystemBrushes.HighlightText,
sub_item_text_rect, format);
} else {
dc.FillRectangle (sub_item_back_br, sub_item_rect);
if (subItem.Text != null && subItem.Text.Length > 0)
@@ -1829,20 +1815,6 @@ namespace System.Windows.Forms
sub_item_text_rect, format);
}
}
// Fill in selection for remaining columns if Column.Count > SubItems.Count
if (item.Selected && (control.Focused || !control.HideSelection) && control.FullRowSelect) {
for (int index = count; index < control.Columns.Count; index++)
{
col = control.Columns [index];
sub_item_rect.X = col.Rect.X - control.h_marker;
sub_item_rect.Width = col.Wd;
if (control.Focused)
dc.FillRectangle (SystemBrushes.Highlight, sub_item_rect);
else
dc.FillRectangle (SystemBrushes.Control, sub_item_rect);
}
}
}
}
@@ -48,7 +48,6 @@ namespace System.Windows.Forms {
private TreeViewAction selection_action = TreeViewAction.Unknown;
internal TreeNode selected_node = null;
private TreeNode focused_node = null;
private TreeNode highlighted_node;
private bool select_mmove = false;
private ImageList image_list;
@@ -350,7 +349,6 @@ namespace System.Windows.Forms {
if (value != null)
invalid = Rectangle.Union (invalid, Bloat (value.Bounds));
highlighted_node = value;
selected_node = value;
focused_node = value;
@@ -1222,25 +1220,16 @@ namespace System.Windows.Forms {
return (int) DeviceContext.MeasureString (node.Text, font, 0, string_format).Width + 3;
}
private bool ShowSelection {
get {
return Focused || !hide_selection;
}
}
private void DrawSelectionAndFocus(TreeNode node, Graphics dc, Rectangle r)
{
if (Focused && focused_node == node) {
ControlPaint.DrawFocusRectangle (dc, r, ForeColor, BackColor);
}
r.Inflate(-1, -1);
if (Focused && node == highlighted_node) {
if ((!HideSelection || Focused) && SelectedNode == node)
dc.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (ThemeEngine.Current.ColorHighlight), r);
} else if (!hide_selection && node == highlighted_node) {
dc.FillRectangle (SystemBrushes.Control, r);
} else {
else
dc.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (node.BackColor), r);
}
}
private void DrawStaticNode (TreeNode node, Graphics dc)
@@ -1251,7 +1240,7 @@ namespace System.Windows.Forms {
Font font = node.NodeFont;
if (node.NodeFont == null)
font = Font;
Color text_color = (Focused && node == highlighted_node ?
Color text_color = ((Focused || !HideSelection) && SelectedNode == node ?
ThemeEngine.Current.ColorHighlightText : node.ForeColor);
dc.DrawString (node.Text, font,
ThemeEngine.Current.ResPool.GetSolidBrush (text_color),
@@ -1529,9 +1518,6 @@ namespace System.Windows.Forms {
private void MouseDownHandler (object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
Focus ();
TreeNode node = GetNodeAt (e.Y);
if (node == null)
return;
@@ -1545,29 +1531,14 @@ namespace System.Windows.Forms {
UpdateNode(node);
return;
} else if (IsSelectableArea (node, e.X) || full_row_select) {
TreeNode old_highlighted = highlighted_node;
highlighted_node = node;
if (label_edit && e.Clicks == 1 && highlighted_node == old_highlighted) {
TreeNode old_selected = selected_node;
selection_action = TreeViewAction.ByMouse;
SelectedNode = node;
if (label_edit && e.Clicks == 1 && selected_node == old_selected) {
BeginEdit (node);
} else if (highlighted_node != focused_node) {
} else if (selected_node != focused_node) {
select_mmove = true;
}
Rectangle invalid;
/*
if (focused_node != null) {
invalid = Rectangle.Union (Bloat (focused_node.Bounds),
Bloat (highlighted_node.Bounds));
} else {
invalid = Bloat (highlighted_node.Bounds);
}
*/
if (old_highlighted != null)
invalid = Rectangle.Union (Bloat (old_highlighted.Bounds), highlighted_node.Bounds);
else
invalid = highlighted_node.Bounds;
Invalidate (invalid);
}
}
@@ -1576,14 +1547,11 @@ namespace System.Windows.Forms {
drag_begin_x = -1;
drag_begin_y = -1;
OnClick (EventArgs.Empty);
if (!select_mmove)
return;
if (e.Button == MouseButtons.Right) {
Invalidate (highlighted_node.Bounds);
highlighted_node = selected_node;
Invalidate (selected_node.Bounds);
}
select_mmove = false;
TreeViewCancelEventArgs ce = new TreeViewCancelEventArgs (selected_node, false, TreeViewAction.ByMouse);
@@ -1593,19 +1561,19 @@ namespace System.Windows.Forms {
if (!ce.Cancel) {
if (focused_node != null) {
invalid = Rectangle.Union (Bloat (focused_node.Bounds),
Bloat (highlighted_node.Bounds));
Bloat (selected_node.Bounds));
} else {
invalid = Bloat (highlighted_node.Bounds);
invalid = Bloat (selected_node.Bounds);
}
selected_node = highlighted_node;
focused_node = highlighted_node;
focused_node = selected_node;
OnAfterSelect (new TreeViewEventArgs (selected_node, TreeViewAction.ByMouse));
Invalidate (invalid);
} else {
highlighted_node = focused_node;
selected_node = focused_node;
}
}
private void MouseMoveHandler (object sender, MouseEventArgs e) {
@@ -1630,20 +1598,16 @@ namespace System.Windows.Forms {
}
}
// If there is movement before the mouse comes up,
// selection is reverted back to the originally selected node
if(!select_mmove)
return;
TreeNode node = GetNodeAtUseX (e.X,e.Y);
if(node == selected_node)
return;
Invalidate (highlighted_node.Bounds);
Invalidate (selected_node.Bounds);
Invalidate (focused_node.Bounds);
highlighted_node = selected_node;
focused_node = selected_node;
selected_node = focused_node;
select_mmove = false;
Invalidate (focused_node.Bounds);
Invalidate (selected_node.Bounds);
}
private void DoubleClickHandler (object sender, MouseEventArgs e) {
@@ -39,7 +39,6 @@ namespace System.Windows.Forms {
private PaintQueue paint; // Paint-only queue
internal ArrayList timer_list;
private Thread thread;
private bool quit_posted;
private static readonly int InitialXEventSize = 100;
private static readonly int InitialLXEventSize = 10;
@@ -51,7 +50,6 @@ namespace System.Windows.Forms {
paint = new PaintQueue(InitialPaintSize);
timer_list = new ArrayList ();
this.thread = thread;
this.quit_posted = false;
}
public int Count {
@@ -106,16 +104,6 @@ namespace System.Windows.Forms {
return xqueue.Peek();
}
public bool PostQuitState {
get {
return quit_posted;
}
set {
quit_posted = value;
}
}
public class PaintQueue {
private ArrayList hwnds;
@@ -85,6 +85,7 @@ namespace System.Windows.Forms {
private static IntPtr FosterParent; // Container to hold child windows until their parent exists
private static XErrorHandler ErrorHandler; // Error handler delegate
private static bool ErrorExceptions; // Throw exceptions on X errors
private static bool PostQuitState; // True if we've got an pending exit
// Clipboard
private static IntPtr ClipMagic = new IntPtr(27051977);
@@ -190,12 +191,6 @@ namespace System.Windows.Forms {
ErrorHandler = new XErrorHandler(HandleError);
XSetErrorHandler(ErrorHandler);
}
~XplatUIX11() {
// Remove our display handle from S.D
Graphics.FromHdcInternal (IntPtr.Zero);
}
#endregion // Constructors
#region Singleton Specific Code
@@ -404,6 +399,8 @@ namespace System.Windows.Forms {
Keyboard = new X11Keyboard(DisplayHandle, FosterParent);
Dnd = new X11Dnd (DisplayHandle);
PostQuitState = false;
DoubleClickInterval = 500;
HoverState.Interval = 500;
@@ -751,15 +748,6 @@ namespace System.Windows.Forms {
decorations = 0;
}
if ((cp.Style & (int)WindowStyles.WS_DLGFRAME) == (int)WindowStyles.WS_DLGFRAME) {
decorations ^= MotifDecorations.Menu;
}
if ((cp.Style & (int)(WindowStyles.WS_CAPTION | WindowStyles.WS_BORDER | WindowStyles.WS_DLGFRAME)) == 0) {
functions = 0;
decorations = 0;
}
if ((functions & MotifFunctions.Resize) == 0) {
hwnd.fixed_size = true;
XplatUI.SetWindowMinMax(hwnd.Handle, new Rectangle(cp.X, cp.Y, cp.Width, cp.Height), new Size(cp.Width, cp.Height), new Size(cp.Width, cp.Height));
@@ -2695,11 +2683,6 @@ namespace System.Windows.Forms {
ActiveWindow = IntPtr.Zero;
}
if (FocusWindow == handle) {
SendMessage(handle, Msg.WM_KILLFOCUS, IntPtr.Zero, IntPtr.Zero);
FocusWindow = IntPtr.Zero;
}
SendWMDestroyMessages(Control.ControlNativeWindow.ControlFromHandle(hwnd.Handle));
lock (XlibLock) {
@@ -2954,14 +2937,14 @@ namespace System.Windows.Forms {
} else if (((XEventQueue)queue_id).Paint.Count > 0) {
xevent = ((XEventQueue)queue_id).Paint.Dequeue();
} else {
if (!ThreadQueue(Thread.CurrentThread).PostQuitState) {
if (!PostQuitState) {
msg.hwnd= IntPtr.Zero;
msg.message = Msg.WM_ENTERIDLE;
return true;
}
// We reset ourselves so GetMessage can be called again
ThreadQueue(Thread.CurrentThread).PostQuitState = false;
PostQuitState = false;
return false;
}
@@ -3332,17 +3315,15 @@ namespace System.Windows.Forms {
}
case XEventName.ConfigureNotify: {
if (ThreadQueue(Thread.CurrentThread).PostQuitState|| !client && (xevent.ConfigureEvent.xevent == xevent.ConfigureEvent.window)) { // Ignore events for children (SubstructureNotify) and client areas
if (PostQuitState || !client && (xevent.ConfigureEvent.xevent == xevent.ConfigureEvent.window)) { // Ignore events for children (SubstructureNotify) and client areas
#if DriverDebugExtra
Console.WriteLine("GetMessage(): Window {0:X} ConfigureNotify x={1} y={2} width={3} height={4}", hwnd.client_window.ToInt32(), xevent.ConfigureEvent.x, xevent.ConfigureEvent.y, xevent.ConfigureEvent.width, xevent.ConfigureEvent.height);
#endif
// if ((hwnd.x != xevent.ConfigureEvent.x) || (hwnd.y != xevent.ConfigureEvent.y) || (hwnd.width != xevent.ConfigureEvent.width) || (hwnd.height != xevent.ConfigureEvent.height)) {
SendMessage(msg.hwnd, Msg.WM_WINDOWPOSCHANGED, IntPtr.Zero, IntPtr.Zero);
hwnd.configure_pending = false;
SendMessage(msg.hwnd, Msg.WM_WINDOWPOSCHANGED, IntPtr.Zero, IntPtr.Zero);
hwnd.configure_pending = false;
// We need to adjust our client window to track the resize of whole_window
PerformNCCalc(hwnd);
// }
// We need to adjust our client window to track the resize of whole_window
PerformNCCalc(hwnd);
}
goto ProcessNextMessage;
}
@@ -3376,7 +3357,7 @@ namespace System.Windows.Forms {
}
case XEventName.Expose: {
if (ThreadQueue(Thread.CurrentThread).PostQuitState || !hwnd.Mapped) {
if (PostQuitState || !hwnd.Mapped) {
if (client) {
hwnd.expose_pending = false;
} else {
@@ -3452,11 +3433,6 @@ namespace System.Windows.Forms {
ActiveWindow = IntPtr.Zero;
}
if (FocusWindow == hwnd.client_window) {
SendMessage(hwnd.client_window, Msg.WM_KILLFOCUS, IntPtr.Zero, IntPtr.Zero);
FocusWindow = IntPtr.Zero;
}
if (Caret.Window == hwnd.client_window) {
DestroyCaretInternal();
}
@@ -3514,6 +3490,7 @@ namespace System.Windows.Forms {
if (xevent.ClientMessageEvent.message_type == NetAtoms[(int)NA.WM_PROTOCOLS]) {
if (xevent.ClientMessageEvent.ptr1 == NetAtoms[(int)NA.WM_DELETE_WINDOW]) {
msg.message = Msg.WM_CLOSE;
Graphics.FromHdcInternal (IntPtr.Zero);
return true;
}
@@ -3889,9 +3866,11 @@ namespace System.Windows.Forms {
}
internal override void PostQuitMessage(int exitCode) {
XFlush(DisplayHandle);
ThreadQueue(Thread.CurrentThread).PostQuitState = true;
PostQuitState = true;
// Remove our display handle from S.D
Graphics.FromHdcInternal (IntPtr.Zero);
}
internal override void RequestNCRecalc(IntPtr handle) {
@@ -4054,11 +4033,11 @@ namespace System.Windows.Forms {
Hwnd hwnd;
XEvent xevent = new XEvent ();
hwnd = Hwnd.ObjectFromHandle(method.Handle);
hwnd = Hwnd.ObjectFromHandle(FosterParent);
xevent.type = XEventName.ClientMessage;
xevent.ClientMessageEvent.display = DisplayHandle;
xevent.ClientMessageEvent.window = method.Handle;
xevent.ClientMessageEvent.window = FosterParent;
xevent.ClientMessageEvent.message_type = (IntPtr)AsyncAtom;
xevent.ClientMessageEvent.format = 32;
xevent.ClientMessageEvent.ptr1 = (IntPtr) GCHandle.Alloc (method);
@@ -4148,7 +4127,6 @@ namespace System.Windows.Forms {
} else {
XUndefineCursor(DisplayHandle, hwnd.whole_window);
}
XFlush(DisplayHandle);
}
return;
}
@@ -4393,12 +4371,6 @@ namespace System.Windows.Forms {
}
if (!hwnd.zero_sized) {
//Hack?
hwnd.x = x;
hwnd.y = y;
hwnd.width = width;
hwnd.height = height;
SendMessage(hwnd.client_window, Msg.WM_WINDOWPOSCHANGED, IntPtr.Zero, IntPtr.Zero);
if (hwnd.fixed_size) {
SetWindowMinMax(handle, Rectangle.Empty, new Size(width, height), new Size(width, height));
@@ -44,7 +44,7 @@ namespace System.Configuration {
| AttributeTargets.Method,
AllowMultiple=true,
Inherited=false)]
public sealed class ConfigurationPermissionAttribute : CodeAccessSecurityAttribute
public sealed class ConfigurationPermissionAttribute : CodeAccessSecurityAttribute, _Attribute
{
public ConfigurationPermissionAttribute (SecurityAction action)
: base (action)
@@ -166,7 +166,7 @@ namespace System.Configuration
public virtual Stream OpenStreamForRead (string streamName)
{
#if TARGET_JVM
if (String.CompareOrdinal (streamName, "/machine.config") == 0)
if (String.CompareOrdinal (streamName, "/machine.config"))
return (Stream) vmw.common.IOUtils.getStreamForGHConfigs (streamName);
#endif
if (!File.Exists (streamName))
@@ -97,10 +97,6 @@ namespace System.Data.OracleClient {
return base.Contains (value);
}
public void CopyTo (OracleParameter [] array, int index) {
base.CopyTo (array, index);
}
public void Insert (int index, OracleParameter value) {
base.Insert (index, value);
}
@@ -110,7 +106,7 @@ namespace System.Data.OracleClient {
}
#endif
#endregion // Methods
#endregion // Methods
}
}
@@ -108,11 +108,6 @@ namespace System.Data.OleDb
return base.Contains (value);
}
public void CopyTo (OleDbParameter [] array, int index)
{
base.CopyTo (array, index);
}
public void Insert (int index, OleDbParameter value)
{
base.Insert (index, value);
@@ -106,11 +106,6 @@ namespace System.Data.SqlClient
return base.Contains (value);
}
public void CopyTo (SqlParameter [] array, int index)
{
base.CopyTo (array, index);
}
public void Insert (int index, SqlParameter value)
{
base.Insert (index, value);
@@ -1,7 +1,3 @@
2006-08-30 Nagappan A <[email protected]>
* SqlConnection.cs: Implemented SqlConnection.GetSchema ().
2006-09-08 Konstantin Triger <[email protected]>
* SqlClientFactory.cs: implemented SqlClientFactory.CreateConnection ().
@@ -963,589 +963,6 @@ namespace System.Data.SqlClient {
}
}
#if NET_2_0
struct ColumnInfo {
public string name;
public Type type;
public ColumnInfo (string name, Type type)
{
this.name = name; this.type = type;
}
}
static class ReservedWords
{
static readonly string [] reservedWords =
{
"ADD", "EXCEPT", "PERCENT", "ALL", "EXEC", "PLAN", "ALTER",
"EXECUTE", "PRECISION", "AND", "EXISTS", "PRIMARY", "ANY",
"EXIT", "PRINT", "AS", "FETCH", "PROC", "ASC", "FILE",
"PROCEDURE", "AUTHORIZATION", "FILLFACTOR", "PUBLIC",
"BACKUP", "FOR", "RAISERROR", "BEGIN", "FOREIGN", "READ",
"BETWEEN", "FREETEXT", "READTEXT", "BREAK", "FREETEXTTABLE",
"RECONFIGURE", "BROWSE", "FROM", "REFERENCES", "BULK",
"FULL", "REPLICATION", "BY", "FUNCTION", "RESTORE",
"CASCADE", "GOTO", "RESTRICT", "CASE", "GRANT", "RETURN",
"CHECK", "GROUP", "REVOKE", "CHECKPOINT", "HAVING", "RIGHT",
"CLOSE", "HOLDLOCK", "ROLLBACK", "CLUSTERED", "IDENTITY",
"ROWCOUNT", "COALESCE", "IDENTITY_INSERT", "ROWGUIDCOL",
"COLLATE", "IDENTITYCOL", "RULE", "COLUMN", "IF", "SAVE",
"COMMIT", "IN", "SCHEMA", "COMPUTE", "INDEX", "SELECT",
"CONSTRAINT", "INNER", "SESSION_USER", "CONTAINS", "INSERT",
"SET", "CONTAINSTABLE", "INTERSECT", "SETUSER", "CONTINUE",
"INTO", "SHUTDOWN", "CONVERT", "IS", "SOME", "CREATE",
"JOIN", "STATISTICS", "CROSS", "KEY", "SYSTEM_USER",
"CURRENT", "KILL", "TABLE", "CURRENT_DATE", "LEFT",
"TEXTSIZE", "CURRENT_TIME", "LIKE", "THEN",
"CURRENT_TIMESTAMP", "LINENO", "TO", "CURRENT_USER", "LOAD",
"TOP", "CURSOR", "NATIONAL", "TRAN", "DATABASE", "NOCHECK",
"TRANSACTION", "DBCC", "NONCLUSTERED", "TRIGGER",
"DEALLOCATE", "NOT", "TRUNCATE", "DECLARE", "NULL",
"TSEQUAL", "DEFAULT", "NULLIF", "UNION", "DELETE", "OF",
"UNIQUE", "DENY", "OFF", "UPDATE", "DESC", "OFFSETS",
"UPDATETEXT", "DISK", "ON", "USE", "DISTINCT", "OPEN",
"USER", "DISTRIBUTED", "OPENDATASOURCE", "VALUES", "DOUBLE",
"OPENQUERY", "VARYING", "DROP", "OPENROWSET", "VIEW",
"DUMMY", "OPENXML", "WAITFOR", "DUMP", "OPTION", "WHEN",
"ELSE", "OR", "WHERE", "END", "ORDER", "WHILE", "ERRLVL",
"OUTER", "WITH", "ESCAPE", "OVER", "WRITETEXT", "ABSOLUTE",
"FOUND", "PRESERVE", "ACTION", "FREE", "PRIOR", "ADMIN",
"GENERAL", "PRIVILEGES", "AFTER", "GET", "READS",
"AGGREGATE", "GLOBAL", "REAL", "ALIAS", "GO", "RECURSIVE",
"ALLOCATE", "GROUPING", "REF", "ARE", "HOST", "REFERENCING",
"ARRAY", "HOUR", "RELATIVE", "ASSERTION", "IGNORE", "RESULT",
"AT", "IMMEDIATE", "RETURNS", "BEFORE", "INDICATOR", "ROLE",
"BINARY", "INITIALIZE", "ROLLUP", "BIT", "INITIALLY",
"ROUTINE", "BLOB", "INOUT", "ROW", "BOOLEAN", "INPUT",
"ROWS", "BOTH", "INT", "SAVEPOINT", "BREADTH", "INTEGER",
"SCROLL", "CALL", "INTERVAL", "SCOPE", "CASCADED",
"ISOLATION", "SEARCH", "CAST", "ITERATE", "SECOND",
"CATALOG", "LANGUAGE", "SECTION", "CHAR", "LARGE",
"SEQUENCE", "CHARACTER", "LAST", "SESSION", "CLASS",
"LATERAL", "SETS", "CLOB", "LEADING", "SIZE", "COLLATION",
"LESS", "SMALLINT", "COMPLETION", "LEVEL", "SPACE",
"CONNECT", "LIMIT", "SPECIFIC", "CONNECTION", "LOCAL",
"SPECIFICTYPE", "CONSTRAINTS", "LOCALTIME", "SQL",
"CONSTRUCTOR", "LOCALTIMESTAMP", "SQLEXCEPTION",
"CORRESPONDING", "LOCATOR", "SQLSTATE", "CUBE", "MAP",
"SQLWARNING", "CURRENT_PATH", "MATCH", "START",
"CURRENT_ROLE", "MINUTE", "STATE", "CYCLE", "MODIFIES",
"STATEMENT", "DATA", "MODIFY", "STATIC", "DATE", "MODULE",
"STRUCTURE", "DAY", "MONTH", "TEMPORARY", "DEC", "NAMES",
"TERMINATE", "DECIMAL", "NATURAL", "THAN", "DEFERRABLE",
"NCHAR", "TIME", "DEFERRED", "NCLOB", "TIMESTAMP", "DEPTH",
"NEW", "TIMEZONE_HOUR", "DEREF", "NEXT", "TIMEZONE_MINUTE",
"DESCRIBE", "NO", "TRAILING", "DESCRIPTOR", "NONE",
"TRANSLATION", "DESTROY", "NUMERIC", "TREAT", "DESTRUCTOR",
"OBJECT", "TRUE", "DETERMINISTIC", "OLD", "UNDER",
"DICTIONARY", "ONLY", "UNKNOWN", "DIAGNOSTICS", "OPERATION",
"UNNEST", "DISCONNECT", "ORDINALITY", "USAGE", "DOMAIN",
"OUT", "USING", "DYNAMIC", "OUTPUT", "VALUE", "EACH",
"PAD", "VARCHAR", "END-EXEC", "PARAMETER", "VARIABLE",
"EQUALS", "PARAMETERS", "WHENEVER", "EVERY", "PARTIAL",
"WITHOUT", "EXCEPTION", "PATH", "WORK", "EXTERNAL",
"POSTFIX", "WRITE", "FALSE", "PREFIX", "YEAR", "FIRST",
"PREORDER", "ZONE", "FLOAT", "PREPARE", "ADA", "AVG",
"BIT_LENGTH", "CHAR_LENGTH", "CHARACTER_LENGTH", "COUNT",
"EXTRACT", "FORTRAN", "INCLUDE", "INSENSITIVE", "LOWER",
"MAX", "MIN", "OCTET_LENGTH", "OVERLAPS", "PASCAL",
"POSITION", "SQLCA", "SQLCODE", "SQLERROR", "SUBSTRING",
"SUM", "TRANSLATE", "TRIM", "UPPER"
};
static DataTable instance;
static public DataTable Instance {
get {
if (instance == null) {
DataRow row = null;
instance = new DataTable ("ReservedWords");
instance.Columns.Add ("ReservedWord", typeof(string));
foreach (string reservedWord in reservedWords)
{
row = instance.NewRow();
row["ReservedWord"] = reservedWord;
instance.Rows.Add(row);
}
}
return instance;
}
}
}
static class MetaDataCollections
{
static readonly ColumnInfo [] columns = {
new ColumnInfo ("CollectionName", typeof (string)),
new ColumnInfo ("NumberOfRestrictions", typeof (int)),
new ColumnInfo ("NumberOfIdentifierParts", typeof (int))
};
static readonly object [][] rows = {
new object [] {"MetaDataCollections", 0, 0},
new object [] {"DataSourceInformation", 0, 0},
new object [] {"DataTypes", 0, 0},
new object [] {"Restrictions", 0, 0},
new object [] {"ReservedWords", 0, 0},
new object [] {"Users", 1, 1},
new object [] {"Databases", 1, 1},
new object [] {"Tables", 4, 3},
new object [] {"Columns", 4, 4},
new object [] {"Views", 3, 3},
new object [] {"ViewColumns", 4, 4},
new object [] {"ProcedureParameters", 4, 1},
new object [] {"Procedures", 4, 3},
new object [] {"ForeignKeys", 4, 3},
new object [] {"IndexColumns", 5, 4},
new object [] {"Indexes", 4, 3},
new object [] {"UserDefinedTypes", 2, 1}
};
static DataTable instance;
static public DataTable Instance {
get {
if (instance == null) {
instance = new DataTable ("GetSchema");
foreach (ColumnInfo c in columns)
instance.Columns.Add (c.name, c.type);
foreach (object [] row in rows)
instance.LoadDataRow (row, true);
}
return instance;
}
}
}
static class DataTypes
{
static readonly ColumnInfo [] columns = {
new ColumnInfo ("TypeName", typeof(string)),
new ColumnInfo ("ProviderDbType", typeof(int)),
new ColumnInfo ("ColumnSize", typeof(long)),
new ColumnInfo ("CreateFormat", typeof(string)),
new ColumnInfo ("CreateParameters", typeof(string)),
new ColumnInfo ("DataType", typeof(string)),
new ColumnInfo ("IsAutoIncrementable", typeof(bool)),
new ColumnInfo ("IsBestMatch", typeof(bool)),
new ColumnInfo ("IsCaseSensitive", typeof(bool)),
new ColumnInfo ("IsFixedLength", typeof(bool)),
new ColumnInfo ("IsFixedPrecisionScale", typeof(bool)),
new ColumnInfo ("IsLong", typeof(bool)),
new ColumnInfo ("IsNullable", typeof(bool)),
new ColumnInfo ("IsSearchable", typeof(bool)),
new ColumnInfo ("IsSearchableWithLike", typeof(bool)),
new ColumnInfo ("IsUnsigned", typeof(bool)),
new ColumnInfo ("MaximumScale", typeof(short)),
new ColumnInfo ("MinimumScale", typeof(short)),
new ColumnInfo ("IsConcurrencyType", typeof(bool)),
new ColumnInfo ("IsLiteralSupported", typeof(bool)),
new ColumnInfo ("LiteralPrefix", typeof(string)),
new ColumnInfo ("LiteralSuffix", typeof(string))
};
static readonly object [][] rows = {
new object [] {"smallint", 16, 5, "smallint", null, "System.Int16", true, true,
false, true, true, false, true, true, false, false, null,
null, false, null, null, null},
new object [] {"int", 8, 10, "int", null, "System.Int32",
true, true, false, true, true, false, true, true, false,
false, null, null, false, null, null, null},
new object [] {"real", 13, 7, "real", null,
"System.Single", false, true, false, true, false, false,
true, true, false, false, null, null, false, null, null, null},
new object [] {"float", 6, 53, "float({0})",
"number of bits used to store the mantissa", "System.Double",
false, true, false, true, false, false, true, true,
false, false, null, null, false, null, null, null},
new object [] {"money", 9, 19, "money", null,
"System.Decimal", false, false, false, true, true,
false, true, true, false, false, null, null, false,
null, null, null},
new object [] {"smallmoney", 17, 10, "smallmoney", null,
"System.Decimal", false, false, false, true, true, false,
true, true, false, false, null, null, false, null, null, null},
new object [] {"bit", 2, 1, "bit", null, "System.Boolean",
false, false, false, true, false, false, true, true,
false, null, null, null, false, null, null, null},
new object [] {"tinyint", 20, 3, "tinyint", null,
"System.SByte", true, true, false, true, true, false,
true, true, false, true, null, null, false, null, null, null},
new object [] {"bigint", 0, 19, "bigint", null,
"System.Int64", true, true, false, true, true, false,
true, true, false, false, null, null, false, null, null, null},
new object [] {"timestamp", 19, 8, "timestamp", null,
"System.Byte[]", false, false, false, true, false, false,
false, true, false, null, null, null, true, null, "0x", null},
new object [] {"binary", 1, 8000, "binary({0})", "length",
"System.Byte[]", false, true, false, true, false, false,
true, true, false, null, null, null, false, null, "0x", null},
new object [] {"image", 7, 2147483647, "image", null,
"System.Byte[]", false, true, false, false, false, true,
true, false, false, null, null, null, false, null, "0x", null},
new object [] {"text", 18, 2147483647, "text", null,
"System.String", false, true, false, false, false, true,
true, false, true, null, null, null, false, null, "'", "'"},
new object [] {"ntext", 11, 1073741823, "ntext", null,
"System.String", false, true, false, false, false, true,
true, false, true, null, null, null, false, null, "N'", "'"},
new object [] {"decimal", 5, 38, "decimal({0}, {1})",
"precision,scale", "System.Decimal", true, true, false,
true, false, false, true, true, false, false, 38, 0,
false, null, null, null},
new object [] {"numeric", 5, 38, "numeric({0}, {1})",
"precision,scale", "System.Decimal", true, true, false,
true, false, false, true, true, false, false, 38, 0,
false, null, null, null},
new object [] {"datetime", 4, 23, "datetime", null,
"System.DateTime", false, true, false, true, false, false,
true, true, true, null, null, null, false, null, "{ts '", "'}"},
new object [] {"smalldatetime", 15, 16, "smalldatetime", null,
"System.DateTime", false, true, false, true, false, false,
true, true, true, null, null, null, false, null, "{ts '", "'}"},
new object [] {"sql_variant", 23, null, "sql_variant",
null, "System.Object", false, true, false, false, false,
false, true, true, false, null, null, null, false, false,
null, null},
new object [] {"xml", 25, 2147483647, "xml", null,
"System.String", false, false, false, false, false, true,
true, false, false, null, null, null, false, false, null, null},
new object [] {"varchar", 22, 2147483647, "varchar({0})",
"max length", "System.String", false, true, false, false,
false, false, true, true, true, null, null, null, false,
null, "'", "'"},
new object [] {"char", 3, 2147483647, "char({0})", "length",
"System.String", false, true, false, true, false, false,
true, true, true, null, null, null, false, null, "'", "'"},
new object [] {"nchar", 10, 1073741823, "nchar({0})", "length",
"System.String", false, true, false, true, false, false,
true, true, true, null, null, null, false, null, "N'", "'"},
new object [] {"nvarchar", 12, 1073741823, "nvarchar({0})", "max length",
"System.String", false, true, false, false, false, false, true, true,
true, null, null, null, false, null, "N'", "'"},
new object [] {"varbinary", 21, 1073741823, "varbinary({0})",
"max length", "System.Byte[]", false, true, false, false,
false, false, true, true, false, null, null, null, false,
null, "0x", null},
new object [] {"uniqueidentifier", 14, 16, "uniqueidentifier", null,
"System.Guid", false, true, false, true, false, false, true,
true, false, null, null, null, false, null, "'", "'"}
};
static DataTable instance;
static public DataTable Instance {
get {
if (instance == null) {
instance = new DataTable ("DataTypes");
foreach (ColumnInfo c in columns)
instance.Columns.Add (c.name, c.type);
foreach (object [] row in rows)
instance.LoadDataRow (row, true);
}
return instance;
}
}
}
static class Restrictions
{
static readonly ColumnInfo [] columns = {
new ColumnInfo ("CollectionName", typeof (string)),
new ColumnInfo ("RestrictionName", typeof(string)),
new ColumnInfo ("ParameterName", typeof(string)),
new ColumnInfo ("RestrictionDefault", typeof(string)),
new ColumnInfo ("RestrictionNumber", typeof(int))
};
static readonly object [][] rows = {
new object [] {"Users", "User_Name", "@Name", "name", 1},
new object [] {"Databases", "Name", "@Name", "Name", 1},
new object [] {"Tables", "Catalog", "@Catalog", "TABLE_CATALOG", 1},
new object [] {"Tables", "Owner", "@Owner", "TABLE_SCHEMA", 2},
new object [] {"Tables", "Table", "@Name", "TABLE_NAME", 3},
new object [] {"Tables", "TableType", "@TableType", "TABLE_TYPE", 4},
new object [] {"Columns", "Catalog", "@Catalog", "TABLE_CATALOG", 1},
new object [] {"Columns", "Owner", "@Owner", "TABLE_SCHEMA", 2},
new object [] {"Columns", "Table", "@Table", "TABLE_NAME", 3},
new object [] {"Columns", "Column", "@Column", "COLUMN_NAME", 4},
new object [] {"Views", "Catalog", "@Catalog", "TABLE_CATALOG", 1},
new object [] {"Views", "Owner", "@Owner", "TABLE_SCHEMA", 2},
new object [] {"Views", "Table", "@Table", "TABLE_NAME", 3},
new object [] {"ViewColumns", "Catalog", "@Catalog", "VIEW_CATALOG", 1},
new object [] {"ViewColumns", "Owner", "@Owner", "VIEW_SCHEMA", 2},
new object [] {"ViewColumns", "Table", "@Table", "VIEW_NAME", 3},
new object [] {"ViewColumns", "Column", "@Column", "COLUMN_NAME", 4},
new object [] {"ProcedureParameters", "Catalog", "@Catalog", "SPECIFIC_CATALOG", 1},
new object [] {"ProcedureParameters", "Owner", "@Owner", "SPECIFIC_SCHEMA", 2},
new object [] {"ProcedureParameters", "Name", "@Name", "SPECIFIC_NAME", 3},
new object [] {"ProcedureParameters", "Parameter", "@Parameter", "PARAMETER_NAME", 4},
new object [] {"Procedures", "Catalog", "@Catalog", "SPECIFIC_CATALOG", 1},
new object [] {"Procedures", "Owner", "@Owner", "SPECIFIC_SCHEMA", 2},
new object [] {"Procedures", "Name", "@Name", "SPECIFIC_NAME", 3},
new object [] {"Procedures", "Type", "@Type", "ROUTINE_TYPE", 4},
new object [] {"IndexColumns", "Catalog", "@Catalog", "db_name(}", 1},
new object [] {"IndexColumns", "Owner", "@Owner", "user_name(}", 2},
new object [] {"IndexColumns", "Table", "@Table", "o.name", 3},
new object [] {"IndexColumns", "ConstraintName", "@ConstraintName", "x.name", 4},
new object [] {"IndexColumns", "Column", "@Column", "c.name", 5},
new object [] {"Indexes", "Catalog", "@Catalog", "db_name(}", 1},
new object [] {"Indexes", "Owner", "@Owner", "user_name(}", 2},
new object [] {"Indexes", "Table", "@Table", "o.name", 3},
new object [] {"Indexes", "Name", "@Name", "x.name", 4},
new object [] {"UserDefinedTypes", "assembly_name", "@AssemblyName", "assemblies.name", 1},
new object [] {"UserDefinedTypes", "udt_name", "@UDTName", "types.assembly_class", 2},
new object [] {"ForeignKeys", "Catalog", "@Catalog", "CONSTRAINT_CATALOG", 1},
new object [] {"ForeignKeys", "Owner", "@Owner", "CONSTRAINT_SCHEMA", 2},
new object [] {"ForeignKeys", "Table", "@Table", "TABLE_NAME", 3},
new object [] {"ForeignKeys", "Name", "@Name", "CONSTRAINT_NAME", 4}
};
static DataTable instance;
static public DataTable Instance {
get {
if (instance == null) {
instance = new DataTable ("Restrictions");
foreach (ColumnInfo c in columns)
instance.Columns.Add (c.name, c.type);
foreach (object [] row in rows)
instance.LoadDataRow (row, true);
}
return instance;
}
}
}
public override DataTable GetSchema ()
{
return MetaDataCollections.Instance;
}
public override DataTable GetSchema (String collectionName)
{
return GetSchema (collectionName, null);
}
public override DataTable GetSchema (String collectionName, string [] restrictionValues)
{
if (collectionName == null)
//LAMESPEC: In MS.NET, if collectionName is null, it throws ArgumentException.
throw new ArgumentException ();
String cName = null;
DataTable schemaTable = MetaDataCollections.Instance;
int length = restrictionValues == null ? 0 : restrictionValues.Length;
foreach (DataRow row in schemaTable.Rows) {
if (String.Compare ((string) row["CollectionName"], collectionName, true) == 0) {
if (length > (int) row["NumberOfRestrictions"]) {
throw new ArgumentException ("More restrictions were provided " +
"than the requested schema ('" +
row["CollectionName"].ToString () + "') supports");
}
cName = row["CollectionName"].ToString();
}
}
if (cName == null)
throw new ArgumentException ("The requested collection ('" + collectionName + "') is not defined.");
SqlCommand command = null;
DataTable dataTable = new DataTable ();
SqlDataAdapter dataAdapter = new SqlDataAdapter ();
switch (cName)
{
case "Databases":
command = new SqlCommand ("select name as database_name, dbid, crdate as create_date " +
"from master.sys.sysdatabases where (name = @Name or (@Name " +
"is null))", this);
command.Parameters.Add ("@Name", SqlDbType.NVarChar, 4000);
break;
case "ForeignKeys":
command = new SqlCommand ("select CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, " +
"TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_TYPE, " +
"IS_DEFERRABLE, INITIALLY_DEFERRED from " +
"INFORMATION_SCHEMA.TABLE_CONSTRAINTS where (CONSTRAINT_CATALOG" +
" = @Catalog or (@Catalog is null)) and (CONSTRAINT_SCHEMA = " +
"@Owner or (@Owner is null)) and (TABLE_NAME = @Table or (" +
"@Table is null)) and (CONSTRAINT_NAME = @Name or (@Name is null))" +
" and CONSTRAINT_TYPE = 'FOREIGN KEY' order by CONSTRAINT_CATALOG," +
" CONSTRAINT_SCHEMA, CONSTRAINT_NAME", this);
command.Parameters.Add ("@Catalog", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Owner", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Table", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Name", SqlDbType.NVarChar, 4000);
break;
case "Indexes":
command = new SqlCommand ("select distinct db_name() as constraint_catalog, " +
"constraint_schema = user_name (o.uid), " +
"constraint_name = x.name, table_catalog = db_name (), " +
"table_schema = user_name (o.uid), table_name = o.name, " +
"index_name = x.name from sysobjects o, sysindexes x, " +
"sysindexkeys xk where o.type in ('U') and x.id = o.id and " +
"o.id = xk.id and x.indid = xk.indid and xk.keyno = x.keycnt " +
"and (db_name() = @Catalog or (@Catalog is null)) and " +
"(user_name() = @Owner or (@Owner is null)) and (o.name = " +
"@Table or (@Table is null)) and (x.name = @Name or (@Name is null))" +
"order by table_name, index_name", this);
command.Parameters.Add ("@Catalog", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Owner", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Table", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Name", SqlDbType.NVarChar, 4000);
break;
case "IndexColumns":
command = new SqlCommand ("select distinct db_name() as constraint_catalog, " +
"constraint_schema = user_name (o.uid), constraint_name = x.name, " +
"table_catalog = db_name (), table_schema = user_name (o.uid), " +
"table_name = o.name, column_name = c.name, " +
"ordinal_position = convert (int, xk.keyno), keyType = c.xtype, " +
"index_name = x.name from sysobjects o, sysindexes x, syscolumns c, " +
"sysindexkeys xk where o.type in ('U') and x.id = o.id and o.id = c.id " +
"and o.id = xk.id and x.indid = xk.indid and c.colid = xk.colid " +
"and xk.keyno <= x.keycnt and permissions (o.id, c.name) <> 0 " +
"and (db_name() = @Catalog or (@Catalog is null)) and (user_name() " +
"= @Owner or (@Owner is null)) and (o.name = @Table or (@Table is" +
" null)) and (x.name = @ConstraintName or (@ConstraintName is null)) " +
"and (c.name = @Column or (@Column is null)) order by table_name, " +
"index_name", this);
command.Parameters.Add ("@Catalog", SqlDbType.NVarChar, 8);
command.Parameters.Add ("@Owner", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Table", SqlDbType.NVarChar, 13);
command.Parameters.Add ("@ConstraintName", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Column", SqlDbType.NVarChar, 4000);
break;
case "Procedures":
command = new SqlCommand ("select SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME, " +
"ROUTINE_CATALOG, ROUTINE_SCHEMA, ROUTINE_NAME, ROUTINE_TYPE, " +
"CREATED, LAST_ALTERED from INFORMATION_SCHEMA.ROUTINES where " +
"(SPECIFIC_CATALOG = @Catalog or (@Catalog is null)) and " +
"(SPECIFIC_SCHEMA = @Owner or (@Owner is null)) and (SPECIFIC_NAME" +
" = @Name or (@Name is null)) and (ROUTINE_TYPE = @Type or (@Type " +
"is null)) order by SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME", this);
command.Parameters.Add ("@Catalog", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Owner", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Name", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Type", SqlDbType.NVarChar, 4000);
break;
case "ProcedureParameters":
command = new SqlCommand ("select SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME, " +
"ORDINAL_POSITION, PARAMETER_MODE, IS_RESULT, AS_LOCATOR, " +
"PARAMETER_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, " +
"CHARACTER_OCTET_LENGTH, COLLATION_CATALOG, COLLATION_SCHEMA, " +
"COLLATION_NAME, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, " +
"CHARACTER_SET_NAME, NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, " +
"NUMERIC_SCALE, DATETIME_PRECISION, INTERVAL_TYPE, " +
"INTERVAL_PRECISION from INFORMATION_SCHEMA.PARAMETERS where " +
"(SPECIFIC_CATALOG = @Catalog or (@Catalog is null)) and " +
"(SPECIFIC_SCHEMA = @Owner or (@Owner is null)) and (SPECIFIC_NAME = " +
"@Name or (@Name is null)) and (PARAMETER_NAME = @Parameter or (" +
"@Parameter is null)) order by SPECIFIC_CATALOG, SPECIFIC_SCHEMA," +
" SPECIFIC_NAME, PARAMETER_NAME", this);
command.Parameters.Add ("@Catalog", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Owner", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Name", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Parameter", SqlDbType.NVarChar, 4000);
break;
case "Tables":
command = new SqlCommand ("select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE " +
"from INFORMATION_SCHEMA.TABLES where" +
" (TABLE_CATALOG = @catalog or (@catalog is null)) and " +
"(TABLE_SCHEMA = @owner or (@owner is null))and " +
"(TABLE_NAME = @name or (@name is null)) and " +
"(TABLE_TYPE = @table_type or (@table_type is null))", this);
command.Parameters.Add ("@catalog", SqlDbType.NVarChar, 8);
command.Parameters.Add ("@owner", SqlDbType.NVarChar, 3);
command.Parameters.Add ("@name", SqlDbType.NVarChar, 11);
command.Parameters.Add ("@table_type", SqlDbType.NVarChar, 10);
break;
case "Columns":
command = new SqlCommand ("select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, " +
"ORDINAL_POSITION, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, " +
"CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH, " +
"NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, NUMERIC_SCALE, " +
"DATETIME_PRECISION, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, " +
"CHARACTER_SET_NAME, COLLATION_CATALOG from INFORMATION_SCHEMA.COLUMNS" +
" where (TABLE_CATALOG = @Catalog or (@Catalog is null)) and (" +
"TABLE_SCHEMA = @Owner or (@Owner is null)) and (TABLE_NAME = @table" +
" or (@Table is null)) and (COLUMN_NAME = @column or (@Column is null" +
")) order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME", this);
command.Parameters.Add ("@Catalog", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Owner", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Table", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Column", SqlDbType.NVarChar, 4000);
break;
case "Users":
command = new SqlCommand ("select uid, name as user_name, createdate, updatedate from sysusers" +
" where (name = @Name or (@Name is null))", this);
command.Parameters.Add ("@Name", SqlDbType.NVarChar, 4000);
break;
case "Views":
command = new SqlCommand ("select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, CHECK_OPTION, " +
"IS_UPDATABLE from INFORMATION_SCHEMA.VIEWS where (TABLE_CATALOG" +
" = @Catalog or (@Catalog is null)) TABLE_SCHEMA = @Owner or " +
"(@Owner is null)) and (TABLE_NAME = @table or (@Table is null))" +
" order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME", this);
command.Parameters.Add ("@Catalog", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Owner", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Table", SqlDbType.NVarChar, 4000);
break;
case "ViewColumns":
command = new SqlCommand ("select VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME, TABLE_CATALOG, " +
"TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME from " +
"INFORMATION_SCHEMA.VIEW_COLUMN_USAGE where (VIEW_CATALOG = " +
"@Catalog (@Catalog is null)) and (VIEW_SCHEMA = @Owner (@Owner" +
" is null)) and (VIEW_NAME = @Table or (@Table is null)) and " +
"(COLUMN_NAME = @Column or (@Column is null)) order by " +
"VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME", this);
command.Parameters.Add ("@Catalog", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Owner", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Table", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@Column", SqlDbType.NVarChar, 4000);
break;
case "UserDefinedTypes":
command = new SqlCommand ("select assemblies.name as assembly_name, types.assembly_class " +
"as udt_name, ASSEMBLYPROPERTY(assemblies.name, 'VersionMajor') " +
"as version_major, ASSEMBLYPROPERTY(assemblies.name, 'VersionMinor') " +
"as version_minor, ASSEMBLYPROPERTY(assemblies.name, 'VersionBuild') " +
"as version_build, ASSEMBLYPROPERTY(assemblies.name, 'VersionRevision') " +
"as version_revision, ASSEMBLYPROPERTY(assemblies.name, 'CultureInfo') " +
"as culture_info, ASSEMBLYPROPERTY(assemblies.name, 'PublicKey') " +
"as public_key, is_fixed_length, max_length, Create_Date, " +
"Permission_set_desc from sys.assemblies as assemblies join " +
"sys.assembly_types as types on assemblies.assembly_id = types.assembly_id" +
" where (assemblies.name = @AssemblyName or (@AssemblyName is null)) and " +
"(types.assembly_class = @UDTName or (@UDTName is null))",
this);
command.Parameters.Add ("@AssemblyName", SqlDbType.NVarChar, 4000);
command.Parameters.Add ("@UDTName", SqlDbType.NVarChar, 4000);
break;
case "MetaDataCollections":
return MetaDataCollections.Instance;
case "DataSourceInformation":
throw new NotImplementedException ();
case "DataTypes":
return DataTypes.Instance;
case "ReservedWords":
return ReservedWords.Instance;
case "Restrictions":
return Restrictions.Instance;
}
for (int i = 0; i < length; i++) {
command.Parameters[i].Value = restrictionValues[i];
}
dataAdapter.SelectCommand = command;
dataAdapter.Fill (dataTable);
return dataTable;
}
#endif // NET_2_0
#endregion // Methods
#if NET_2_0
@@ -1,8 +1,3 @@
2006-08-30 Nagappan A <[email protected]>
* DataRow.cs (EndEdit): DataRow.EndEdit emits RowChanged too
often. Fixes bug # 78885.
2006-08-14 Konstantin Triger <[email protected]>
* DataTableCollection.cs, DataRelationCollection.cs, DataRowCollection.cs,
+1 -6
View File
@@ -71,7 +71,6 @@ namespace System.Data {
private bool _hasParentCollection;
private bool _inChangingEvent;
private int _rowId;
internal bool _rowChanged = false;
private XmlDataDocument.XmlDataElement mappedElement;
internal bool _inExpressionEvaluation = false;
@@ -179,7 +178,6 @@ namespace System.Data {
if (value == null && column.DataType != typeof(string)) {
throw new ArgumentException("Cannot set column " + column.ColumnName + " to be null, Please use DBNull instead");
}
_rowChanged = true;
CheckValue (value, column);
bool orginalEditing = Proposed >= 0;
@@ -921,10 +919,7 @@ namespace System.Data {
// Note : row state must not be changed before all the job on indexes finished,
// since the indexes works with recods rather than with rows and the decision
// which of row records to choose depends on row state.
if (_rowChanged == true) {
_table.ChangedDataRow(this, DataRowAction.Change);
_rowChanged = false;
}
_table.ChangedDataRow(this, DataRowAction.Change);
}
}
@@ -117,8 +117,6 @@ namespace System.Data
row.RowID = List.Count - 1;
row.AttachRow ();
row.Table.ChangedDataRow (row, DataRowAction.Add);
if (row._rowChanged)
row._rowChanged = false;
}
/// <summary>
@@ -1,7 +1,3 @@
2006-08-30 Nagappan A <[email protected]>
* SqlConnectionTest.cs: SqlConnection.GetSchema testcases
2006-05-26 Senganal T <[email protected]>
* SqlParameterTest.cs : Test if Parameter Type is inferred correctly
@@ -571,571 +571,4 @@ namespace MonoTests.System.Data
disposedEventCount++;
}
}
#if NET_2_0
[TestFixture]
[Category ("sqlserver")]
public class GetSchemaTest
{
SqlConnection conn = null;
String connectionString = ConnectionManager.Singleton.ConnectionString;
[SetUp]
public void Setup()
{
conn = new SqlConnection(connectionString);
conn.Open();
}
[TearDown]
public void TearDown()
{
conn.Close();
}
[Test]
public void GetSchemaTest1()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("databases");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
if (col.ColumnName.ToString() == "database_name" && row[col].ToString() == "monotest")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS1 failed");
}
[Test]
[ExpectedException(typeof(ArgumentException))]
public void GetSchemaTest2()
{
conn.GetSchema(null);
}
[Test]
public void GetSchemaTest3()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("ForeignKeys");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "TABLE_NAME" && row[col].ToString() == "tmptable1")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS3 failed");
}
[Test]
public void GetSchemaTest4()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("Indexes");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "table_name" && row[col].ToString() == "binary_family")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS4 failed");
}
[Test]
public void GetSchemaTest5()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("IndexColumns");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "table_name" && row[col].ToString() == "binary_family")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS5 failed");
}
[Test]
public void GetSchemaTest6()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("Procedures");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "SPECIFIC_NAME" && row[col].ToString() == "sp_get_age")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS6 failed");
}
[Test]
public void GetSchemaTest7()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("ProcedureParameters");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "SPECIFIC_NAME" && row[col].ToString() == "sp_get_age")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS7 failed");
}
[Test]
public void GetSchemaTest8()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("Tables");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "TABLE_NAME" && row[col].ToString() == "binary_family")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS8 failed");
}
[Test]
public void GetSchemaTest9()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("Columns");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "TABLE_NAME" && row[col].ToString() == "binary_family")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS9 failed");
}
public void GetSchemaTest10()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("Users");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "user_name" && row[col].ToString() == "public")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS10 failed");
}
public void GetSchemaTest11()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("Views");
flag = true; // FIXME: Currently MS-SQL 2005 returns empty table. Remove this flag ASAP.
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values.
*/
if (col.ColumnName.ToString() == "user_name" && row[col].ToString() == "public")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS11 failed");
}
public void GetSchemaTest12()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("ViewColumns");
flag = true; // FIXME: Currently MS-SQL 2005 returns empty table. Remove this flag ASAP.
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values.
*/
if (col.ColumnName.ToString() == "user_name" && row[col].ToString() == "public")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS12 failed");
}
public void GetSchemaTest13()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("UserDefineTypes");
flag = true; // FIXME: Currently MS-SQL 2005 returns empty table. Remove this flag ASAP.
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values.
*/
if (col.ColumnName.ToString() == "user_name" && row[col].ToString() == "public")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS13 failed");
}
[Test]
public void GetSchemaTest14()
{
bool flag = false;
string [] restrictions = new string[4];
restrictions[0] = "monotest";
restrictions[1] = "dbo";
restrictions[2] = null;
restrictions[3] = "BASE TABLE";
DataTable tab1 = conn.GetSchema("Tables", restrictions);
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "TABLE_NAME" && row[col].ToString() == "binary_family")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS14 failed");
}
[Test]
public void GetSchemaTest15()
{
bool flag = false;
string [] restrictions = new string[4];
restrictions[0] = "monotest";
restrictions[1] = null;
restrictions[2] = "binary_family";
restrictions[3] = null;
DataTable tab1 = conn.GetSchema("IndexColumns", restrictions);
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "table_name" && row[col].ToString() == "binary_family")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS15 failed");
}
[Test]
public void GetSchemaTest16()
{
bool flag = false;
string [] restrictions = new string[4];
restrictions[0] = "monotest";
restrictions[1] = null;
restrictions[2] = "sp_get_age";
restrictions[3] = null;
DataTable tab1 = conn.GetSchema("Procedures", restrictions);
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "ROUTINE_NAME" && row[col].ToString() == "sp_get_age")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS16 failed");
}
[Test]
public void GetSchemaTest17()
{
bool flag = false;
DataTable tab1 = conn.GetSchema();
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "CollectionName" && row[col].ToString() == "UserDefinedTypes")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS17 failed");
}
[Test]
public void GetSchemaTest18()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("RESTRICTIONS");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "RestrictionDefault" && row[col].ToString() == "CONSTRAINT_NAME")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS18 failed");
}
[Test]
[ExpectedException(typeof(ArgumentException))]
public void GetSchemaTest19()
{
String [] restrictions = new String[1];
DataTable tab1 = conn.GetSchema("RESTRICTIONS", restrictions);
}
[Test]
public void GetSchemaTest20()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("DataTypes");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "TypeName" && row[col].ToString() == "uniqueidentifier")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS20 failed");
}
[Test]
public void GetSchemaTest21()
{
bool flag = false;
DataTable tab1 = conn.GetSchema();
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "CollectionName" && row[col].ToString() == "UserDefinedTypes")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS21 failed");
}
[Test]
public void GetSchemaTest22()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("ReservedWords");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "ReservedWord" && row[col].ToString() == "UPPER")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS22 failed");
}
[Test]
public void GetSchemaTest23()
{
bool flag = false;
DataTable tab1 = conn.GetSchema("ReservedWords");
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "ReservedWord" && row[col].ToString() == "upper")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(false, flag, "#GS23 failed");
}
[Test]
public void GetSchemaTest24()
{
bool flag = false;
string [] restrictions = new string[4];
restrictions[0] = "monotest";
restrictions[1] = null;
restrictions[2] = "sp_get_age";
restrictions[3] = null;
DataTable tab1 = conn.GetSchema("Procedures", restrictions);
foreach (DataRow row in tab1.Rows)
{
foreach (DataColumn col in tab1.Columns)
{
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "ROUTINE_NAME" && row[col].ToString() == "mono")
{
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(false, flag, "#GS24 failed");
}
[Test]
[ExpectedException(typeof(ArgumentException))]
public void GetSchemaTest25()
{
String [] restrictions = new String[1];
DataTable tab1 = conn.GetSchema("Mono", restrictions);
}
}
#endif
}
+4 -8
View File
@@ -1,7 +1,3 @@
2006-08-28 Boris Kirzner <[email protected]>
* run-tests.test.bat: chnged script for tests NET_2_0 run.
2006-08-24 Sebastien Pouliot <[email protected]>
* System.Drawing_test.dll.sources: Added unit tests for TextureBrush.
@@ -74,10 +70,10 @@
2005-12-05 Jordi Mas i Hernandez <[email protected]>
* MetaHeader.cs: Classes need to specify StructLayout attribute
* EncoderParameter.cs: Classes need to specify StructLayout attribute
* ImageAttributes.cs: Classes need to specify StructLayout attribute
* WmfPlaceableFileHeader.cs: Classes need to specify StructLayout attribute
* MetaHeader.cs: Classes need to specify StructLayout attribute
* EncoderParameter.cs: Classes need to specify StructLayout attribute
* ImageAttributes.cs: Classes need to specify StructLayout attribute
* WmfPlaceableFileHeader.cs: Classes need to specify StructLayout attribute
* MetafileHeader.cs: Classes need to specify StructLayout attribute
2005-12-04 Konstantin Triger <[email protected]>
@@ -1,7 +1,3 @@
2006-08-29 Sebastien Pouliot <[email protected]>
* ToolboxItem.cs: Fix compiler warning.
2006-05-24 Sebastien Pouliot <[email protected]>
* ToolboxItem.cs: Update ComponentType property to match MS result.
@@ -258,7 +258,7 @@ namespace System.Drawing.Design
throw new Exception("Host does not provide an ITypeResolutionService");
//TODO: Using Assembly loader to throw errors. Silent fail and return null?
typeRes.GetAssembly(assemblyName, true);
Assembly assembly = typeRes.GetAssembly(assemblyName, true);
if (reference)
typeRes.ReferenceAssembly(assemblyName);
return typeRes.GetType(typeName, true);
@@ -1,30 +1,3 @@
2006-08-28 Sebastien Pouliot <[email protected]>
* ImageAnimator.cs: Remove catch/throw in WorkerThread (it hides the
original exception). Found with Gendarme.
* Color.cs: Remove the double-check lock. Found with Gendarme.
* ColorConverter.cs: Remove the double-check lock. Found with Gendarme
2006-08-28 Jonathan Chambers <[email protected]>
* ComIStreamMarshaler.cs: Do not free memory allocated for
Com Callable Wrapper for stream. When Image created from stream
is destroyed, it calls Release on CCW interface. Somehow we seem
to be destroying Stream CCW before Image is destroyed. Fixes
crash on exit on Windows. #78315
2006-08-28 Boris Kirzner <[email protected]>
* SystemColors.jvm.cs: fix array size for NET_2_0
2006-08-27 Sebastien Pouliot <[email protected]>
* ColorConverter.cs: Catch the case where the integer part of the
color doesn't fit into a 32bit integer.
* ColorTranslator.cs: Fixed Gendarme's UseStringEmptyRule on ToHtml
method. Fixed string handling on FromHtml method. Fixed all parameter
names to match FX.
2006-08-25 Sebastien Pouliot <[email protected]>
* gdipFunctions.cs: Change ColorMatrix to IntPtr in method
@@ -10,7 +10,11 @@
// (C) 2002 Dennis Hayes
// (c) 2002 Ximian, Inc. (http://www.ximiam.com)
// (C) 2005 HotFeet GmbH (http://www.hotfeet.ch)
// Copyright (C) 2004,2006 Novell, Inc (http://www.novell.com)
//
// TODO: Are the static/non static functions declared correctly
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -32,6 +36,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.ComponentModel;
@@ -209,6 +214,9 @@ namespace System.Drawing
private static void FillColorNames ()
{
if (systemColors != null)
return;
lock (creatingColorNames) {
if (systemColors != null)
return;
@@ -6,7 +6,11 @@
// Ravindra ([email protected])
//
// Copyright (C) 2002 Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004,2006 Novell, Inc (http://www.novell.com)
// Copyright (C) 2004 Novell, Inc. http://www.novell.com
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -28,6 +32,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.ComponentModel;
using System.Globalization;
@@ -101,8 +106,6 @@ namespace System.Drawing
((i & 0xf0) << 8) | ((i & 0xf0) << 4) |
((i & 0xf) << 4) | (i & 0xf);
result = Color.FromArgb ( -16777216 | i );
} else if (s.StartsWith ("#") && (s.Length > 9) && !s.StartsWith ("#0x")) {
throw new Exception (Locale.GetText ("{0} isn't a valid color (integer too large).", s));
}
}
@@ -206,7 +209,11 @@ namespace System.Drawing
public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
{
lock (creatingCached) {
if (cached != null)
return cached;
lock (creatingCached)
{
if (cached != null)
return cached;
@@ -1,13 +1,17 @@
//
// System.Drawing.ColorTranslator.cs
//
// Copyright (C) 2001 Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004 Novell, Inc. http://www.novell.com
//
// Authors:
// Dennis Hayes ([email protected])
// Ravindra ([email protected])
// Sebastien Pouliot <[email protected]>
//
// Copyright (C) 2001 Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004,2006 Novell, Inc (http://www.novell.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -29,22 +33,18 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.ComponentModel;
namespace System.Drawing {
namespace System.Drawing
{
public sealed class ColorTranslator
{
private ColorTranslator () { }
public sealed class ColorTranslator {
private ColorTranslator ()
public static Color FromHtml (string HtmlFromColor)
{
}
public static Color FromHtml (string htmlColor)
{
if ((htmlColor == null) || (htmlColor.Length == 0))
return Color.Empty;
switch (htmlColor.ToLower ()) {
switch (HtmlFromColor.ToLower()) {
case "buttonface":
return SystemColors.Control;
case "captiontext":
@@ -59,15 +59,15 @@ namespace System.Drawing {
return SystemColors.Info;
}
TypeConverter converter = TypeDescriptor.GetConverter (typeof (Color));
return (Color) converter.ConvertFromString (htmlColor);
return (Color) converter.ConvertFromString (HtmlFromColor);
}
public static Color FromOle (int oleColor)
public static Color FromOle (int OleFromColor)
{
// OleColor format is BGR
int R = oleColor & 0xFF;
int G = (oleColor >> 8) & 0xFF;
int B = (oleColor >> 16) & 0xFF;
int R = OleFromColor & 0xFF;
int G = (OleFromColor >> 8) & 0xFF;
int B = (OleFromColor >> 16) & 0xFF;
Color retcolor = Color.FromArgb (255, R, G, B);
foreach (Color c in Color.NamedColors.Values) {
@@ -83,12 +83,12 @@ namespace System.Drawing {
return retcolor;
}
public static Color FromWin32 (int win32Color)
public static Color FromWin32 (int Win32FromColor)
{
// Win32Color format is BGR
int R = win32Color & 0xFF;
int G = (win32Color >> 8) & 0xFF;
int B = (win32Color >> 16) & 0xFF;
int R = Win32FromColor & 0xFF;
int G = (Win32FromColor >> 8) & 0xFF;
int B = (Win32FromColor >> 16) & 0xFF;
Color retcolor = Color.FromArgb (255, R, G, B);
foreach (Color c in Color.NamedColors.Values) {
@@ -108,7 +108,7 @@ namespace System.Drawing {
{
KnownColor kc;
if (c.IsEmpty)
return String.Empty;
return "";
string result;
if(c.IsSystemColor) {
@@ -183,18 +183,18 @@ namespace System.Drawing {
return result;
}
public static int ToOle (Color c)
public static int ToOle (Color color)
{
// OleColor format is BGR, same as Win32
return ((c.B << 16) | (c.G << 8) | c.R);
return ((color.B << 16) | (color.G << 8) | color.R);
}
public static int ToWin32 (Color c)
public static int ToWin32 (Color color)
{
// Win32Color format is BGR, Same as OleColor
return ((c.B << 16) | (c.G << 8) | c.R);
return ((color.B << 16) | (color.G << 8) | color.R);
}
}
}
@@ -177,17 +177,7 @@ namespace System.Drawing
private void Dispose(bool disposing)
{
// FIXME: This causes crash on windows on shutdown.
// Any image loaded from a stream holds onto a reference
// to that stream, and calls Release on the stream when the image is
// disposed. Somehow, we are getting destroyed before the image is
// even though we are using a GC handle (maybe GCHandles are ignored on shutdown)?
// in any cause I think leaking a pointer per image for now is
// better than crashing on windows.
// Need to talk to Paolo about having an unmanaged resource (IStream) in one managed
// object that another unmanaged resource (Image) in another managed object depends on.
//Marshal.FreeHGlobal(comInterface);
Marshal.FreeHGlobal(comInterface);
gcHandle.Free();
if (disposing)
{
@@ -6,7 +6,10 @@
// Sanjay Gupta ([email protected])
//
// (C) 2002 Ximian, Inc
// Copyright (C) 2004,2006 Novell, Inc (http://www.novell.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -27,7 +30,7 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Drawing.Imaging;
using System.Threading;
using System.Collections;
@@ -211,6 +214,8 @@ namespace System.Drawing
}
} catch (ThreadAbortException) {
Thread.ResetAbort (); // we're going to finish anyway
} catch (Exception er) {
throw er;
}
}
}
@@ -40,11 +40,7 @@ namespace System.Drawing {
static SystemColors ()
{
#if !NET_2_0
SystemColorsCache = new Color[27]; //enough for all system color indices
#else
SystemColorsCache = new Color [175]; //enough for all system color indices
#endif
SystemColorsCache = new Color[27]; //enough for all system color indices
if (Graphics.IsHeadless) {
SystemColorsCache[(int)KnownColor.ActiveBorder] = Color.FromArgbSystem (255, 212, 208, 200, "ActiveBorder", KnownColor.ActiveBorder);
-5
View File
@@ -1,8 +1,3 @@
2006-08-28 Boris Kirzner <[email protected]>
* System.Drawing.Test20.J2EE.sln, System.Drawing.Test20.sln,
Test20.csproj, Test20.J2EE.vmwcsproj: added solution
and project files for NET_2_0 tests.
2006-01-25 Boris Kirzner <[email protected]>
* Test.vmwcsproj,Test.dotnet.csproj: added reference to NUnit projects.
@@ -1,44 +1,40 @@
2006-08-28 Boris Kirzner <[email protected]>
* DrawingTestHelper20.csproj, DrawingTestHelper20.J2EE.vmwcsproj :
added project files for NET_2_0 tests.
2006-01-25 Boris Kirzner <[email protected]>
* DrawingTestHelper_java.vmwcsproj, DrawingTestHelper.csproj:
projects updates for TARGET_JVM.
2006-01-23 Boris Kirzner <[email protected]>
* DrawingTestHelper_java.vmwcsproj: include PDComparer.cs.
2006-01-22 Boris Kirzner <boris[email protected]>
* DrawingTestHelper.csproj: include PDComparer.cs.
* DrawingTest.cs: implement IDisposable.
2005-09-20 Vladimir Krasnov <[email protected]>
* DrawingTest.cs: Added Pixel Distance comparer PDCompare()
* Added PDComparer.cs
2005-09-06 Boris Kirzner <boris[email protected]>
* DrawingTest.cs: bug fix.
2005-08-16 Vladimir Krasnov <[email protected]>
* DrawingTest.cs: Added special tolerance feature
fixed compare()
fixed constructor
2005-08-16 Vladimir Krasnov <vladimirk@mainsoft.com>
* DrawingTest.cs: fixed JavaDrawingTest.CalculateSHA1()
2005-08-08 Andrew Skiba <[email protected]>
* DrawingTestHelper.cs: fix ambiguity between System.Math and java.lang.Math
2005-08-07 Andrew Skiba <[email protected]>
* DrawingTest.cs: add nunit assert to Compare functions
* DrawingTestHelper_java.vmwcsproj, DrawingTestHelper.csproj: add nunit.framework
reference
2006-01-25 Boris Kirzner <[email protected]>
* DrawingTestHelper_java.vmwcsproj, DrawingTestHelper.csproj:
projects updates for TARGET_JVM.
2006-01-23 Boris Kirzner <[email protected]>
* DrawingTestHelper_java.vmwcsproj: include PDComparer.cs.
2006-01-22 Boris Kirzner <[email protected]>
* DrawingTestHelper.csproj: include PDComparer.cs.
* DrawingTest.cs: implement IDisposable.
2005-09-20 Vladimir Krasnov <vladimir[email protected]>
* DrawingTest.cs: Added Pixel Distance comparer PDCompare()
* Added PDComparer.cs
2005-09-06 Boris Kirzner <[email protected]>
* DrawingTest.cs: bug fix.
2005-08-16 Vladimir Krasnov <vladimir[email protected]>
* DrawingTest.cs: Added special tolerance feature
fixed compare()
fixed constructor
2005-08-16 Vladimir Krasnov <[email protected]>
* DrawingTest.cs: fixed JavaDrawingTest.CalculateSHA1()
2005-08-08 Andrew Skiba <andrews@mainsoft.com>
* DrawingTestHelper.cs: fix ambiguity between System.Math and java.lang.Math
2005-08-07 Andrew Skiba <[email protected]>
* DrawingTest.cs: add nunit assert to Compare functions
* DrawingTestHelper_java.vmwcsproj, DrawingTestHelper.csproj: add nunit.framework
reference
@@ -1,131 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">
<OutputPath>bin\Release_Java20\</OutputPath>
<DefineConstants>TRACE;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<SkipValidation>false</SkipValidation>
<KeepIntermediate>false</KeepIntermediate>
<GHProjectType>1</GHProjectType>
<PreCompile>false</PreCompile>
<AdditionalClassPath>
</AdditionalClassPath>
<ApplicationServerType>
</ApplicationServerType>
<Version>2.0</Version>
<JDKName>1.5.0_05</JDKName>
<TargetPlatform>0</TargetPlatform>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug_Java20\</OutputPath>
<DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<SkipValidation>True</SkipValidation>
<KeepIntermediate>False</KeepIntermediate>
<GHProjectType>1</GHProjectType>
<PreCompile>false</PreCompile>
<AdditionalClassPath>
</AdditionalClassPath>
<ApplicationServerType>
</ApplicationServerType>
<Version>2.0</Version>
<JDKName>1.5.0_05</JDKName>
<TargetPlatform>0</TargetPlatform>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DrawingTest</RootNamespace>
<AssemblyName>DrawingTest</AssemblyName>
<JDKName>1.5.0_05</JDKName>
<GHProjectType>1</GHProjectType>
<Version>2.0</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug_Java\</OutputPath>
<DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<BaseAddress>285212672</BaseAddress>
<NoStdLib>false</NoStdLib>
<SkipValidation>True</SkipValidation>
<KeepIntermediate>False</KeepIntermediate>
<TargetPlatform>0</TargetPlatform>
<AdditionalClassPath>
</AdditionalClassPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release_Java\</OutputPath>
<DefineConstants>TRACE;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<BaseAddress>285212672</BaseAddress>
<NoStdLib>false</NoStdLib>
<SkipValidation>false</SkipValidation>
<KeepIntermediate>false</KeepIntermediate>
<TargetPlatform>0</TargetPlatform>
<AdditionalClassPath>
</AdditionalClassPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="J2SE.Helpers, Version=0.0.0.0, Culture=neutral">
<Private>False</Private>
<HintPath>..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\J2SE.Helpers.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=0.0.0.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>c:\cygwin\monobuild\mcs\nunit20\framework\bin\Debug_Java20\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="rt, Version=0.0.0.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\jre5\rt.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System"/>
<Reference Include="System.Drawing"/>
<Reference Include="System.Xml"/>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs"/>
<Compile Include="DrawingTest.cs"/>
<Compile Include="PDComparer.cs"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="c:\cygwin\monobuild\mcs\class\System.Drawing\Test\DrawingTest\Exocortex.DSP\src\Exocortex.DSP20.v1.J2EE.vmwcsproj">
<Project>{995DE32D-06AB-4926-97FF-565B9205D5F8}</Project>
<Name>Exocortex.DSP20.v1.J2EE</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets"/>
<Import Project="$(GHROOT)\bin\Mainsoft.Common.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions>
<VisualStudio>
<UserProperties REFS-JarPath-system-drawing="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Drawing.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\jai_imageio.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\jai_core.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\jai_codec.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\clibwrapper_jiio.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\mlibwrapper_jai.jar" REFS-JarPath-j2se-helpers="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\J2SE.Helpers.jar" REFS-JarPath-rt="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Xml.jar" REFS-JarPath-system-data="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Data.jar" REFS-JarPath-system="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.jar" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\mscorlib.jar" REFS-JarPath-nunit-framework="..\..\..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.jar" REFS-JarPath-nunit-util="..\..\..\..\..\nunit20\util\bin\Debug_Java20\nunit.util.jar" REFS-JarPath-nunit-core="..\..\..\..\..\nunit20\util\bin\Debug_Java20\nunit.core.jar"/>
</VisualStudio>
</ProjectExtensions>
</Project>
@@ -1,61 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0E97F734-51B9-497B-9259-B6999FD87BDF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DrawingTest</RootNamespace>
<AssemblyName>DrawingTest</AssemblyName>
<StartupObject>
</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\nunit20\framework\bin\Debug\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="DrawingTest.cs" />
<Compile Include="PDComparer.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Exocortex.DSP\src\Exocortex.DSP20.v1.csproj">
<Project>{A9553E24-D07E-44FE-92FB-8C1D3D3C744E}</Project>
<Name>Exocortex.DSP20.v1</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,122 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">
<OutputPath>bin\Release_Java20\</OutputPath>
<DefineConstants>TRACE;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<SkipValidation>false</SkipValidation>
<KeepIntermediate>false</KeepIntermediate>
<GHProjectType>1</GHProjectType>
<PreCompile>false</PreCompile>
<AdditionalClassPath>
</AdditionalClassPath>
<ApplicationServerType>
</ApplicationServerType>
<Version>2.0</Version>
<JDKName>1.5.0_05</JDKName>
<TargetPlatform>0</TargetPlatform>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug_Java20\</OutputPath>
<DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<SkipValidation>True</SkipValidation>
<KeepIntermediate>False</KeepIntermediate>
<GHProjectType>1</GHProjectType>
<PreCompile>false</PreCompile>
<AdditionalClassPath>
</AdditionalClassPath>
<ApplicationServerType>
</ApplicationServerType>
<Version>2.0</Version>
<JDKName>1.5.0_05</JDKName>
<TargetPlatform>0</TargetPlatform>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{995DE32D-06AB-4926-97FF-565B9205D5F8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Exocortex.DSP</RootNamespace>
<AssemblyName>Exocortex.DSP.v1</AssemblyName>
<JDKName>1.5.0_05</JDKName>
<GHProjectType>1</GHProjectType>
<Version>2.0</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug_Java\</OutputPath>
<DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<BaseAddress>285212672</BaseAddress>
<NoStdLib>false</NoStdLib>
<SkipValidation>True</SkipValidation>
<KeepIntermediate>False</KeepIntermediate>
<TargetPlatform>0</TargetPlatform>
<AdditionalClassPath>
</AdditionalClassPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release_Java\</OutputPath>
<DefineConstants>TRACE;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<BaseAddress>285212672</BaseAddress>
<NoStdLib>false</NoStdLib>
<SkipValidation>false</SkipValidation>
<KeepIntermediate>false</KeepIntermediate>
<TargetPlatform>0</TargetPlatform>
<AdditionalClassPath>
</AdditionalClassPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="J2SE.Helpers, Version=0.0.0.0, Culture=neutral">
<Private>False</Private>
</Reference>
<Reference Include="rt, Version=0.0.0.0, Culture=neutral">
<Private>False</Private>
</Reference>
<Reference Include="System"/>
<Reference Include="System.Drawing"/>
<Reference Include="System.Xml"/>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs"/>
<Compile Include="Complex.cs"/>
<Compile Include="ComplexArray.cs"/>
<Compile Include="ComplexF.cs"/>
<Compile Include="ComplexMath.cs"/>
<Compile Include="ComplexStats.cs"/>
<Compile Include="Fourier.cs"/>
<Compile Include="FourierDirection.cs"/>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets"/>
<Import Project="$(GHROOT)\bin\Mainsoft.Common.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions>
<VisualStudio>
<UserProperties REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\mscorlib.jar" REFS-JarPath-system="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.jar" REFS-JarPath-system-data="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Data.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Xml.jar" REFS-JarPath-rt="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" REFS-JarPath-j2se-helpers="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\J2SE.Helpers.jar" REFS-JarPath-system-drawing="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Drawing.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\jai_imageio.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\jai_core.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\jai_codec.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\clibwrapper_jiio.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\mlibwrapper_jai.jar"/>
</VisualStudio>
</ProjectExtensions>
</Project>
@@ -1,55 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A9553E24-D07E-44FE-92FB-8C1D3D3C744E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Exocortex.DSP</RootNamespace>
<AssemblyName>Exocortex.DSP.v1</AssemblyName>
<StartupObject>
</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Complex.cs" />
<Compile Include="ComplexArray.cs" />
<Compile Include="ComplexF.cs" />
<Compile Include="ComplexMath.cs" />
<Compile Include="ComplexStats.cs" />
<Compile Include="Fourier.cs" />
<Compile Include="FourierDirection.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,6 +1,3 @@
2006-08-28 Boris Kirzner <[email protected]>
* GraphicsPath.cs: marked test as "NotWorking"
2006-01-25 Boris Kirzner <[email protected]>
* Graphics.cs: added #ifdef for TARGET_JVM.
@@ -4221,8 +4221,6 @@ namespace Test.Sys.Drawing
}
[Test]
[Category("NotWorking")]
// In .Net PathData seems to clone Types and Points before returning them to user
public void PathData2 ()
{
path = new GraphicsPath ();
@@ -1,11 +1,3 @@
2006-08-31 Sebastien Pouliot <[email protected]>
* TestBmpCodec.cs: Add more test cases for 1, 8 and 32 bbp bitmaps
including checks for Pixels and BitmapData.
* TestImageCodecInfo.cs: Fix namespace and class name.
* TestJpegCodec.cs: Reactivate the tests (not sure why they were
commented). Added test cases for Pixel and BitmapData (NotWorking).
2006-08-25 Sebastien Pouliot <[email protected]>
* TestBmpCodec.cs: Add pixel value tests to a well known bitmap.
@@ -1,12 +1,15 @@
//
// BMPCodec class testing unit
//
// Authors:
// Jordi Mas i Hernàndez ([email protected])
// Sebastien Pouliot <sebastien@ximian.com>
// Author:
//
// Jordi Mas i Hernàndez (jordi@ximian.com)
//
// (C) 2004 Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -27,7 +30,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Drawing;
using System.Drawing.Imaging;
@@ -37,194 +39,47 @@ using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
namespace MonoTests.System.Drawing.Imaging {
namespace MonoTests.System.Drawing.Imaging
{
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
public class BmpCodecTest {
public class TestBmpCodec
{
[TearDown]
public void Clean() {}
[SetUp]
public void GetReady()
{
}
/* Get suffix to add to the filename */
internal string getOutSufix()
{
string s;
int p = (int) Environment.OSVersion.Platform;
if ((p == 4) || (p == 128))
s = "-unix";
else
s = "-windows";
if (Type.GetType ("Mono.Runtime", false) == null)
s += "-msnet";
else
s += "-mono";
return s;
{
if (Environment.GetEnvironmentVariable("MSNet")==null)
return "-mono";
return "";
}
/* Get the input directory depending on the runtime*/
internal string getInFile(string file)
{
string sRslt = Path.GetFullPath ("../System.Drawing/" + file);
if (!File.Exists (sRslt))
sRslt = "Test/System.Drawing/" + file;
{
string sRslt, local;
local = "../System.Drawing/" + file;
sRslt = Path.GetFullPath (local);
if (File.Exists(sRslt)==false)
sRslt = "Test/System.Drawing/" + file;
return sRslt;
}
/* Checks bitmap features on a know 1bbp bitmap */
[Test]
public void Bitmap1bitFeatures ()
{
string sInFile = getInFile ("bitmaps/almogaver1bit.bmp");
using (Bitmap bmp = new Bitmap (sInFile)) {
GraphicsUnit unit = GraphicsUnit.World;
RectangleF rect = bmp.GetBounds (ref unit);
// ??? why is it a 4bbp ?
Assert.AreEqual (PixelFormat.Format4bppIndexed, bmp.PixelFormat);
Assert.AreEqual (173, bmp.Width, "bmp.Width");
Assert.AreEqual (183, bmp.Height, "bmp.Height");
Assert.AreEqual (0, rect.X, "rect.X");
Assert.AreEqual (0, rect.Y, "rect.Y");
Assert.AreEqual (173, rect.Width, "rect.Width");
Assert.AreEqual (183, rect.Height, "rect.Height");
Assert.AreEqual (173, bmp.Size.Width, "bmp.Size.Width");
Assert.AreEqual (183, bmp.Size.Height, "bmp.Size.Height");
}
}
[Test]
public void Bitmap1bitPixels ()
{
string sInFile = getInFile ("bitmaps/almogaver1bit.bmp");
using (Bitmap bmp = new Bitmap (sInFile)) {
#if false
for (int x = 0; x < bmp.Width; x += 32) {
for (int y = 0; y < bmp.Height; y += 32)
Console.WriteLine ("\t\t\t\tAssert.AreEqual ({0}, bmp.GetPixel ({1}, {2}).ToArgb (), \"{1},{2}\");", bmp.GetPixel (x, y).ToArgb (), x, y);
}
#else
// sampling values from a well known bitmap
Assert.AreEqual (-1, bmp.GetPixel (0, 0).ToArgb (), "0,0");
Assert.AreEqual (-4144960, bmp.GetPixel (0, 32).ToArgb (), "0,32");
Assert.AreEqual (-1, bmp.GetPixel (0, 64).ToArgb (), "0,64");
Assert.AreEqual (-1, bmp.GetPixel (0, 96).ToArgb (), "0,96");
Assert.AreEqual (-4144960, bmp.GetPixel (0, 128).ToArgb (), "0,128");
Assert.AreEqual (-1, bmp.GetPixel (0, 160).ToArgb (), "0,160");
Assert.AreEqual (-4144960, bmp.GetPixel (32, 0).ToArgb (), "32,0");
Assert.AreEqual (-4144960, bmp.GetPixel (32, 32).ToArgb (), "32,32");
Assert.AreEqual (-1, bmp.GetPixel (32, 64).ToArgb (), "32,64");
Assert.AreEqual (-4144960, bmp.GetPixel (32, 96).ToArgb (), "32,96");
Assert.AreEqual (-4144960, bmp.GetPixel (32, 128).ToArgb (), "32,128");
Assert.AreEqual (-8355712, bmp.GetPixel (32, 160).ToArgb (), "32,160");
Assert.AreEqual (-16777216, bmp.GetPixel (64, 0).ToArgb (), "64,0");
Assert.AreEqual (-8355712, bmp.GetPixel (64, 32).ToArgb (), "64,32");
Assert.AreEqual (-1, bmp.GetPixel (64, 64).ToArgb (), "64,64");
Assert.AreEqual (-16777216, bmp.GetPixel (64, 96).ToArgb (), "64,96");
Assert.AreEqual (-8355840, bmp.GetPixel (64, 128).ToArgb (), "64,128");
Assert.AreEqual (-16777216, bmp.GetPixel (64, 160).ToArgb (), "64,160");
Assert.AreEqual (-4144960, bmp.GetPixel (96, 0).ToArgb (), "96,0");
Assert.AreEqual (-8355712, bmp.GetPixel (96, 32).ToArgb (), "96,32");
Assert.AreEqual (-16777216, bmp.GetPixel (96, 64).ToArgb (), "96,64");
Assert.AreEqual (-4144960, bmp.GetPixel (96, 96).ToArgb (), "96,96");
Assert.AreEqual (-8355840, bmp.GetPixel (96, 128).ToArgb (), "96,128");
Assert.AreEqual (-16777216, bmp.GetPixel (96, 160).ToArgb (), "96,160");
Assert.AreEqual (-1, bmp.GetPixel (128, 0).ToArgb (), "128,0");
Assert.AreEqual (-8355712, bmp.GetPixel (128, 32).ToArgb (), "128,32");
Assert.AreEqual (-1, bmp.GetPixel (128, 64).ToArgb (), "128,64");
Assert.AreEqual (-4144960, bmp.GetPixel (128, 96).ToArgb (), "128,96");
Assert.AreEqual (-16777216, bmp.GetPixel (128, 128).ToArgb (), "128,128");
Assert.AreEqual (-4144960, bmp.GetPixel (128, 160).ToArgb (), "128,160");
Assert.AreEqual (-4144960, bmp.GetPixel (160, 0).ToArgb (), "160,0");
Assert.AreEqual (-1, bmp.GetPixel (160, 32).ToArgb (), "160,32");
Assert.AreEqual (-4144960, bmp.GetPixel (160, 64).ToArgb (), "160,64");
Assert.AreEqual (-4144960, bmp.GetPixel (160, 96).ToArgb (), "160,96");
Assert.AreEqual (-4144960, bmp.GetPixel (160, 128).ToArgb (), "160,128");
Assert.AreEqual (-8355712, bmp.GetPixel (160, 160).ToArgb (), "160,160");
#endif
}
}
/* Checks bitmap features on a know 8bbp bitmap */
[Test]
public void Bitmap8bitFeatures ()
{
string sInFile = getInFile ("bitmaps/almogaver8bits.bmp");
using (Bitmap bmp = new Bitmap (sInFile)) {
GraphicsUnit unit = GraphicsUnit.World;
RectangleF rect = bmp.GetBounds (ref unit);
Assert.AreEqual (PixelFormat.Format8bppIndexed, bmp.PixelFormat);
Assert.AreEqual (173, bmp.Width, "bmp.Width");
Assert.AreEqual (183, bmp.Height, "bmp.Height");
Assert.AreEqual (0, rect.X, "rect.X");
Assert.AreEqual (0, rect.Y, "rect.Y");
Assert.AreEqual (173, rect.Width, "rect.Width");
Assert.AreEqual (183, rect.Height, "rect.Height");
Assert.AreEqual (173, bmp.Size.Width, "bmp.Size.Width");
Assert.AreEqual (183, bmp.Size.Height, "bmp.Size.Height");
}
}
[Test]
public void Bitmap8bitPixels ()
{
string sInFile = getInFile ("bitmaps/almogaver8bits.bmp");
using (Bitmap bmp = new Bitmap (sInFile)) {
#if false
for (int x = 0; x < bmp.Width; x += 32) {
for (int y = 0; y < bmp.Height; y += 32)
Console.WriteLine ("\t\t\t\tAssert.AreEqual ({0}, bmp.GetPixel ({1}, {2}).ToArgb (), \"{1},{2}\");", bmp.GetPixel (x, y).ToArgb (), x, y);
}
#else
// sampling values from a well known bitmap
Assert.AreEqual (-1040, bmp.GetPixel (0, 0).ToArgb (), "0,0");
Assert.AreEqual (-4137792, bmp.GetPixel (0, 32).ToArgb (), "0,32");
Assert.AreEqual (-1040, bmp.GetPixel (0, 64).ToArgb (), "0,64");
Assert.AreEqual (-1040, bmp.GetPixel (0, 96).ToArgb (), "0,96");
Assert.AreEqual (-4137792, bmp.GetPixel (0, 128).ToArgb (), "0,128");
Assert.AreEqual (-1040, bmp.GetPixel (0, 160).ToArgb (), "0,160");
Assert.AreEqual (-4137792, bmp.GetPixel (32, 0).ToArgb (), "32,0");
Assert.AreEqual (-4137792, bmp.GetPixel (32, 32).ToArgb (), "32,32");
Assert.AreEqual (-1040, bmp.GetPixel (32, 64).ToArgb (), "32,64");
Assert.AreEqual (-4144960, bmp.GetPixel (32, 96).ToArgb (), "32,96");
Assert.AreEqual (-6250304, bmp.GetPixel (32, 128).ToArgb (), "32,128");
Assert.AreEqual (-8355712, bmp.GetPixel (32, 160).ToArgb (), "32,160");
Assert.AreEqual (-12566464, bmp.GetPixel (64, 0).ToArgb (), "64,0");
Assert.AreEqual (-6258560, bmp.GetPixel (64, 32).ToArgb (), "64,32");
Assert.AreEqual (-1040, bmp.GetPixel (64, 64).ToArgb (), "64,64");
Assert.AreEqual (-16777216, bmp.GetPixel (64, 96).ToArgb (), "64,96");
Assert.AreEqual (-8355776, bmp.GetPixel (64, 128).ToArgb (), "64,128");
Assert.AreEqual (-16777216, bmp.GetPixel (64, 160).ToArgb (), "64,160");
Assert.AreEqual (-4137792, bmp.GetPixel (96, 0).ToArgb (), "96,0");
Assert.AreEqual (-8355712, bmp.GetPixel (96, 32).ToArgb (), "96,32");
Assert.AreEqual (-12566464, bmp.GetPixel (96, 64).ToArgb (), "96,64");
Assert.AreEqual (-2039680, bmp.GetPixel (96, 96).ToArgb (), "96,96");
Assert.AreEqual (-4153280, bmp.GetPixel (96, 128).ToArgb (), "96,128");
Assert.AreEqual (-12566464, bmp.GetPixel (96, 160).ToArgb (), "96,160");
Assert.AreEqual (-1040, bmp.GetPixel (128, 0).ToArgb (), "128,0");
Assert.AreEqual (-6258560, bmp.GetPixel (128, 32).ToArgb (), "128,32");
Assert.AreEqual (-1040, bmp.GetPixel (128, 64).ToArgb (), "128,64");
Assert.AreEqual (-4144960, bmp.GetPixel (128, 96).ToArgb (), "128,96");
Assert.AreEqual (-12566464, bmp.GetPixel (128, 128).ToArgb (), "128,128");
Assert.AreEqual (-4144960, bmp.GetPixel (128, 160).ToArgb (), "128,160");
Assert.AreEqual (-4137792, bmp.GetPixel (160, 0).ToArgb (), "160,0");
Assert.AreEqual (-1040, bmp.GetPixel (160, 32).ToArgb (), "160,32");
Assert.AreEqual (-4144960, bmp.GetPixel (160, 64).ToArgb (), "160,64");
Assert.AreEqual (-4137792, bmp.GetPixel (160, 96).ToArgb (), "160,96");
Assert.AreEqual (-4137792, bmp.GetPixel (160, 128).ToArgb (), "160,128");
Assert.AreEqual (-8355712, bmp.GetPixel (160, 160).ToArgb (), "160,160");
#endif
}
}
/* Checks bitmap features on a know 24-bits bitmap */
#if TARGET_JVM
[NUnit.Framework.Category ("NotWorking")]
@@ -232,308 +87,117 @@ namespace MonoTests.System.Drawing.Imaging {
[Test]
public void Bitmap24bitFeatures()
{
string sInFile = getInFile ("bitmaps/almogaver24bits.bmp");
using (Bitmap bmp = new Bitmap (sInFile)) {
GraphicsUnit unit = GraphicsUnit.World;
RectangleF rect = bmp.GetBounds (ref unit);
string sInFile = getInFile ("bitmaps/almogaver24bits.bmp");
Bitmap bmp = new Bitmap(sInFile);
RectangleF rect;
GraphicsUnit unit = GraphicsUnit.World;
rect = bmp.GetBounds(ref unit);
Assert.AreEqual (PixelFormat.Format24bppRgb, bmp.PixelFormat);
Assert.AreEqual (173, bmp.Width);
Assert.AreEqual (183, bmp.Height);
Assert.AreEqual (0, rect.X);
Assert.AreEqual (0, rect.Y);
Assert.AreEqual (173, rect.Width);
Assert.AreEqual (183, rect.Height);
Assert.AreEqual (173, bmp.Size.Width);
Assert.AreEqual (183, bmp.Size.Height);
Assert.AreEqual (PixelFormat.Format24bppRgb, bmp.PixelFormat);
Assert.AreEqual (173, bmp.Width, "bmp.Width");
Assert.AreEqual (183, bmp.Height, "bmp.Height");
Assert.AreEqual (0, rect.X, "rect.X");
Assert.AreEqual (0, rect.Y, "rect.Y");
Assert.AreEqual (173, rect.Width, "rect.Width");
Assert.AreEqual (183, rect.Height, "rect.Height");
Assert.AreEqual (173, bmp.Size.Width, "bmp.Size.Width");
Assert.AreEqual (183, bmp.Size.Height, "bmp.Size.Height");
}
// sampling values from a well known bitmap
Assert.AreEqual (-1645353, bmp.GetPixel (0, 32).ToArgb (), "0,32");
Assert.AreEqual (-461332, bmp.GetPixel (0, 64).ToArgb (), "0,64");
Assert.AreEqual (-330005, bmp.GetPixel (0, 96).ToArgb (), "0,96");
Assert.AreEqual (-2237489, bmp.GetPixel (0, 128).ToArgb (), "0,128");
Assert.AreEqual (-1251105, bmp.GetPixel (0, 160).ToArgb (), "0,160");
Assert.AreEqual (-3024947, bmp.GetPixel (32, 0).ToArgb (), "32,0");
Assert.AreEqual (-2699070, bmp.GetPixel (32, 32).ToArgb (), "32,32");
Assert.AreEqual (-2366734, bmp.GetPixel (32, 64).ToArgb (), "32,64");
Assert.AreEqual (-4538413, bmp.GetPixel (32, 96).ToArgb (), "32,96");
Assert.AreEqual (-6116681, bmp.GetPixel (32, 128).ToArgb (), "32,128");
Assert.AreEqual (-7369076, bmp.GetPixel (32, 160).ToArgb (), "32,160");
Assert.AreEqual (-13024729, bmp.GetPixel (64, 0).ToArgb (), "64,0");
Assert.AreEqual (-7174020, bmp.GetPixel (64, 32).ToArgb (), "64,32");
Assert.AreEqual (-51, bmp.GetPixel (64, 64).ToArgb (), "64,64");
Assert.AreEqual (-16053503, bmp.GetPixel (64, 96).ToArgb (), "64,96");
Assert.AreEqual (-8224431, bmp.GetPixel (64, 128).ToArgb (), "64,128");
Assert.AreEqual (-16579326, bmp.GetPixel (64, 160).ToArgb (), "64,160");
Assert.AreEqual (-2502457, bmp.GetPixel (96, 0).ToArgb (), "96,0");
Assert.AreEqual (-9078395, bmp.GetPixel (96, 32).ToArgb (), "96,32");
Assert.AreEqual (-12696508, bmp.GetPixel (96, 64).ToArgb (), "96,64");
Assert.AreEqual (-70772, bmp.GetPixel (96, 96).ToArgb (), "96,96");
Assert.AreEqual (-4346279, bmp.GetPixel (96, 128).ToArgb (), "96,128");
Assert.AreEqual (-11583193, bmp.GetPixel (96, 160).ToArgb (), "96,160");
Assert.AreEqual (-724763, bmp.GetPixel (128, 0).ToArgb (), "128,0");
Assert.AreEqual (-7238268, bmp.GetPixel (128, 32).ToArgb (), "128,32");
Assert.AreEqual (-2169612, bmp.GetPixel (128, 64).ToArgb (), "128,64");
Assert.AreEqual (-3683883, bmp.GetPixel (128, 96).ToArgb (), "128,96");
Assert.AreEqual (-12892867, bmp.GetPixel (128, 128).ToArgb (), "128,128");
Assert.AreEqual (-3750464, bmp.GetPixel (128, 160).ToArgb (), "128,160");
Assert.AreEqual (-3222844, bmp.GetPixel (160, 0).ToArgb (), "160,0");
Assert.AreEqual (-65806, bmp.GetPixel (160, 32).ToArgb (), "160,32");
Assert.AreEqual (-2961726, bmp.GetPixel (160, 64).ToArgb (), "160,64");
Assert.AreEqual (-2435382, bmp.GetPixel (160, 96).ToArgb (), "160,96");
Assert.AreEqual (-2501944, bmp.GetPixel (160, 128).ToArgb (), "160,128");
Assert.AreEqual (-9211799, bmp.GetPixel (160, 160).ToArgb (), "160,160");
/* for (int x = 0; x <bmp.Width; x += 32) {
for (int y = 0; y < bmp.Height; y += 32)
Console.WriteLine ("\t\t\tAssert.AreEqual ({0}, bmp.GetPixel ({1}, {2}).ToArgb (), \"{1},{2}\");", bmp.GetPixel (x, y).ToArgb (), x, y);
}*/
}
[Test]
public void Bitmap24bitPixels ()
{
string sInFile = getInFile ("bitmaps/almogaver24bits.bmp");
using (Bitmap bmp = new Bitmap (sInFile)) {
#if false
for (int x = 0; x < bmp.Width; x += 32) {
for (int y = 0; y < bmp.Height; y += 32)
Console.WriteLine ("\t\t\t\tAssert.AreEqual ({0}, bmp.GetPixel ({1}, {2}).ToArgb (), \"{1},{2}\");", bmp.GetPixel (x, y).ToArgb (), x, y);
}
#else
// sampling values from a well known bitmap
Assert.AreEqual (-1645353, bmp.GetPixel (0, 32).ToArgb (), "0,32");
Assert.AreEqual (-461332, bmp.GetPixel (0, 64).ToArgb (), "0,64");
Assert.AreEqual (-330005, bmp.GetPixel (0, 96).ToArgb (), "0,96");
Assert.AreEqual (-2237489, bmp.GetPixel (0, 128).ToArgb (), "0,128");
Assert.AreEqual (-1251105, bmp.GetPixel (0, 160).ToArgb (), "0,160");
Assert.AreEqual (-3024947, bmp.GetPixel (32, 0).ToArgb (), "32,0");
Assert.AreEqual (-2699070, bmp.GetPixel (32, 32).ToArgb (), "32,32");
Assert.AreEqual (-2366734, bmp.GetPixel (32, 64).ToArgb (), "32,64");
Assert.AreEqual (-4538413, bmp.GetPixel (32, 96).ToArgb (), "32,96");
Assert.AreEqual (-6116681, bmp.GetPixel (32, 128).ToArgb (), "32,128");
Assert.AreEqual (-7369076, bmp.GetPixel (32, 160).ToArgb (), "32,160");
Assert.AreEqual (-13024729, bmp.GetPixel (64, 0).ToArgb (), "64,0");
Assert.AreEqual (-7174020, bmp.GetPixel (64, 32).ToArgb (), "64,32");
Assert.AreEqual (-51, bmp.GetPixel (64, 64).ToArgb (), "64,64");
Assert.AreEqual (-16053503, bmp.GetPixel (64, 96).ToArgb (), "64,96");
Assert.AreEqual (-8224431, bmp.GetPixel (64, 128).ToArgb (), "64,128");
Assert.AreEqual (-16579326, bmp.GetPixel (64, 160).ToArgb (), "64,160");
Assert.AreEqual (-2502457, bmp.GetPixel (96, 0).ToArgb (), "96,0");
Assert.AreEqual (-9078395, bmp.GetPixel (96, 32).ToArgb (), "96,32");
Assert.AreEqual (-12696508, bmp.GetPixel (96, 64).ToArgb (), "96,64");
Assert.AreEqual (-70772, bmp.GetPixel (96, 96).ToArgb (), "96,96");
Assert.AreEqual (-4346279, bmp.GetPixel (96, 128).ToArgb (), "96,128");
Assert.AreEqual (-11583193, bmp.GetPixel (96, 160).ToArgb (), "96,160");
Assert.AreEqual (-724763, bmp.GetPixel (128, 0).ToArgb (), "128,0");
Assert.AreEqual (-7238268, bmp.GetPixel (128, 32).ToArgb (), "128,32");
Assert.AreEqual (-2169612, bmp.GetPixel (128, 64).ToArgb (), "128,64");
Assert.AreEqual (-3683883, bmp.GetPixel (128, 96).ToArgb (), "128,96");
Assert.AreEqual (-12892867, bmp.GetPixel (128, 128).ToArgb (), "128,128");
Assert.AreEqual (-3750464, bmp.GetPixel (128, 160).ToArgb (), "128,160");
Assert.AreEqual (-3222844, bmp.GetPixel (160, 0).ToArgb (), "160,0");
Assert.AreEqual (-65806, bmp.GetPixel (160, 32).ToArgb (), "160,32");
Assert.AreEqual (-2961726, bmp.GetPixel (160, 64).ToArgb (), "160,64");
Assert.AreEqual (-2435382, bmp.GetPixel (160, 96).ToArgb (), "160,96");
Assert.AreEqual (-2501944, bmp.GetPixel (160, 128).ToArgb (), "160,128");
Assert.AreEqual (-9211799, bmp.GetPixel (160, 160).ToArgb (), "160,160");
#endif
}
}
[Test]
[Category ("NotWorking")]
public void Bitmap24bitData ()
{
string sInFile = getInFile ("bitmaps/almogaver24bits.bmp");
using (Bitmap bmp = new Bitmap (sInFile)) {
BitmapData data = bmp.LockBits (new Rectangle (0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
try {
Assert.AreEqual (bmp.Height, data.Height, "Height");
Assert.AreEqual (bmp.Width, data.Width, "Width");
Assert.AreEqual (PixelFormat.Format24bppRgb, data.PixelFormat, "PixelFormat");
int size = data.Height * data.Stride;
unsafe {
byte* scan = (byte*) data.Scan0;
#if false
// 1009 is the first prime after 1000 (so we're not affected by a recurring pattern)
for (int p = 0; p < size; p += 1009) {
Console.WriteLine ("\t\t\t\t\t\tAssert.AreEqual ({0}, *(scan + {1}), \"{1}\");", *(scan + p), p);
}
#else
// sampling values from a well known bitmap
Assert.AreEqual (217, *(scan + 0), "0");
Assert.AreEqual (192, *(scan + 1009), "1009");
Assert.AreEqual (210, *(scan + 2018), "2018");
Assert.AreEqual (196, *(scan + 3027), "3027");
Assert.AreEqual (216, *(scan + 4036), "4036");
Assert.AreEqual (215, *(scan + 5045), "5045");
Assert.AreEqual (218, *(scan + 6054), "6054");
Assert.AreEqual (218, *(scan + 7063), "7063");
Assert.AreEqual (95, *(scan + 8072), "8072");
Assert.AreEqual (9, *(scan + 9081), "9081");
Assert.AreEqual (247, *(scan + 10090), "10090");
Assert.AreEqual (161, *(scan + 11099), "11099");
Assert.AreEqual (130, *(scan + 12108), "12108");
Assert.AreEqual (131, *(scan + 13117), "13117");
Assert.AreEqual (175, *(scan + 14126), "14126");
Assert.AreEqual (217, *(scan + 15135), "15135");
Assert.AreEqual (201, *(scan + 16144), "16144");
Assert.AreEqual (183, *(scan + 17153), "17153");
Assert.AreEqual (236, *(scan + 18162), "18162");
Assert.AreEqual (242, *(scan + 19171), "19171");
Assert.AreEqual (125, *(scan + 20180), "20180");
Assert.AreEqual (193, *(scan + 21189), "21189");
Assert.AreEqual (227, *(scan + 22198), "22198");
Assert.AreEqual (44, *(scan + 23207), "23207");
Assert.AreEqual (230, *(scan + 24216), "24216");
Assert.AreEqual (224, *(scan + 25225), "25225");
Assert.AreEqual (164, *(scan + 26234), "26234");
Assert.AreEqual (43, *(scan + 27243), "27243");
Assert.AreEqual (200, *(scan + 28252), "28252");
Assert.AreEqual (255, *(scan + 29261), "29261");
Assert.AreEqual (226, *(scan + 30270), "30270");
Assert.AreEqual (230, *(scan + 31279), "31279");
Assert.AreEqual (178, *(scan + 32288), "32288");
Assert.AreEqual (224, *(scan + 33297), "33297");
Assert.AreEqual (233, *(scan + 34306), "34306");
Assert.AreEqual (212, *(scan + 35315), "35315");
Assert.AreEqual (153, *(scan + 36324), "36324");
Assert.AreEqual (143, *(scan + 37333), "37333");
Assert.AreEqual (215, *(scan + 38342), "38342");
Assert.AreEqual (116, *(scan + 39351), "39351");
Assert.AreEqual (26, *(scan + 40360), "40360");
Assert.AreEqual (28, *(scan + 41369), "41369");
Assert.AreEqual (75, *(scan + 42378), "42378");
Assert.AreEqual (50, *(scan + 43387), "43387");
Assert.AreEqual (244, *(scan + 44396), "44396");
Assert.AreEqual (191, *(scan + 45405), "45405");
Assert.AreEqual (200, *(scan + 46414), "46414");
Assert.AreEqual (197, *(scan + 47423), "47423");
Assert.AreEqual (232, *(scan + 48432), "48432");
Assert.AreEqual (186, *(scan + 49441), "49441");
Assert.AreEqual (210, *(scan + 50450), "50450");
Assert.AreEqual (215, *(scan + 51459), "51459");
Assert.AreEqual (155, *(scan + 52468), "52468");
Assert.AreEqual (56, *(scan + 53477), "53477");
Assert.AreEqual (149, *(scan + 54486), "54486");
Assert.AreEqual (137, *(scan + 55495), "55495");
Assert.AreEqual (141, *(scan + 56504), "56504");
Assert.AreEqual (36, *(scan + 57513), "57513");
Assert.AreEqual (39, *(scan + 58522), "58522");
Assert.AreEqual (25, *(scan + 59531), "59531");
Assert.AreEqual (44, *(scan + 60540), "60540");
Assert.AreEqual (12, *(scan + 61549), "61549");
Assert.AreEqual (161, *(scan + 62558), "62558");
Assert.AreEqual (179, *(scan + 63567), "63567");
Assert.AreEqual (181, *(scan + 64576), "64576");
Assert.AreEqual (165, *(scan + 65585), "65585");
Assert.AreEqual (182, *(scan + 66594), "66594");
Assert.AreEqual (186, *(scan + 67603), "67603");
Assert.AreEqual (201, *(scan + 68612), "68612");
Assert.AreEqual (49, *(scan + 69621), "69621");
Assert.AreEqual (161, *(scan + 70630), "70630");
Assert.AreEqual (140, *(scan + 71639), "71639");
Assert.AreEqual (2, *(scan + 72648), "72648");
Assert.AreEqual (15, *(scan + 73657), "73657");
Assert.AreEqual (33, *(scan + 74666), "74666");
Assert.AreEqual (17, *(scan + 75675), "75675");
Assert.AreEqual (0, *(scan + 76684), "76684");
Assert.AreEqual (47, *(scan + 77693), "77693");
Assert.AreEqual (4, *(scan + 78702), "78702");
Assert.AreEqual (142, *(scan + 79711), "79711");
Assert.AreEqual (151, *(scan + 80720), "80720");
Assert.AreEqual (124, *(scan + 81729), "81729");
Assert.AreEqual (81, *(scan + 82738), "82738");
Assert.AreEqual (214, *(scan + 83747), "83747");
Assert.AreEqual (217, *(scan + 84756), "84756");
Assert.AreEqual (30, *(scan + 85765), "85765");
Assert.AreEqual (185, *(scan + 86774), "86774");
Assert.AreEqual (200, *(scan + 87783), "87783");
Assert.AreEqual (37, *(scan + 88792), "88792");
Assert.AreEqual (2, *(scan + 89801), "89801");
Assert.AreEqual (41, *(scan + 90810), "90810");
Assert.AreEqual (16, *(scan + 91819), "91819");
Assert.AreEqual (0, *(scan + 92828), "92828");
Assert.AreEqual (146, *(scan + 93837), "93837");
Assert.AreEqual (163, *(scan + 94846), "94846");
#endif
}
}
finally {
bmp.UnlockBits (data);
}
}
}
/* Checks bitmap features on a know 32-bits bitmap (codec)*/
[Test]
public void Bitmap32bitFeatures ()
public void Bitmap32bitFeatures()
{
string sInFile = getInFile ("bitmaps/almogaver32bits.bmp");
using (Bitmap bmp = new Bitmap (sInFile)) {
GraphicsUnit unit = GraphicsUnit.World;
RectangleF rect = bmp.GetBounds (ref unit);
Bitmap bmp = new Bitmap(sInFile);
RectangleF rect;
GraphicsUnit unit = GraphicsUnit.World;
rect = bmp.GetBounds(ref unit);
Assert.AreEqual (173, bmp.Width, "bmp.Width");
Assert.AreEqual (183, bmp.Height, "bmp.Height");
Assert.AreEqual (0, rect.X, "rect.X");
Assert.AreEqual (0, rect.Y, "rect.Y");
Assert.AreEqual (173, rect.Width, "rect.Width");
Assert.AreEqual (183, rect.Height, "rect.Height");
Assert.AreEqual (173, bmp.Size.Width, "bmp.Size.Width");
Assert.AreEqual (183, bmp.Size.Height, "bmp.Size.Height");
}
Assert.AreEqual (173, bmp.Width);
Assert.AreEqual (183, bmp.Height);
Assert.AreEqual (0, rect.X);
Assert.AreEqual (0, rect.Y);
Assert.AreEqual (173, rect.Width);
Assert.AreEqual (183, rect.Height);
Assert.AreEqual (173, bmp.Size.Width);
Assert.AreEqual (183, bmp.Size.Height);
}
[Test]
[Category ("NotWorking")]
public void Bitmap32bitPixels ()
{
string sInFile = getInFile ("bitmaps/almogaver32bits.bmp");
using (Bitmap bmp = new Bitmap (sInFile)) {
#if false
for (int x = 0; x < bmp.Width; x += 32) {
for (int y = 0; y < bmp.Height; y += 32)
Console.WriteLine ("\t\t\t\tAssert.AreEqual ({0}, bmp.GetPixel ({1}, {2}).ToArgb (), \"{1},{2}\");", bmp.GetPixel (x, y).ToArgb (), x, y);
}
#else
// sampling values from a well known bitmap
Assert.AreEqual (-1579559, bmp.GetPixel (0, 0).ToArgb (), "0,0");
Assert.AreEqual (-1645353, bmp.GetPixel (0, 32).ToArgb (), "0,32");
Assert.AreEqual (-461332, bmp.GetPixel (0, 64).ToArgb (), "0,64");
Assert.AreEqual (-330005, bmp.GetPixel (0, 96).ToArgb (), "0,96");
Assert.AreEqual (-2237489, bmp.GetPixel (0, 128).ToArgb (), "0,128");
Assert.AreEqual (-1251105, bmp.GetPixel (0, 160).ToArgb (), "0,160");
Assert.AreEqual (-3024947, bmp.GetPixel (32, 0).ToArgb (), "32,0");
Assert.AreEqual (-2699070, bmp.GetPixel (32, 32).ToArgb (), "32,32");
Assert.AreEqual (-2366734, bmp.GetPixel (32, 64).ToArgb (), "32,64");
Assert.AreEqual (-4538413, bmp.GetPixel (32, 96).ToArgb (), "32,96");
Assert.AreEqual (-6116681, bmp.GetPixel (32, 128).ToArgb (), "32,128");
Assert.AreEqual (-7369076, bmp.GetPixel (32, 160).ToArgb (), "32,160");
Assert.AreEqual (-13024729, bmp.GetPixel (64, 0).ToArgb (), "64,0");
Assert.AreEqual (-7174020, bmp.GetPixel (64, 32).ToArgb (), "64,32");
Assert.AreEqual (-51, bmp.GetPixel (64, 64).ToArgb (), "64,64");
Assert.AreEqual (-16053503, bmp.GetPixel (64, 96).ToArgb (), "64,96");
Assert.AreEqual (-8224431, bmp.GetPixel (64, 128).ToArgb (), "64,128");
Assert.AreEqual (-16579326, bmp.GetPixel (64, 160).ToArgb (), "64,160");
Assert.AreEqual (-2502457, bmp.GetPixel (96, 0).ToArgb (), "96,0");
Assert.AreEqual (-9078395, bmp.GetPixel (96, 32).ToArgb (), "96,32");
Assert.AreEqual (-12696508, bmp.GetPixel (96, 64).ToArgb (), "96,64");
Assert.AreEqual (-70772, bmp.GetPixel (96, 96).ToArgb (), "96,96");
Assert.AreEqual (-4346279, bmp.GetPixel (96, 128).ToArgb (), "96,128");
Assert.AreEqual (-11583193, bmp.GetPixel (96, 160).ToArgb (), "96,160");
Assert.AreEqual (-724763, bmp.GetPixel (128, 0).ToArgb (), "128,0");
Assert.AreEqual (-7238268, bmp.GetPixel (128, 32).ToArgb (), "128,32");
Assert.AreEqual (-2169612, bmp.GetPixel (128, 64).ToArgb (), "128,64");
Assert.AreEqual (-3683883, bmp.GetPixel (128, 96).ToArgb (), "128,96");
Assert.AreEqual (-12892867, bmp.GetPixel (128, 128).ToArgb (), "128,128");
Assert.AreEqual (-3750464, bmp.GetPixel (128, 160).ToArgb (), "128,160");
Assert.AreEqual (-3222844, bmp.GetPixel (160, 0).ToArgb (), "160,0");
Assert.AreEqual (-65806, bmp.GetPixel (160, 32).ToArgb (), "160,32");
Assert.AreEqual (-2961726, bmp.GetPixel (160, 64).ToArgb (), "160,64");
Assert.AreEqual (-2435382, bmp.GetPixel (160, 96).ToArgb (), "160,96");
Assert.AreEqual (-2501944, bmp.GetPixel (160, 128).ToArgb (), "160,128");
Assert.AreEqual (-9211799, bmp.GetPixel (160, 160).ToArgb (), "160,160");
#endif
}
}
[Test]
public void Save ()
public void Save()
{
string sOutFile = "linerect" + getOutSufix() + ".bmp";
// Save
Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb);
Graphics gr = Graphics.FromImage (bmp);
using (Pen p = new Pen (Color.Red, 2)) {
gr.DrawLine (p, 10.0F, 10.0F, 90.0F, 90.0F);
gr.DrawRectangle (p, 10.0F, 10.0F, 80.0F, 80.0F);
}
try {
bmp.Save (sOutFile, ImageFormat.Bmp);
// Load
using (Bitmap bmpLoad = new Bitmap (sOutFile)) {
Color color = bmpLoad.GetPixel (10, 10);
Assert.AreEqual (Color.FromArgb (255, 255, 0, 0), color);
}
}
finally {
gr.Dispose ();
bmp.Dispose ();
try {
File.Delete (sOutFile);
}
catch {
}
}
Bitmap bmp = new Bitmap(100,100, PixelFormat.Format32bppRgb);
Graphics gr = Graphics.FromImage(bmp);
Pen p = new Pen(Color.Red, 2);
gr.DrawLine(p, 10.0F, 10.0F, 90.0F, 90.0F);
gr.DrawRectangle(p, 10.0F, 10.0F, 80.0F, 80.0F);
p.Dispose();
bmp.Save(sOutFile, ImageFormat.Bmp);
gr.Dispose();
bmp.Dispose();
// Load
Bitmap bmpLoad = new Bitmap(sOutFile);
Color color = bmpLoad.GetPixel(10,10);
//Assert.AreEqual (Color.FromArgb(255,255,0,0), color);
}
}
}
@@ -2,10 +2,14 @@
// ImageCodecInfo class testing unit
//
// Author:
//
// Jordi Mas i Hernàndez ([email protected])
//
// (C) 2004 Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -26,7 +30,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Drawing;
using System.Drawing.Imaging;
@@ -35,12 +38,13 @@ using System.Collections;
using System.Security.Permissions;
using System.Text.RegularExpressions;
namespace MonoTests.System.Drawing.Imaging {
namespace MonoTests.System.Drawing
{
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
public class ImageCodecInfoTest {
public class TestImageCodecInfo
{
Hashtable decoders;
Hashtable encoders;
@@ -1,12 +1,15 @@
//
// JpegCodec class testing unit
//
// Authors:
// Jordi Mas i Hernàndez ([email protected])
// Sebastien Pouliot <sebastien@ximian.com>
// Author:
//
// Jordi Mas i Hernàndez (jordi@ximian.com)
//
// (C) 2004 Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -27,7 +30,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Drawing;
using System.Drawing.Imaging;
@@ -35,255 +37,97 @@ using NUnit.Framework;
using System.IO;
using System.Security.Permissions;
namespace MonoTests.System.Drawing.Imaging {
namespace MonoTests.System.Drawing
{
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
public class JpegCodecTest {
/* Get suffix to add to the filename */
internal string getOutSufix ()
public class TestJpegCodec
{
[TearDown]
public void Clean() {}
[SetUp]
public void GetReady()
{
string s;
int p = (int) Environment.OSVersion.Platform;
if ((p == 4) || (p == 128))
s = "-unix";
else
s = "-windows";
if (Type.GetType ("Mono.Runtime", false) == null)
s += "-msnet";
else
s += "-mono";
return s;
}
/* Get suffix to add to the filename */
internal string getOutSufix()
{
if (Environment.GetEnvironmentVariable("MSNet")==null)
return "-mono";
return "";
}
/* Get the input directory depending on the runtime*/
internal string getInFile (string file)
internal string getInFile(string file)
{
string sRslt = Path.GetFullPath ("../System.Drawing/" + file);
string sRslt, local;
local = "../System.Drawing/" + file;
sRslt = Path.GetFullPath (local);
if (!File.Exists (sRslt))
if (File.Exists(sRslt)==false)
sRslt = "Test/System.Drawing/" + file;
return sRslt;
}
/* Checks bitmap features on a know 24-bits bitmap */
[Test]
public void Bitmap24bitFeatures ()
//[Test]
public void Bitmap24bitFeatures()
{
string sInFile = getInFile ("bitmaps/nature24bits.jpg");
using (Bitmap bmp = new Bitmap (sInFile)) {
GraphicsUnit unit = GraphicsUnit.World;
RectangleF rect = bmp.GetBounds (ref unit);
Bitmap bmp = new Bitmap(sInFile);
RectangleF rect;
GraphicsUnit unit = GraphicsUnit.World;
rect = bmp.GetBounds(ref unit);
Assert.AreEqual (PixelFormat.Format24bppRgb, bmp.PixelFormat, "PixelFormat");
Assert.AreEqual (110, bmp.Width, "bmp.Width");
Assert.AreEqual (100, bmp.Height, "bmp.Height");
Assert.AreEqual (0, rect.X, "rect.X");
Assert.AreEqual (0, rect.Y, "rect.Y");
Assert.AreEqual (110, rect.Width, "rect.Width");
Assert.AreEqual (100, rect.Height, "rect.Height");
Assert.AreEqual (110, bmp.Size.Width, "bmp.Size.Width");
Assert.AreEqual (100, bmp.Size.Height, "bmp.Size.Height");
}
Assert.AreEqual (PixelFormat.Format24bppRgb, bmp.PixelFormat);
Assert.AreEqual (110, bmp.Width);
Assert.AreEqual (100, bmp.Height);
Assert.AreEqual (0, rect.X);
Assert.AreEqual (0, rect.Y);
Assert.AreEqual (110, rect.Width);
Assert.AreEqual (100, rect.Height);
Assert.AreEqual (110, bmp.Size.Width);
Assert.AreEqual (100, bmp.Size.Height);
}
[Test]
[Category ("NotWorking")]
public void Bitmap24bitPixels ()
{
string sInFile = getInFile ("bitmaps/nature24bits.jpg");
using (Bitmap bmp = new Bitmap (sInFile)) {
#if false
for (int x = 0; x < bmp.Width; x += 32) {
for (int y = 0; y < bmp.Height; y += 32)
Console.WriteLine ("\t\t\t\tAssert.AreEqual ({0}, bmp.GetPixel ({1}, {2}).ToArgb (), \"{1},{2}\");", bmp.GetPixel (x, y).ToArgb (), x, y);
}
#else
// sampling values from a well known bitmap
Assert.AreEqual (-10447423, bmp.GetPixel (0, 0).ToArgb (), "0,0");
Assert.AreEqual (-12171958, bmp.GetPixel (0, 32).ToArgb (), "0,32");
Assert.AreEqual (-15192259, bmp.GetPixel (0, 64).ToArgb (), "0,64");
Assert.AreEqual (-15131110, bmp.GetPixel (0, 96).ToArgb (), "0,96");
Assert.AreEqual (-395272, bmp.GetPixel (32, 0).ToArgb (), "32,0");
Assert.AreEqual (-10131359, bmp.GetPixel (32, 32).ToArgb (), "32,32");
Assert.AreEqual (-10984322, bmp.GetPixel (32, 64).ToArgb (), "32,64");
Assert.AreEqual (-11034683, bmp.GetPixel (32, 96).ToArgb (), "32,96");
Assert.AreEqual (-1, bmp.GetPixel (64, 0).ToArgb (), "64,0");
Assert.AreEqual (-3163242, bmp.GetPixel (64, 32).ToArgb (), "64,32");
Assert.AreEqual (-7311538, bmp.GetPixel (64, 64).ToArgb (), "64,64");
Assert.AreEqual (-12149780, bmp.GetPixel (64, 96).ToArgb (), "64,96");
Assert.AreEqual (-1, bmp.GetPixel (96, 0).ToArgb (), "96,0");
Assert.AreEqual (-8224378, bmp.GetPixel (96, 32).ToArgb (), "96,32");
Assert.AreEqual (-11053718, bmp.GetPixel (96, 64).ToArgb (), "96,64");
Assert.AreEqual (-12944166, bmp.GetPixel (96, 96).ToArgb (), "96,96");
#endif
}
}
[Test]
[Category ("NotWorking")]
public void Bitmap24bitData ()
{
string sInFile = getInFile ("bitmaps/almogaver24bits.bmp");
using (Bitmap bmp = new Bitmap (sInFile)) {
BitmapData data = bmp.LockBits (new Rectangle (0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
try {
Assert.AreEqual (bmp.Height, data.Height, "Height");
Assert.AreEqual (bmp.Width, data.Width, "Width");
Assert.AreEqual (PixelFormat.Format24bppRgb, data.PixelFormat, "PixelFormat");
int size = data.Height * data.Stride;
unsafe {
byte* scan = (byte*) data.Scan0;
#if false
// 1009 is the first prime after 1000 (so we're not affected by a recurring pattern)
for (int p = 0; p < size; p += 1009) {
Console.WriteLine ("\t\t\t\t\t\tAssert.AreEqual ({0}, *(scan + {1}), \"{1}\");", *(scan + p), p);
}
#else
// sampling values from a well known bitmap
Assert.AreEqual (217, *(scan + 0), "0");
Assert.AreEqual (192, *(scan + 1009), "1009");
Assert.AreEqual (210, *(scan + 2018), "2018");
Assert.AreEqual (196, *(scan + 3027), "3027");
Assert.AreEqual (216, *(scan + 4036), "4036");
Assert.AreEqual (215, *(scan + 5045), "5045");
Assert.AreEqual (218, *(scan + 6054), "6054");
Assert.AreEqual (218, *(scan + 7063), "7063");
Assert.AreEqual (95, *(scan + 8072), "8072");
Assert.AreEqual (9, *(scan + 9081), "9081");
Assert.AreEqual (247, *(scan + 10090), "10090");
Assert.AreEqual (161, *(scan + 11099), "11099");
Assert.AreEqual (130, *(scan + 12108), "12108");
Assert.AreEqual (131, *(scan + 13117), "13117");
Assert.AreEqual (175, *(scan + 14126), "14126");
Assert.AreEqual (217, *(scan + 15135), "15135");
Assert.AreEqual (201, *(scan + 16144), "16144");
Assert.AreEqual (183, *(scan + 17153), "17153");
Assert.AreEqual (236, *(scan + 18162), "18162");
Assert.AreEqual (242, *(scan + 19171), "19171");
Assert.AreEqual (125, *(scan + 20180), "20180");
Assert.AreEqual (193, *(scan + 21189), "21189");
Assert.AreEqual (227, *(scan + 22198), "22198");
Assert.AreEqual (44, *(scan + 23207), "23207");
Assert.AreEqual (230, *(scan + 24216), "24216");
Assert.AreEqual (224, *(scan + 25225), "25225");
Assert.AreEqual (164, *(scan + 26234), "26234");
Assert.AreEqual (43, *(scan + 27243), "27243");
Assert.AreEqual (200, *(scan + 28252), "28252");
Assert.AreEqual (255, *(scan + 29261), "29261");
Assert.AreEqual (226, *(scan + 30270), "30270");
Assert.AreEqual (230, *(scan + 31279), "31279");
Assert.AreEqual (178, *(scan + 32288), "32288");
Assert.AreEqual (224, *(scan + 33297), "33297");
Assert.AreEqual (233, *(scan + 34306), "34306");
Assert.AreEqual (212, *(scan + 35315), "35315");
Assert.AreEqual (153, *(scan + 36324), "36324");
Assert.AreEqual (143, *(scan + 37333), "37333");
Assert.AreEqual (215, *(scan + 38342), "38342");
Assert.AreEqual (116, *(scan + 39351), "39351");
Assert.AreEqual (26, *(scan + 40360), "40360");
Assert.AreEqual (28, *(scan + 41369), "41369");
Assert.AreEqual (75, *(scan + 42378), "42378");
Assert.AreEqual (50, *(scan + 43387), "43387");
Assert.AreEqual (244, *(scan + 44396), "44396");
Assert.AreEqual (191, *(scan + 45405), "45405");
Assert.AreEqual (200, *(scan + 46414), "46414");
Assert.AreEqual (197, *(scan + 47423), "47423");
Assert.AreEqual (232, *(scan + 48432), "48432");
Assert.AreEqual (186, *(scan + 49441), "49441");
Assert.AreEqual (210, *(scan + 50450), "50450");
Assert.AreEqual (215, *(scan + 51459), "51459");
Assert.AreEqual (155, *(scan + 52468), "52468");
Assert.AreEqual (56, *(scan + 53477), "53477");
Assert.AreEqual (149, *(scan + 54486), "54486");
Assert.AreEqual (137, *(scan + 55495), "55495");
Assert.AreEqual (141, *(scan + 56504), "56504");
Assert.AreEqual (36, *(scan + 57513), "57513");
Assert.AreEqual (39, *(scan + 58522), "58522");
Assert.AreEqual (25, *(scan + 59531), "59531");
Assert.AreEqual (44, *(scan + 60540), "60540");
Assert.AreEqual (12, *(scan + 61549), "61549");
Assert.AreEqual (161, *(scan + 62558), "62558");
Assert.AreEqual (179, *(scan + 63567), "63567");
Assert.AreEqual (181, *(scan + 64576), "64576");
Assert.AreEqual (165, *(scan + 65585), "65585");
Assert.AreEqual (182, *(scan + 66594), "66594");
Assert.AreEqual (186, *(scan + 67603), "67603");
Assert.AreEqual (201, *(scan + 68612), "68612");
Assert.AreEqual (49, *(scan + 69621), "69621");
Assert.AreEqual (161, *(scan + 70630), "70630");
Assert.AreEqual (140, *(scan + 71639), "71639");
Assert.AreEqual (2, *(scan + 72648), "72648");
Assert.AreEqual (15, *(scan + 73657), "73657");
Assert.AreEqual (33, *(scan + 74666), "74666");
Assert.AreEqual (17, *(scan + 75675), "75675");
Assert.AreEqual (0, *(scan + 76684), "76684");
Assert.AreEqual (47, *(scan + 77693), "77693");
Assert.AreEqual (4, *(scan + 78702), "78702");
Assert.AreEqual (142, *(scan + 79711), "79711");
Assert.AreEqual (151, *(scan + 80720), "80720");
Assert.AreEqual (124, *(scan + 81729), "81729");
Assert.AreEqual (81, *(scan + 82738), "82738");
Assert.AreEqual (214, *(scan + 83747), "83747");
Assert.AreEqual (217, *(scan + 84756), "84756");
Assert.AreEqual (30, *(scan + 85765), "85765");
Assert.AreEqual (185, *(scan + 86774), "86774");
Assert.AreEqual (200, *(scan + 87783), "87783");
Assert.AreEqual (37, *(scan + 88792), "88792");
Assert.AreEqual (2, *(scan + 89801), "89801");
Assert.AreEqual (41, *(scan + 90810), "90810");
Assert.AreEqual (16, *(scan + 91819), "91819");
Assert.AreEqual (0, *(scan + 92828), "92828");
Assert.AreEqual (146, *(scan + 93837), "93837");
Assert.AreEqual (163, *(scan + 94846), "94846");
#endif
}
}
finally {
bmp.UnlockBits (data);
}
}
}
[Test]
public void Save ()
//[Test]
public void Save()
{
string sOutFile = "linerect" + getOutSufix() + ".jpeg";
// Save
Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb);
Graphics gr = Graphics.FromImage (bmp);
using (Pen p = new Pen (Color.Red, 2)) {
gr.DrawLine (p, 10.0F, 10.0F, 90.0F, 90.0F);
gr.DrawRectangle (p, 10.0F, 10.0F, 80.0F, 80.0F);
}
try {
bmp.Save (sOutFile, ImageFormat.Bmp);
// Load
using (Bitmap bmpLoad = new Bitmap (sOutFile)) {
Color color = bmpLoad.GetPixel (10, 10);
Assert.AreEqual (Color.FromArgb (255, 255, 0, 0), color);
}
}
finally {
gr.Dispose ();
bmp.Dispose ();
try {
File.Delete (sOutFile);
}
catch {
}
}
Bitmap bmp = new Bitmap(100,100, PixelFormat.Format32bppRgb);
Graphics gr = Graphics.FromImage(bmp);
Pen p = new Pen(Color.Red, 2);
gr.DrawLine(p, 10.0F, 10.0F, 90.0F, 90.0F);
gr.DrawRectangle(p, 10.0F, 10.0F, 80.0F, 80.0F);
p.Dispose();
bmp.Save(sOutFile, ImageFormat.Bmp);
gr.Dispose();
bmp.Dispose();
// Load
Bitmap bmpLoad = new Bitmap(sOutFile);
Color color = bmpLoad.GetPixel(10,10);
//Assert.AreEqual (Color.FromArgb(255,255,0,0), color);
}
}
}
@@ -1,46 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "Exocortex.DSP20.v1.J2EE", "DrawingTest\Exocortex.DSP\src\Exocortex.DSP20.v1.J2EE.vmwcsproj", "{995DE32D-06AB-4926-97FF-565B9205D5F8}"
EndProject
Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "DrawingTestHelper20.J2EE", "DrawingTest\DrawingTestHelper\DrawingTestHelper20.J2EE.vmwcsproj", "{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}"
EndProject
Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "Test20.J2EE", "Test20.J2EE.vmwcsproj", "{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Java|Any CPU = Debug_Java|Any CPU
Debug_Java20|Any CPU = Debug_Java20|Any CPU
Release_Java|Any CPU = Release_Java|Any CPU
Release_Java20|Any CPU = Release_Java20|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{995DE32D-06AB-4926-97FF-565B9205D5F8}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU
{995DE32D-06AB-4926-97FF-565B9205D5F8}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU
{995DE32D-06AB-4926-97FF-565B9205D5F8}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU
{995DE32D-06AB-4926-97FF-565B9205D5F8}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU
{995DE32D-06AB-4926-97FF-565B9205D5F8}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU
{995DE32D-06AB-4926-97FF-565B9205D5F8}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU
{995DE32D-06AB-4926-97FF-565B9205D5F8}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU
{995DE32D-06AB-4926-97FF-565B9205D5F8}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU
{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU
{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU
{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU
{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU
{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU
{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU
{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU
{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU
{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU
{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU
{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU
{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU
{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU
{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU
{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU
{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -1,32 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test20", "Test20.csproj", "{0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DrawingTestHelper20", "DrawingTest\DrawingTestHelper\DrawingTestHelper20.csproj", "{0E97F734-51B9-497B-9259-B6999FD87BDF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exocortex.DSP20.v1", "DrawingTest\Exocortex.DSP\src\Exocortex.DSP20.v1.csproj", "{A9553E24-D07E-44FE-92FB-8C1D3D3C744E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}.Release|Any CPU.Build.0 = Release|Any CPU
{0E97F734-51B9-497B-9259-B6999FD87BDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E97F734-51B9-497B-9259-B6999FD87BDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E97F734-51B9-497B-9259-B6999FD87BDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E97F734-51B9-497B-9259-B6999FD87BDF}.Release|Any CPU.Build.0 = Release|Any CPU
{A9553E24-D07E-44FE-92FB-8C1D3D3C744E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9553E24-D07E-44FE-92FB-8C1D3D3C744E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9553E24-D07E-44FE-92FB-8C1D3D3C744E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9553E24-D07E-44FE-92FB-8C1D3D3C744E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -1,23 +1,3 @@
2006-08-31 Sebastien Pouliot <[email protected]>
* TextureBrushTest.cs: Remove NotWorking from rotation test case.
2006-08-30 Sebastien Pouliot <[email protected]>
* TextureBrushTest.cs: More test cases when only a partial part of the
image is being used and for cloning the brush.
2006-08-28 Sebastien Pouliot <[email protected]>
* GDIPlusTest.cs: Added more parameters checks for TextureBrush calls.
* TestBitmap.cs: Fix test case for big endian arch (Marshal.ReadInt32)
2006-08-27 Sebastien Pouliot <[email protected]>
* ColorConverter.cs: Add a new test case for a color with a integer
part that is too large to convert into an int.
* ColorTranslator.cs: Add more test cases for FromHtml method.
2006-08-25 Sebastien Pouliot <[email protected]>
* GDIPlusTest.cs: Fix ImageAttributes test case.
@@ -441,13 +441,6 @@ namespace MonoTests.System.Drawing {
public void GetStandardValuesExclusive () {
Assert.AreEqual (false, colconv.GetStandardValuesExclusive ());
}
[Test]
[ExpectedException (typeof (Exception))]
public void ConvertFromString_FromHtml_PoundTooLarge ()
{
colconv.ConvertFromString ("#100000000");
}
}
}
@@ -1,28 +1,3 @@
//
// ColorTranslator class testing unit
//
// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Drawing;
using System.Security.Permissions;
@@ -33,59 +8,6 @@ namespace MonoTests.System.Drawing {
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
public class ColorTranslatorFixture {
[Test]
public void FromHtml_Null ()
{
Assert.AreEqual (0, ColorTranslator.FromHtml (null).ToArgb ());
}
[Test]
public void FromHtml_Empty ()
{
Assert.AreEqual (0, ColorTranslator.FromHtml (String.Empty).ToArgb ());
}
[Test]
public void FromHtml_Int ()
{
Assert.AreEqual (-1, ColorTranslator.FromHtml ("-1").ToArgb (), "-1");
Assert.AreEqual (0, ColorTranslator.FromHtml ("0").ToArgb (), "0");
Assert.AreEqual (1, ColorTranslator.FromHtml ("1").ToArgb (), "1");
}
[Test]
public void FromHtml_PoundInt ()
{
Assert.AreEqual (0, ColorTranslator.FromHtml ("#0").ToArgb (), "#0");
Assert.AreEqual (1, ColorTranslator.FromHtml ("#1").ToArgb (), "#1");
Assert.AreEqual (255, ColorTranslator.FromHtml ("#FF").ToArgb (), "#FF");
Assert.AreEqual (65535, ColorTranslator.FromHtml ("#FFFF").ToArgb (), "#FFFF");
Assert.AreEqual (-1, ColorTranslator.FromHtml ("#FFFFFF").ToArgb (), "#FFFFFF");
Assert.AreEqual (-1, ColorTranslator.FromHtml ("#FFFFFFFF").ToArgb (), "#FFFFFFFF");
}
[Test]
[ExpectedException (typeof (Exception))]
public void FromHtml_PoundNegative ()
{
ColorTranslator.FromHtml ("#-1");
}
[Test]
[ExpectedException (typeof (Exception))]
public void FromHtml_PoundTooLarge ()
{
ColorTranslator.FromHtml ("#100000000");
}
[Test]
[ExpectedException (typeof (Exception))]
public void FromHtml_Unkown ()
{
ColorTranslator.FromHtml ("unknown-color-test");
}
[Test]
public void FromHtml ()
{
@@ -867,10 +867,6 @@ namespace MonoTests.System.Drawing {
Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipCreateTexture2 (IntPtr.Zero, (WrapMode) Int32.MinValue, 0, 0, 10, 10, out brush), "GdipCreateTexture2-wrapmode");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 0, 0, 0, 10, out brush), "GdipCreateTexture2-width");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 0, 0, 10, 0, out brush), "GdipCreateTexture2-height");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, -1, 0, 0, 10, out brush), "GdipCreateTexture2-x");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 0, -1, 10, 0, out brush), "GdipCreateTexture2-y");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 1, 0, 10, 10, out brush), "GdipCreateTexture2-too-wide");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 0, 1, 10, 10, out brush), "GdipCreateTexture2-too-tall");
Assert.AreEqual (Status.Ok, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 0, 0, 10, 10, out brush), "GdipCreateTexture2");
WrapMode wm;
@@ -902,10 +898,6 @@ namespace MonoTests.System.Drawing {
Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipCreateTextureIA (IntPtr.Zero, IntPtr.Zero, 0, 0, 10, 10, out brush), "GdipCreateTexture2-image");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 0, 0, 0, 10, out brush), "GdipCreateTexture2-width");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 0, 0, 10, 0, out brush), "GdipCreateTexture2-height");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, -1, 0, 10, 10, out brush), "GdipCreateTexture2-x");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 0, -1, 10, 10, out brush), "GdipCreateTexture2-y");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 1, 0, 10, 10, out brush), "GdipCreateTexture2-too-wide");
Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 0, 1, 10, 10, out brush), "GdipCreateTexture2-too-tall");
Assert.AreEqual (Status.Ok, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 0, 0, 10, 10, out brush), "GdipCreateTexture2");
// TODO - handle ImageAttribute in the tests
@@ -476,23 +476,14 @@ namespace MonoTests.System.Drawing{
Color red = Color.FromArgb (Color.Red.A, Color.Red.R, Color.Red.G, Color.Red.B);
Color blue = Color.FromArgb (Color.Blue.A, Color.Blue.R, Color.Blue.G, Color.Blue.B);
using (Bitmap bmp = new Bitmap (1, 1, PixelFormat.Format32bppRgb))
using (Bitmap bmp = new Bitmap (1, 1, PixelFormat.Format24bppRgb))
{
bmp.SetPixel (0, 0, red);
pixel_colour = bmp.GetPixel (0, 0);
Assert.AreEqual (red, pixel_colour, "Set/Get-Red");
data = bmp.LockBits (new Rectangle (0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
// Marshal follows CPU endianess
if (BitConverter.IsLittleEndian) {
pixel_value = Marshal.ReadInt32 (data.Scan0);
} else {
pixel_value = Marshal.ReadByte (data.Scan0, 0);
pixel_value |= Marshal.ReadByte (data.Scan0, 1) << 8;
pixel_value |= Marshal.ReadByte (data.Scan0, 2) << 16;
pixel_value |= Marshal.ReadByte (data.Scan0, 3) << 24;
}
pixel_value = Marshal.ReadInt32 (data.Scan0);
pixel_colour = Color.FromArgb (pixel_value);
// Disregard alpha information in the test
@@ -44,7 +44,6 @@ namespace MonoTests.System.Drawing {
private Rectangle rect;
private RectangleF rectf;
private ImageAttributes attr;
private Bitmap bmp;
[TestFixtureSetUp]
public void FixtureSetUp ()
@@ -53,14 +52,11 @@ namespace MonoTests.System.Drawing {
rect = new Rectangle (0, 0, 10, 10);
rectf = new RectangleF (0, 0, 10, 10);
attr = new ImageAttributes ();
bmp = new Bitmap (50, 50);
}
private void Common (TextureBrush t, WrapMode wm)
{
using (Image img = t.Image) {
Assert.IsNotNull (img, "Image");
}
Assert.IsNotNull (t.Image, "Image");
Assert.IsFalse (Object.ReferenceEquals (image, t.Image), "Image-Equals");
Assert.IsTrue (t.Transform.IsIdentity, "Transform.IsIdentity");
Assert.AreEqual (wm, t.WrapMode, "WrapMode");
@@ -233,31 +229,6 @@ namespace MonoTests.System.Drawing {
new TextureBrush (image, (WrapMode) Int32.MinValue, rectf);
}
[Test]
public void TextureBush_RectangleInsideBitmap ()
{
Rectangle r = new Rectangle (10, 10, 40, 40);
Assert.IsTrue (r.Y + r.Height <= bmp.Height, "Height");
Assert.IsTrue (r.X + r.Width <= bmp.Width, "Width");
TextureBrush b = new TextureBrush (bmp, r);
using (Image img = b.Image) {
Assert.AreEqual (r.Height, img.Height, "Image.Height");
Assert.AreEqual (r.Width, img.Width, "Image.Width");
}
Assert.IsTrue (b.Transform.IsIdentity, "Transform.IsIdentity");
Assert.AreEqual (WrapMode.Tile, b.WrapMode, "WrapMode");
}
[Test]
[ExpectedException (typeof (OutOfMemoryException))]
public void TextureBush_RectangleOutsideBitmap ()
{
Rectangle r = new Rectangle (50, 50, 50, 50);
Assert.IsFalse (r.Y + r.Height <= bmp.Height, "Height");
Assert.IsFalse (r.X + r.Width <= bmp.Width, "Width");
new TextureBrush (bmp, r);
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Transform_Null ()
@@ -291,14 +262,6 @@ namespace MonoTests.System.Drawing {
new TextureBrush (image).WrapMode = (WrapMode)Int32.MinValue;
}
[Test]
public void Clone ()
{
TextureBrush t = new TextureBrush (image);
TextureBrush clone = (TextureBrush) t.Clone ();
Common (clone, t.WrapMode);
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Dispose_Clone ()
@@ -367,6 +330,7 @@ namespace MonoTests.System.Drawing {
}
[Test]
[NUnit.Framework.Category ("NotWorking")]
public void RotateTransform ()
{
TextureBrush t = new TextureBrush (image);
@@ -1,171 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">
<OutputPath>DrawingTest\Test\bin\Debug_Java20\</OutputPath>
<DefineConstants>TRACE;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<SkipValidation>false</SkipValidation>
<KeepIntermediate>false</KeepIntermediate>
<GHProjectType>1</GHProjectType>
<PreCompile>false</PreCompile>
<AdditionalClassPath>
</AdditionalClassPath>
<ApplicationServerType>
</ApplicationServerType>
<Version>2.0</Version>
<JDKName>1.5.0_05</JDKName>
<TargetPlatform>0</TargetPlatform>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>DrawingTest\Test\bin\Debug_Java20\</OutputPath>
<DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<SkipValidation>True</SkipValidation>
<KeepIntermediate>False</KeepIntermediate>
<GHProjectType>1</GHProjectType>
<PreCompile>false</PreCompile>
<AdditionalClassPath>
</AdditionalClassPath>
<ApplicationServerType>
</ApplicationServerType>
<Version>2.0</Version>
<JDKName>1.5.0_05</JDKName>
<TargetPlatform>0</TargetPlatform>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>System.Drawing.Test</RootNamespace>
<AssemblyName>System.Drawing.Test20.J2EE</AssemblyName>
<JDKName>1.5.0_05</JDKName>
<GHProjectType>1</GHProjectType>
<Version>2.0</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug_Java\</OutputPath>
<DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<BaseAddress>285212672</BaseAddress>
<NoStdLib>false</NoStdLib>
<SkipValidation>True</SkipValidation>
<KeepIntermediate>False</KeepIntermediate>
<TargetPlatform>0</TargetPlatform>
<AdditionalClassPath>
</AdditionalClassPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release_Java\</OutputPath>
<DefineConstants>TRACE;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<BaseAddress>285212672</BaseAddress>
<NoStdLib>false</NoStdLib>
<SkipValidation>false</SkipValidation>
<KeepIntermediate>false</KeepIntermediate>
<TargetPlatform>0</TargetPlatform>
<AdditionalClassPath>
</AdditionalClassPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="J2SE.Helpers, Version=0.0.0.0, Culture=neutral">
<Private>False</Private>
</Reference>
<Reference Include="nunit.framework, Version=0.0.0.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>c:\cygwin\monobuild\mcs\nunit20\framework\bin\Debug_Java20\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="rt, Version=0.0.0.0, Culture=neutral">
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DrawingTest\Test\Bitmap.cs" />
<Compile Include="DrawingTest\Test\Brush.cs" />
<Compile Include="DrawingTest\Test\Graphics.cs" />
<Compile Include="DrawingTest\Test\GraphicsPath.cs" />
<Compile Include="DrawingTest\Test\GraphicsPathIterator.cs" />
<Compile Include="DrawingTest\Test\Image.cs" />
<Compile Include="DrawingTest\Test\Pen.cs" />
<Compile Include="DrawingTest\Test\Region.cs" />
<Compile Include="System.Drawing.Drawing2D\TestBlend.cs" />
<Compile Include="System.Drawing.Drawing2D\TestColorBlend.cs" />
<Compile Include="System.Drawing.Drawing2D\TestHatchBrush.cs" />
<Compile Include="System.Drawing.Imaging\TestBmpCodec.cs" />
<Compile Include="System.Drawing.Imaging\TestColorMatrix.cs" />
<Compile Include="System.Drawing.Imaging\TestImageAttributes.cs" />
<Compile Include="System.Drawing.Imaging\TestImageCodecInfo.cs" />
<Compile Include="System.Drawing.Imaging\TestJpegCodec.cs" />
<Compile Include="System.Drawing\ColorConverter.cs" />
<Compile Include="System.Drawing\ColorTranslator.cs" />
<Compile Include="System.Drawing\TestBitmap.cs" />
<Compile Include="System.Drawing\TestBrushes.cs" />
<Compile Include="System.Drawing\TestColor.cs" />
<Compile Include="System.Drawing\TestFont.cs" />
<Compile Include="System.Drawing\TestIcon.cs" />
<Compile Include="System.Drawing\TestIconConverter.cs" />
<Compile Include="System.Drawing\TestImageConverter.cs" />
<Compile Include="System.Drawing\TestImageFormatConverter.cs" />
<Compile Include="System.Drawing\TestPens.cs" />
<Compile Include="System.Drawing\TestPoint.cs" />
<Compile Include="System.Drawing\TestPointConverter.cs" />
<Compile Include="System.Drawing\TestPointF.cs" />
<Compile Include="System.Drawing\TestRectangle.cs" />
<Compile Include="System.Drawing\TestRectangleConverter.cs" />
<Compile Include="System.Drawing\TestRectangleF.cs" />
<Compile Include="System.Drawing\TestRegion.cs" />
<Compile Include="System.Drawing\TestSize.cs" />
<Compile Include="System.Drawing\TestSizeConverter.cs" />
<Compile Include="System.Drawing\TestSizeF.cs" />
<Compile Include="System.Drawing\TestSizeFConverter.cs" />
<Compile Include="System.Drawing\TestStringFormat.cs" />
<Compile Include="System.Drawing\TestSystemBrushes.cs" />
<Compile Include="System.Drawing\TestSystemPens.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="DrawingTest\Test\Bitmap1.bmp" />
<Content Include="DrawingTest\Test\Bitmap1.png" />
<Content Include="DrawingTest\Test\SampIcon.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="DrawingTest\DrawingTestHelper\DrawingTestHelper20.J2EE.vmwcsproj">
<Project>{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}</Project>
<Name>DrawingTestHelper20.J2EE</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />
<Import Project="$(GHROOT)\bin\Mainsoft.Common.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions>
<VisualStudio>
<UserProperties REFS-JarPath-nunit-framework="..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.jar" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\mscorlib.jar" REFS-JarPath-system="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.jar" REFS-JarPath-system-data="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Data.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Xml.jar" REFS-JarPath-rt="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" REFS-JarPath-j2se-helpers="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\J2SE.Helpers.jar" REFS-JarPath-system-drawing="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Drawing.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\jai_imageio.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\jai_core.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\jai_codec.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\clibwrapper_jiio.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\mlibwrapper_jai.jar" />
</VisualStudio>
</ProjectExtensions>
</Project>
-117
View File
@@ -1,117 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>System.Drawing.Test</RootNamespace>
<AssemblyName>System.Drawing.Test</AssemblyName>
<StartupObject>
</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>DrawingTest\Test\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>DrawingTest\Test\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\nunit20\framework\bin\Debug\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DrawingTest\Test\AssemblyInfo.cs" />
<Compile Include="DrawingTest\Test\Bitmap.cs" />
<Compile Include="DrawingTest\Test\Brush.cs" />
<Compile Include="DrawingTest\Test\Graphics.cs" />
<Compile Include="DrawingTest\Test\GraphicsPath.cs" />
<Compile Include="DrawingTest\Test\GraphicsPathIterator.cs" />
<Compile Include="DrawingTest\Test\Image.cs" />
<Compile Include="DrawingTest\Test\Pen.cs" />
<Compile Include="DrawingTest\Test\Region.cs" />
<Compile Include="System.Drawing.Drawing2D\TestBlend.cs" />
<Compile Include="System.Drawing.Drawing2D\TestColorBlend.cs" />
<Compile Include="System.Drawing.Drawing2D\TestHatchBrush.cs" />
<Compile Include="System.Drawing.Imaging\TestBmpCodec.cs" />
<Compile Include="System.Drawing.Imaging\TestColorMatrix.cs" />
<Compile Include="System.Drawing.Imaging\TestImageAttributes.cs" />
<Compile Include="System.Drawing.Imaging\TestImageCodecInfo.cs" />
<Compile Include="System.Drawing.Imaging\TestJpegCodec.cs" />
<Compile Include="System.Drawing\ColorConverter.cs" />
<Compile Include="System.Drawing\ColorTranslator.cs" />
<Compile Include="System.Drawing\TestBitmap.cs" />
<Compile Include="System.Drawing\TestBrushes.cs" />
<Compile Include="System.Drawing\TestColor.cs" />
<Compile Include="System.Drawing\TestFont.cs" />
<Compile Include="System.Drawing\TestIcon.cs" />
<Compile Include="System.Drawing\TestIconConverter.cs" />
<Compile Include="System.Drawing\TestImageConverter.cs" />
<Compile Include="System.Drawing\TestImageFormatConverter.cs" />
<Compile Include="System.Drawing\TestPens.cs" />
<Compile Include="System.Drawing\TestPoint.cs" />
<Compile Include="System.Drawing\TestPointConverter.cs" />
<Compile Include="System.Drawing\TestPointF.cs" />
<Compile Include="System.Drawing\TestRectangle.cs" />
<Compile Include="System.Drawing\TestRectangleConverter.cs" />
<Compile Include="System.Drawing\TestRectangleF.cs" />
<Compile Include="System.Drawing\TestRegion.cs" />
<Compile Include="System.Drawing\TestSize.cs" />
<Compile Include="System.Drawing\TestSizeConverter.cs" />
<Compile Include="System.Drawing\TestSizeF.cs" />
<Compile Include="System.Drawing\TestStringFormat.cs" />
<Compile Include="System.Drawing\TestSystemBrushes.cs" />
<Compile Include="System.Drawing\TestSystemPens.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="DrawingTest\Test\Bitmap1.png" />
<Content Include="DrawingTest\Test\SampIcon.ico" />
<Content Include="System.Drawing\bitmaps\1bit.png" />
<Content Include="System.Drawing\bitmaps\4bit.png" />
<Content Include="System.Drawing\bitmaps\almogaver-os2.bmp" />
<Content Include="System.Drawing\bitmaps\almogaver1bit.bmp" />
<Content Include="System.Drawing\bitmaps\almogaver24bits.bmp" />
<Content Include="System.Drawing\bitmaps\almogaver24bits1.bmp" />
<Content Include="System.Drawing\bitmaps\almogaver32bits.bmp" />
<Content Include="System.Drawing\bitmaps\almogaver8bits.bmp" />
<Content Include="System.Drawing\bitmaps\maketransparent.bmp" />
<Content Include="System.Drawing\bitmaps\nature24bits.gif" />
<Content Include="System.Drawing\bitmaps\nature24bits.jpg" />
<Content Include="System.Drawing\bitmaps\smiley.ico" />
<Content Include="System.Drawing\bitmaps\VisualPng.ico" />
<Content Include="System.Drawing\bitmaps\VisualPng1.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="DrawingTest\DrawingTestHelper\DrawingTestHelper20.csproj">
<Project>{0E97F734-51B9-497B-9259-B6999FD87BDF}</Project>
<Name>DrawingTestHelper20</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
+29 -44
View File
@@ -15,7 +15,9 @@ REM ********************************************************
IF "%1"=="" GOTO USAGE
IF "%VMW_HOME%"=="" GOTO ENVIRONMENT_EXCEPTION
IF "%JAVA_HOME%"=="" GOTO ENVIRONMENT_EXCEPTION
IF "%GH_HOME%"=="" GOTO ENVIRONMENT_EXCEPTION
REM ********************************************************
REM Set parameters
@@ -27,21 +29,12 @@ set RUNNING_FIXTURE=%3
set RUNNING_DIR=%~4
set BACK_TO_ROOT_DIR=%~5
set TEST_J2EE_SOLUTION=Test\System.Drawing.Test20.J2EE.sln
set TEST_NET_SOLUTION=Test\System.Drawing.Test20.sln
set TEST_J2EE_ASSEMBLY=System.Drawing.Test20.J2EE.jar
set TEST_NET_ASSEMBLY=System.Drawing.Test.dll
set PROJECT_J2EE_CONFIGURATION=Debug_Java20
set PROJECT_NET_CONFIGURATION=Debug
set NUNIT_CONSOLE_PATH="C:\Program Files\NUnit-Net-2.0 2.2.8\bin"
set JAVA_HOME=%VMW_HOME%\jre5
REM ********************************************************
REM @echo Set environment
REM ********************************************************
set JGAC_PATH=%VMW_HOME%\jgac\vmw4j2ee_110\
set JGAC_PATH=%GH_HOME%\jgac\vmw4j2ee_110\
set RUNTIME_CLASSPATH=%JGAC_PATH%mscorlib.jar;%JGAC_PATH%System.jar;%JGAC_PATH%System.Xml.jar;%JGAC_PATH%System.Drawing.jar;%JGAC_PATH%J2SE.Helpers.jar;%JGAC_PATH%jai_imageio.jar
set NUNIT_OPTIONS=/exclude=NotWorking
@@ -50,7 +43,7 @@ set NET_OUTPUT_XML=%OUTPUT_FILE_PREFIX%.Net.xml
set GH_OUTPUT_XML=%OUTPUT_FILE_PREFIX%.GH.xml
set NUNIT_PATH=%BACK_TO_ROOT_DIR%..\..\nunit20\
set NUNIT_CLASSPATH=%NUNIT_PATH%nunit-console\bin\%PROJECT_J2EE_CONFIGURATION%\nunit.framework.jar;%NUNIT_PATH%nunit-console\bin\%PROJECT_J2EE_CONFIGURATION%\nunit.util.jar;%NUNIT_PATH%nunit-console\bin\%PROJECT_J2EE_CONFIGURATION%\nunit.core.jar;%NUNIT_PATH%nunit-console\bin\%PROJECT_J2EE_CONFIGURATION%\nunit-console.jar
set NUNIT_CLASSPATH=%NUNIT_PATH%nunit-console\bin\Debug_Java\nunit.framework.jar;%NUNIT_PATH%nunit-console\bin\Debug_Java\nunit.util.jar;%NUNIT_PATH%nunit-console\bin\Debug_Java\nunit.core.jar;%NUNIT_PATH%nunit-console\bin\Debug_Java\nunit-console.jar
set CLASSPATH="%RUNTIME_CLASSPATH%;%NUNIT_CLASSPATH%"
@@ -58,23 +51,9 @@ REM ********************************************************
@echo Building .Net solution...
REM ********************************************************
REM devenv Test\DrawingTest\System.Drawing.Test.dotnet.sln /%BUILD_OPTION% Debug >%RUNNING_FIXTURE%_build.log.txt 2<&1
msbuild %TEST_NET_SOLUTION% /t:%BUILD_OPTION% /p:Configuration=%PROJECT_NET_CONFIGURATION% >>%RUNNING_FIXTURE%_build.log.txt 2<&1
IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
if "%NUNIT_BUILD%" == "DONE" goto NUNITSKIP
REM ********************************************************
@echo Building NUnit solution...
REM ********************************************************
REM devenv ..\..\nunit20\nunit.java.sln /%BUILD_OPTION% Debug_Java >>%RUNNING_FIXTURE%_build.log.txt 2<&1
msbuild ..\..\nunit20\nunit20.java.sln /t:%BUILD_OPTION% /p:Configuration=%PROJECT_J2EE_CONFIGURATION% >>%RUNNING_FIXTURE%_build.log.txt 2<&1
IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
devenv Test\DrawingTest\System.Drawing.Test.dotnet.sln /%BUILD_OPTION% Debug >%RUNNING_FIXTURE%_build.log.txt 2<&1
goto NUNITREADY
@@ -90,8 +69,15 @@ REM ********************************************************
@echo Building GH solution...
REM ********************************************************
REM devenv Test\DrawingTest\System.Drawing.Test.sln /%BUILD_OPTION% Debug_Java >>%RUNNING_FIXTURE%_build.log.txt 2<&1
msbuild %TEST_J2EE_SOLUTION% /t:%BUILD_OPTION% /p:Configuration=%PROJECT_J2EE_CONFIGURATION% >>%RUNNING_FIXTURE%_build.log.txt 2<&1
devenv Test\DrawingTest\System.Drawing.Test.sln /%BUILD_OPTION% Debug_Java >>%RUNNING_FIXTURE%_build.log.txt 2<&1
IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
REM ********************************************************
@echo Building NUnit solution...
REM ********************************************************
devenv ..\..\nunit20\nunit.java.sln /%BUILD_OPTION% Debug_Java >>%RUNNING_FIXTURE%_build.log.txt 2<&1
IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
@@ -112,14 +98,14 @@ if not exist Exocortex.DSP.v1.dll (
if not exist DrawingTest.dll (
copy %BACK_TO_ROOT_DIR%Test\DrawingTest\Test\DrawingTest.dll . )
if not exist %TEST_NET_ASSEMBLY% (
copy %BACK_TO_ROOT_DIR%Test\DrawingTest\Test\%TEST_NET_ASSEMBLY% . )
if not exist Test.dotnet.dll (
copy %BACK_TO_ROOT_DIR%Test\DrawingTest\Test\Test.dotnet.dll . )
copy "%NUNIT_PATH%nunit-console\bin\%PROJECT_J2EE_CONFIGURATION%\nunit-console.exe" .
copy "%NUNIT_PATH%nunit-console\bin\%PROJECT_J2EE_CONFIGURATION%\nunit.util.dll" .
copy "%NUNIT_PATH%nunit-console\bin\%PROJECT_J2EE_CONFIGURATION%\nunit.core.dll" .
copy "%NUNIT_PATH%nunit-console\bin\%PROJECT_J2EE_CONFIGURATION%\nunit.framework.dll" .
%NUNIT_CONSOLE_PATH%\nunit-console.exe /fixture:%RUNNING_FIXTURE% %TEST_NET_ASSEMBLY% %NUNIT_OPTIONS% /xml=%NET_OUTPUT_XML% >%RUNNING_FIXTURE%_run.log.txt 2<&1
copy "%NUNIT_PATH%nunit-console\bin\Debug_Java\nunit-console.exe" .
copy "%NUNIT_PATH%nunit-console\bin\Debug_Java\nunit.util.dll" .
copy "%NUNIT_PATH%nunit-console\bin\Debug_Java\nunit.core.dll" .
copy "%NUNIT_PATH%nunit-console\bin\Debug_Java\nunit.framework.dll" .
nunit-console.exe /fixture:%RUNNING_FIXTURE% Test.dotnet.dll %NUNIT_OPTIONS% /xml=%NET_OUTPUT_XML% >%RUNNING_FIXTURE%_run.log.txt 2<&1
REM ********************************************************
@@ -130,13 +116,13 @@ REM ********************************************************
@echo Running fixture "%RUNNING_FIXTURE%"
REM ********************************************************
copy %BACK_TO_ROOT_DIR%Test\DrawingTest\Test\bin\%PROJECT_J2EE_CONFIGURATION%\Exocortex.DSP.v1.jar .
copy %BACK_TO_ROOT_DIR%Test\DrawingTest\Test\bin\%PROJECT_J2EE_CONFIGURATION%\DrawingTest.jar .
copy %BACK_TO_ROOT_DIR%Test\DrawingTest\Test\bin\%PROJECT_J2EE_CONFIGURATION%\%TEST_J2EE_ASSEMBLY% .
copy %BACK_TO_ROOT_DIR%Test\DrawingTest\Test\bin\Debug_Java\Exocortex.DSP.v1.jar .
copy %BACK_TO_ROOT_DIR%Test\DrawingTest\Test\bin\Debug_Java\DrawingTest.jar .
copy %BACK_TO_ROOT_DIR%Test\DrawingTest\Test\bin\Debug_Java\Test.jar .
REM @echo on
"%JAVA_HOME%\bin\java" -Xmx1024M -cp %CLASSPATH% NUnit.Console.ConsoleUi %TEST_J2EE_ASSEMBLY% /fixture=%RUNNING_FIXTURE% %NUNIT_OPTIONS% /xml=%GH_OUTPUT_XML% >>%RUNNING_FIXTURE%_run.log.txt 2<&1
"%JAVA_HOME%\bin\java" -Xmx1024M -cp %CLASSPATH% NUnit.Console.ConsoleUi Test.jar /fixture=%RUNNING_FIXTURE% %NUNIT_OPTIONS% /xml=%GH_OUTPUT_XML% >>%RUNNING_FIXTURE%_run.log.txt 2<&1
REM @echo off
if "%RUNNING_DIR%" NEQ "" (
@@ -148,12 +134,11 @@ REM ********************************************************
@echo Build XmlTool
REM ********************************************************
set XML_TOOL_PATH=..\..\tools\mono-xmltool
REM devenv %XML_TOOL_PATH%\XmlTool.sln /%BUILD_OPTION% Debug_Java >>%RUNNING_FIXTURE%_build.log.txt 2<&1
msbuild %XML_TOOL_PATH%\XmlTool20.vmwcsproj /t:%BUILD_OPTION% /p:Configuration=%PROJECT_J2EE_CONFIGURATION% >>%RUNNING_FIXTURE%_build.log.txt 2<&1
devenv %XML_TOOL_PATH%\XmlTool.sln /%BUILD_OPTION% Debug_Java >>%RUNNING_FIXTURE%_build.log.txt 2<&1
IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
copy %XML_TOOL_PATH%\bin\%PROJECT_J2EE_CONFIGURATION%\xmltool.exe .
copy %XML_TOOL_PATH%\bin\Debug_Java\xmltool.exe .
copy %XML_TOOL_PATH%\nunit_transform.xslt .
REM ********************************************************
@@ -167,7 +152,7 @@ xmltool.exe --transform nunit_transform.xslt %GH_OUTPUT_XML%
GOTO END
:ENVIRONMENT_EXCEPTION
@echo This test requires environment variable VMW_HOME to be defined
@echo This test requires environment variables JAVA_HOME and GH_HOME to be defined
GOTO END
:BUILD_EXCEPTION
@@ -1,26 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "System.Runtime.Remoting_2_0", "System.Runtime.Remoting_2_0.vmwcsproj", "{C4523363-42B4-486B-9422-B52B7D4CA3CF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Java|Any CPU = Debug_Java|Any CPU
Debug_Java20|Any CPU = Debug_Java20|Any CPU
Release_Java|Any CPU = Release_Java|Any CPU
Release_Java20|Any CPU = Release_Java20|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C4523363-42B4-486B-9422-B52B7D4CA3CF}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU
{C4523363-42B4-486B-9422-B52B7D4CA3CF}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU
{C4523363-42B4-486B-9422-B52B7D4CA3CF}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU
{C4523363-42B4-486B-9422-B52B7D4CA3CF}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU
{C4523363-42B4-486B-9422-B52B7D4CA3CF}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU
{C4523363-42B4-486B-9422-B52B7D4CA3CF}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU
{C4523363-42B4-486B-9422-B52B7D4CA3CF}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU
{C4523363-42B4-486B-9422-B52B7D4CA3CF}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Loaded 100 of 209 files, more files were not shown because too many files have changed in this diff. Show more