Search Results

Search found 369 results on 15 pages for 'assertion'.

Page 10/15 | < Previous Page | 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Why is there no assertError() function in FlexUnit?

    - by lorennorman
    It seems that most XUnit testing frameworks provide assertions for the times when you want to assert that a given operation will thrown an exception (or an Error in AS3 parlance.) Is there some "standard" way of doing this that I am overlooking, which would explain the absence of an assertError() assertion included with FlexUnit? I know HOW to implement such a thing, and I will probably add it to my FlexUnit (go open source!), but it seems like such a glaring omission that I'm left wondering if I'm just doing it wrong. Anyone have thoughts on this?

    Read the article

  • dynamically created datagridview columns not accessible unless added to a form...why?

    - by deostroll
    We simply created a DataGridView control dynamically and bound it to a DataTable. We were tying to style certain columns. But, when we tried to access the columns we got a null reference. On further investigation we found that if we add the DataGridView control to the main form, and then try to access its columns, it works fine!!! Code which throws error: DataGridView gv = new DataGridView(); gv.DataSource = GetDataTable(); //binding it to datatable Debug.Assert(gv.Columns == null); Code which works fine: DataGridView gv = new DataGridView(); gv.DataSource = GetDataTable(); //binding it to datatable this.Controls.Add(gv); //adding to form Debug.Assert(gv.Columns == null); //the assertion fails! Why is this behaviour so? Is there a workaround for this?

    Read the article

  • Anyone get mach_inject working on snow leopard?

    - by overboming
    Project is now on github and here is the link to my issue I successfully compiled the whole thing and able to run rejector and rejectee separately. But the injector will crash the injectee when injecting code to the target process. mach_inject_test_injectee.app 's standard output: mach error on bundle load (os/kern) successful mach error on bundle load (os/kern) successful mach error on bundle load (os/kern) successful mach error on bundle load (os/kern) successful mach error on bundle load (os/kern) successful FS rep /Users/Malic/Documents/Code/c/mach_star/mach_inject_test/build/Development/mach_inject_test_injector.app/Contents/Resources/mach_inject_test_injected.bundle/Contents/MacOS/mach_inject_test_injected LOADDDDDDDDDD! Assertion failed: (0), function +[injected_PrincipalClass load], file /Users/Malic/Documents/Code/c/mach_star/mach_inject_test/injected-PrincipalClass.m, line 25. Abort trap mach_inject_test_injector 's standard output injecting into pid 3680 injecting pid mach_inject failing.. (os/kern) successful mach inject done? 0 hi It seems from the output the injector is not notified from the injectee, any ideas? thanks.

    Read the article

  • How to browse a Matrix returned by the OpenCV2.0 Canny() function ?

    - by user290613
    Hi all, I've been browsing the web to get an answer but no way to put my hand on it. I call the Canny function that fills me a matrix Canny(src, dst, 220, 299, 3 ); the dst variable is now a Matrix that is according to me of type CV_8UC1, 8bit, 1channel. Now I would like to browse this matrix according to rows and columns, so there was a trick that I've seen on stackoverflow dst.at<uchar*>(3, 5) In my case it crashes. (Assertion Failed, unknown function, cxmat.hpp line 450) My matrix information are myMatrix.width() = 181 myMatrix.height() = 65 One more thing, when I do std::cout << dst.depth() << std::endl; It always retrieves me 0 and not 8 (which I guess Im suppose to get) Thank you very much for all who will reply,

    Read the article

  • Nhibernate not tracking changes

    - by Lavinski
    I'm using nhibernate and it appears that changes to my new object are not persisted. After creating and saving an object I then modify it and commit the transaction. However none of the modifications are saved. The strange thing is this code was working previously and I have no idea what could cause this. Nothing was changed that's obviously related.. As an attempted work around I saved the object later in the procedure after all the changes where made however I was greeted with an Assertion Failure collection [] was not processed by flush. Any ideas?

    Read the article

  • Problem with CommandFinder class...

    - by Patrick
    and I'm not sure why... Hello Everbody! I'm trying to make my first steps with SWTBot. I'm trying to test an Eclipse RCP Application. In one test i'm trying to call a command to save a dirty editor. But an assertion after the call, tells me that the editor is still dirty. An the data in the dirty editor is not showing up in the database. On the other hand, i'm not getting an Exception when calling the command... new CommandFinder().findCommand(CoreMatchers.equalTo(COMMANDNAME_SAVE)).get(0).click(); Has anyone any insperation for me, where i made a mistake?

    Read the article

  • Debugging runtime error "Terminating app due to uncaught exception 'NSInternalInconsistencyException

    - by Bill
    I'm going through the Beginning iPhone Development book & stuck in chapter 9. I've spent a few hours trying to debug this error w/o avail: 2010-05-01 19:27:51.361 Nav2[4113:20b] *** Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit/UIKit-984.38/UITableView.m:4709 2010-05-01 19:27:51.362 Nav2[4113:20b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:' 2010-05-01 19:27:51.364 Nav2[4113:20b] Stack: ( ... ) I'm not looking for help w/ the book, but tips for how to debug this error? Can I pin down which of my cellForRowAtIndexPath methods is the problem? And how to inspect the type? Or other things should I look at?

    Read the article

  • Need a formula for calculating the tax portion of a total amount.

    - by pawz
    In Australia we have to advertise products with tax already added, so rather than say a product is $10 + $1 GST = $11, we normally work backwards and say "ok, total is $10, how much of that is GST ?" For example, for a $10 total, you do 10 * (1 /11) = 0.91, which is the tax component of the $10 total. My problem is I need calculate a formula for working out the taxable component when the tax rate is a variable. So far I've made this calculation although I'm not sure how correct an assertion it is: 10 * (1 / x) = 0.09 * (1 / y) where y = 10, x = 11 Basically i want to work out x on the left hand side when I know that the tax rate is 0.05 for example, which will give me a formula that I can use to calculate the taxable component of an total figure. I want a function into which I can plug in the total price and the tax rate, and get back the taxable component of the total price. I'd really appreciate the help with this as it really makes my head hurt ! :")

    Read the article

  • Doing extra initialisations on a MFC Dialog in Visual Studio 2008 Pro

    - by theunanonim
    How do I make extra initializations on a modal dialog before calling DoModal(); ? I have a main Dialog (the one that is created automatically when I select new MFC Application in Visual Studio 2008 Professional). When I click a button on this dialog I want to open another dialog and set a CString value into a CEdit control. my code: ... void OnClickedButtonX(){ SecondDialogClass Dlg2; Dlg2.asocVar2Cedit.SetWindowTextW(L"my text"); Dlg2.DoModal(); } //asocVar2Cedit is the associeted control variable to the //CEdit control on the second Dialog (Right Click > Add Variable.. in VSC++) ... this code generates a "Debug Assertion" error in winocc... Any ideas ? Thank you in advance.

    Read the article

  • How to prevent Debug.Assert(...) to show a modal dialog

    - by Martin
    I have a couple of libraries which use Debug.Assert(...). I think that the Debug.Assert(...) are fine and I still want them to execute, but I don't want them to block the execution of my application. Ideally, I would only like them to be logged somewhere. Given that I can't change the code of the libraries (and that I still want to compile in debug and run the assertion), how do I prevent Debug.Assert(...) to show a modal dialog? Thanks!

    Read the article

  • "dynamic" keyword and JSON data

    - by Peter Perhác
    An action method in my ASP.NET MVC2 application returns a JsonResult object and in my unit test I would like to check that the returned JSON object indeed contains the expected values. I tried this: 1. dynamic json = ((JsonResult)myActionResult).Data; 2. Assert.AreEqual(JsonMessagesHelper.ErrorLevel.ERROR.ToString(), json.ErrorLevel); But I get a RuntimeBinderException "'object' does not contain a definition for 'ErrorLevel'". However, when I place a breakpoint on line 2 and inspect the json dynamic variable (see picture below), it obviously does contain the ErrorLevel string and it has the expected value, so if the runtime binder wasn't playing funny the test would pass. What am I not getting? What am I doing wrong and how can I fix this? How can I make the assertion pass?

    Read the article

  • how to test if a string is a valid UTF16 string?

    - by superb
    I am using mongodb and javascript to do some string processing. Now I got some error like: Sun May 23 07:42:20 Assertion failure JS_EncodeCharacters( _context , s , srclen , dst , &len) scripting/engine_spidermonkey.cpp 152 0x80f4f7e 0x80f8794 0x811525b 0x811a953 0x8119fc4 0x8111bc5 0x81b408e 0x81c4ee7 0x81b4a10 0x817a881 0x817a7d8 0x817a6e2 0x811e1bb 0x80a777b 0x80a8f8a 0xb7cb2455 0x80a37a1 mongodb-linux-i686-1.4.2/bin/mongo(_ZN5mongo12sayDbContextEPKc+0xfe) [0x80f4f7e] After doing some google, I find that JS_EncodeCharacters return false if the input is not a valid UTF16 string. (if spidermonkey is build with UTF-8 enabled) So I was wondering how to test if the input string if a proper UTF16 string? so I can skip such kind of string to avoid problem ... Thanks

    Read the article

  • How can I add Copperplate Gothic Bold font in my iPhone program ?

    - by srikanth rongali
    Hi, I need to display some text in cocos2d layer. I added UITextView to it. I added the text in the text View. But, for setting the font by ( UIFont class), I could not do it. I saw the list of supported fonts for iPhone, In that list Copperplate Gothic Bold is not there. I downloaded it from net. It is working good for CCLabel and CCFontMenuItem. How can I make it work for UILabel ? * Assertion failure in -[UILabel setFont:], /SourceCache/UIKit/UIKit-963.10/UILabel.m:445 2010-05-19 16:07:43.282 testOfGameScreen[1155:207] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: font != nil' 2010-05-19 16:07:43.285 testOfGameScreen[1155:207] Stack: ( I am getting the above error when using UIFont with Copperplate Gothic Bold Thank you.

    Read the article

  • Using FlexMock in a rails functional test.

    - by dagda1
    Hi, I have the following index action: class ExpensesController < ApplicationController def index() @expenses = Expense.all end end I want to mock the call to all in a functional test. I am using flexmock and have written the following test: require 'test_helper' require 'flexmock' require 'flexmock/test_unit' class ExpensesControllerTest < ActionController::TestCase test "should render index" do flexmock(Expense).should_receive(:all).and_return([]) get :index assert_response :success assert_template :index assert_equal [], assigns(:presentations) end end The problem is the the last assertion fais with the following error message: <[] expected but was nil I am confused what I am doing wrong. Should this not work? Cheers Paul

    Read the article

  • How do I safely destroy a dialog window of a wxPython application?

    - by Akira
    I created a wxPython application which shows some messages on a dialog window. The dialog window is needed to be force-destroyed by the application before I click the dialog OK button. I used wx.lib.delayedresult to make the destroy call. My code is: import wx dlg=wx.MessageDialog(somewindow,'somemessage') from wx.lib.delayedresult import startWorker def _c(d): dlg.EndModal(0) dlg.Destroy() def _w(): import time time.sleep(1.0) startWorker(_c,_w) dlg.ShowModal() This can do what I desire to do while I got a error message below: (python:15150): Gtk-CRITICAL **: gtk_widget_destroy: assertion `GTK_IS_WIDGET (widget)' failed How do I "safely" destroy a dialog without clicking the dialog button?

    Read the article

  • callin' c from lua crashs while reallocating

    - by mkind
    hi folks, i got a crazy error within that for-loop matr=realloc(matr, newmax*sizeof(matr*)); for (i=0; i<newmax; i++){ matr[i]=realloc(matr[i], newmax*sizeof(int)); } matr is a multi-dimension array: int **matr. i need to resize column and row. first line resizes column and the for-loop resizes every row. it worked fine in c. now im working on a library for lua and it crashs here. compilin' works fine as well. but calling from lua crashs with lua: malloc.c:3552: mremap_chunk: Assertion `((size + offset) & (mp_.pagesize-1)) == 0' failed. i have no damn idea since it's working fine using it in c.

    Read the article

  • How does c# type safety affect the garbage collection?

    - by Indeera
    I'm dealing with code that handles large buffers ( 100MB) and manipulation of these is done in unsafe blocks. I'd like to refactor these to avoid unsafe code. I'm wondering about the likely memory performance gains (positive/negative/neutral) before I embark on that. I assert that if the compiler can verify types, it could possibly generate better code and that could also mean good GC performance. Is this a valid assertion? What is your experience? Thanks.

    Read the article

  • Unit testing a controller in ASP.NET MVC 3

    - by Abdullah Al- Mansur
    public Double Invert(Double? id) { return (Double)(id / id); } I have done this for this test but fails please can anyone help with this cos just started with unit testing /* HINT: Remember that you are passing Invert an *integer* so * the value of 1 / input is calculated using integer arithmetic. * */ //Arrange var controller = new UrlParameterController(); int input = 7; Double expected = 0.143d; Double marginOfError = 0.001d; //Act var result = controller.Invert(input); //Assert Assert.AreEqual(expected, result, marginOfError); /* NOTE This time we use a different Assert.AreEqual() method, which * checks whether or not two Double values are within a specified * distance of one another. This is a good way to deal with rounding * errors from floating point arithmetic. Without the marginOfError * parameter the assertion fails. * */

    Read the article

  • Doing extra initialisations on a MFC Dialog in Visual Studio C++ 2008 Pro

    - by theunanonim
    How do I make extra initializations on a modal dialog before calling DoModal(); ? The whole application is created using VS wizards. I have a main Dialog (the one that is created automatically when I select new MFC Application in Visual Studio 2008 Professional). When I click a button on this dialog I want to open another dialog and set a CString value into a CEdit control. my code: ... void MainDlg::OnClickedButtonX(){ SecondDialogClass Dlg2; Dlg2.asocVar2Cedit.SetWindowTextW(L"my text"); Dlg2.DoModal(); } //asocVar2Cedit is the associeted control variable to the //CEdit control on the second Dialog (Right Click > Add Variable.. in VSC++) ... this code generates at runtime a "Debug Assertion" error in winocc... Any ideas ? Thank you in advance.

    Read the article

  • How to create a GtkImage from a Cairo context?

    - by Zurbo82
    I got a paint function that works using a Cairo context and the end result should be a GtkImage (without intermediate image creation). I tried to use the gdk_cairo_create function but this code: ... GdkPixbuf *pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 22, 22); GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf); GdkDrawable *drawable = image->window; cairo_t *ctx = gdk_cairo_create (drawable); my_cairo_paint_function (ctx); ... fails with: Gdk-CRITICAL **: IA__gdk_cairo_create: assertion `GDK_IS_DRAWABLE (drawable)' failed Same with a simple: #include <gtk/gtk.h> #include <cairo.h> int main (int argc, char *argv[]) { gtk_init(&argc, &argv); cairo_t *ctx = gdk_cairo_create (gtk_widget_get_window (gtk_image_new_from_file ("foobar.png"))); gtk_main(); return 0; } I don't understand why this fails. Any help is appreciated!

    Read the article

  • How to pass around event as parameter in c#

    - by Jerry Liu
    Am writing unit test for a multi-threading application, where I need to wait until a specific event triggered so that I know the asyn operation is done. E.g. When I call repository.add(something), I wait for event AfterChange before doing any assertion. So I write a util function to do that. public static void SyncAction(EventHandler event_, Action action_) { var signal = new object(); EventHandler callback = null; callback = new EventHandler((s, e) => { lock (signal) { Monitor.Pulse(signal); } event_ -= callback; }); event_ += callback; lock (signal) { action_(); Assert.IsTrue(Monitor.Wait(signal, 10000)); } } However, the compiler prevents from passing event out of the class. Is there a way to achieve that?

    Read the article

  • Is it possible to use the ScalaTest BDD syntax in a JUnit environment?

    - by ebruchez
    I would like to describe tests in BDD style e.g. with FlatSpec but keep JUnit as a test runner. The ScalaTest Quick Start does not seem to show any example of this: http://www.scalatest.org/getting_started_with_junit_4 I first tried naively to write tests within @Test methods, but that doesn't work and the assertion is never tested: @Test def foobarBDDStyle { "The first name control" must "be valid" in { assert(isValid("name·1")) } // etc. } Is there any way to achieve this? It would be even better if regular tests can be mixed and matched with BDD-style tests.

    Read the article

  • Debug.Assert seems not to work in Mono

    - by Jan-Willem
    Consider the following C# program: using System; using System.Diagnostics; namespace Test { class MainClass { public static void Main (string[] args) { Debug.Assert(false); Debug.Fail("fail!"); Console.WriteLine ("Hello World!"); } } } When compiling this using: dmcs -debug -d:DEBUG Main.cs and then running it with: mono --debug Main.exe the assertion and fail seem to be ignored. The output is just: Hello World! I checked other related questions on StackOverflow, but I could not find a solution. In particular the solution give in Mono - Debug.Assert does not work does not work. (UPDATE: the update solution does work, see below comments.) I use Mono 2.1.5-1 on Ubuntu 11.10.

    Read the article

  • callin' c from lua crashes while reallocating

    - by mkind
    hi folks, i got a crazy error within that for-loop matr=realloc(matr, newmax*sizeof(matr*)); for (i=0; i<newmax; i++){ matr[i]=realloc(matr[i], newmax*sizeof(int)); } matr is a multi-dimension array: int **matr. i need to resize column and row. first line resizes column and the for-loop resizes every row. it worked fine in c. now im working on a library for lua and it crashs here. compilin' works fine as well. but calling from lua crashs with lua: malloc.c:3552: mremap_chunk: Assertion `((size + offset) & (mp_.pagesize-1)) == 0' failed. i have no damn idea since it's working fine using it in c.

    Read the article

  • Reranging a uitableview

    - by Nicolay
    Hallo @ All I ran into the same problem as desciped in http://stackoverflow.com/questions/1884491/crashing-while-trying-to-move-uitableview-rows! All I want to do is on specific reranging operations insert a new cell or delet the selected one! Sometimes I get a * Assertion failure in -[_UITableViewUpdateSupport _setupAnimationForReorderingRow], /SourceCache/UIKit/UIKit-963.10/UITableViewSupport.m:295 Attempt to create two animations for cell exception and when I want to reload my data by calling [self.tableView reloadData] I get a * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)' This is quiet anoying! Is there anybody out there who knows how to handle this problem? Please help me!

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15  | Next Page >