Search Results

Search found 24915 results on 997 pages for 'ordered test'.

Page 65/997 | < Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >

  • Test assertions for tuples with floats

    - by Space_C0wb0y
    I have a function that returns a tuple that, among others, contains a float value. Usually I use assertAlmostEquals to compare those, but this does not work with tuples. Also, the tuple contains other data-types as well. Currently I am asserting every element of the tuple individually, but that gets too much for a list of such tuples. Is there any good way to write assertions for such cases?

    Read the article

  • Jquery how to test if current hovered div is eq(x)

    - by j-man86
    Hi all! I am trying to create a jQuery hover function that will highlight a different section of the page depending on what number EQ (index position number) the div is. $('#photoContent div').hoverIntent(function () { if( $(this).filter(':lt(5)') ) { $('#photoSidebar').find('p:eq(0)').addClass('currentPhoto'); } if( $(this).filter(':gt(5)') ) { $('#photoSidebar').find('p:eq(1)').addClass('currentPhoto'); } }, function () { $('#photoSidebar').find('p').removeClass('currentPhoto'); }); The above code obviously does not work, but the concept/functionality is what I'm going for. Thanks for your help!

    Read the article

  • Unit Test Organization

    - by cam
    I'm using Nunit for unit testing, and added another project called "Unit Testing" to my current solution. I referenced Nunit, and changed the Namespace to the same namespace used in the main project. I can't seem to figure out how to get access to all the classes, files, etc in the main project. Is there something I have to do to link two projects?

    Read the article

  • Use preforker(ruby gem) with supervisor

    - by user1548832
    I also asked same question on stackoverflow.com http://stackoverflow.com/questions/13871169/use-preforkerruby-gem-with-supervisor But, superuser.com might much help to me. Can anyone amswer this? I want to run a server program using preforker ruby gem with supervisor. But error has occured. I wrote a following test program using preforker. #!/usr/bin/env ruby require 'rubygems' require 'preforker' Preforker.new(:app_name => 'test-preforker', :timeout => 60, :workers => 1) do |master| while master.wants_me_alive? do puts "hello" sleep 10 end end.run And a following supervisor config. [program:test-preforker] command=/home/tkono/tmp/test-preforker.rb stdout_logfile_maxbytes=1MB stderr_logfile_maxbytes=1MB stdout_logfile=/var/log/%(program_name)s.log stderr_logfile=/var/log/%(program_name)s.log autorestart=true Then, reload supervisor. # supervisorctl reload Restarted supervisord Here is the log file of supervisor. 2012-12-13 17:50:47,161 CRIT Supervisor running as root (no user in config file) 2012-12-13 17:50:47,163 WARN Included extra file "/etc/supervisor.d/test-preforker.ini" during parsing 2012-12-13 17:50:47,209 INFO RPC interface 'supervisor' initialized 2012-12-13 17:50:47,213 CRIT Server 'unix_http_server' running without any HTTP authentication checking 2012-12-13 17:50:47,215 INFO supervisord started with pid 12437 2012-12-13 17:50:48,231 INFO spawned: 'test-preforker' with pid 12440 2012-12-13 17:50:48,233 INFO exited: test-preforker (exit status 1; not expected) 2012-12-13 17:50:49,248 INFO spawned: 'test-preforker' with pid 12441 2012-12-13 17:50:49,261 INFO exited: test-preforker (exit status 1; not expected) 2012-12-13 17:50:51,267 INFO spawned: 'test-preforker' with pid 12442 2012-12-13 17:50:51,284 INFO exited: test-preforker (exit status 1; not expected) 2012-12-13 17:50:54,305 INFO spawned: 'test-preforker' with pid 12443 2012-12-13 17:50:54,308 INFO exited: test-preforker (exit status 1; not expected) 2012-12-13 17:50:55,311 INFO gave up: test-preforker entered FATAL state, too many start retries too quickly Please tell me what is wrong? A program using preforker cannot run with supervisor? preforker https://github.com/dcadenas/preforker supervisor http://supervisord.org/index.html

    Read the article

  • Fastest way to perform subset test operation on a large collection of sets with same domain

    - by niktech
    Assume we have trillions of sets stored somewhere. The domain for each of these sets is the same. It is also finite and discrete. So each set may be stored as a bit field (eg: 0000100111...) of a relatively short length (eg: 1024). That is, bit X in the bitfield indicates whether item X (of 1024 possible items) is included in the given set or not. Now, I want to devise a storage structure and an algorithm to efficiently answer the query: what sets in the data store have set Y as a subset. Set Y itself is not present in the data store and is specified at run time. Now the simplest way to solve this would be to AND the bitfield for set Y with bit fields of every set in the data store one by one, picking the ones whose AND result matches Y's bitfield. How can I speed this up? Is there a tree structure (index) or some smart algorithm that would allow me to perform this query without having to AND every stored set's bitfield? Are there databases that already support such operations on large collections of sets?

    Read the article

  • Automated test, build and deploy

    - by mike79
    I have visual studio team suite 2008. I was unable to meet the requirements to setup TFS, so I'm using TortoiseSvn and VisualSvn as my version contol in VSTS. I need the system setup to do the following: I neeed to be able to create and track workitems. When updates are made to the current project worked on in VSTS, the updates will be commited back to version control. Tests will be run to see that updates don't break the application. If there's a problem with the update it will be reported back to the developer. If there's no problem with the app, which is a clickonce application, it will automatically be built and deployed to an ftp server. I've never worked with version control, build servers, automated testing and continous intergration. I need to know what needs to be put in place for this type of system. I don't know which combination/stack I should be using: CC.net, TeamCity, Hudson, NAnt, NUnit, MsTest, Trac, BugTracker.net, Ndepend, VisualSvn Server, Perforce, Msdeploy, SCM. I want something that is free/opensource and relatively easy to setup and use. Please suggest a setup that will fit my needs. Any help appreciated

    Read the article

  • Test sorting through QTP

    - by onkar
    There is a java table in my application which has 1 column & 5 rows. Contents of rows are as below. These contents are arranged in descending order 172-18-zfs MKTLAB NFSVOL datastore1 datastore1(1) after clicking on column header it get sort in asceding order & order is like this datastore1(1) datastore1 NFSVOL MKTLAB 172-18-zfs Through QTP i want to check whether this sortig is correct or not. I have used sort() method of dictionary but it doesnt give expected result. It just sort according to alphabatical order. In expected sorting order 1st priority should be to small letter then to capital letter then to number.

    Read the article

  • android: test app on a real device

    - by Yang
    My client wants to dogfood my android app. They don't have eclipse and don't want to install it. It there a more convenient way to send my apk to them? Can I send it via email and let them open the attachment in mobile device? Will it start installing itself automatically?

    Read the article

  • iOS - Application logging test and production code

    - by Peter Warbo
    I am doing a bunch of logging when I'm testing my application which is useful for getting information about variable state and such. However I have read that you should use logging sparsely in production code (because it can potentially slow down your application). But my question is now: if my app is in production and people are using it, whenever a crash (god forbid) occurs, how will I be able to interpret the crash information if I have removed the logging statements? Then I suppose I will only have a stacktrace for me to interpret? Does this mean I should leave logging in production code only WHERE it's really essential for me to interpret what has happened? Also how will the logging statements relate to the crash reports? Will they be combined? I'm thinking of using Flurry as analytics and crash reports...

    Read the article

  • Best way to test instance methods without running __init__

    - by KenFar
    I've got a simple class that gets most of its arguments via init, which also runs a variety of private methods that do most of the work. Output is available either through access to object variables or public methods. Here's the problem - I'd like my unittest framework to directly call the private methods called by init with different data - without going through init. What's the best way to do this? So far, I've been refactoring these classes so that init does less and data is passed in separately. This makes testing easy, but I think the usability of the class suffers a little. EDIT: Example solution based on Ignacio's answer: import types class C(object): def __init__(self, number): new_number = self._foo(number) self._bar(new_number) def _foo(self, number): return number * 2 def _bar(self, number): print number * 10 #--- normal execution - should print 160: ------- MyC = C(8) #--- testing execution - should print 80 -------- MyC = object.__new__(C) MyC._bar(8)

    Read the article

  • Django test client gets 301 redirection when accessing url

    - by Michal Klich
    I am writing unittests for django views. I have observed that one of my views returns redirection code 301, which is not expected. Here is my views.py mentioned earlier. def index(request): return render(request, 'index.html', {'form': QueryForm()}) def query(request): if request.is_ajax(): form = QueryForm(request.POST) return HttpResponse('valid') Below is urls.py. urlpatterns = patterns('', url(r'^$', 'core.views.index'), url(r'^query/$', 'core.views.query') ) And unittest that will fail. def so_test(self): response = self.client.post('/') self.assertEquals(response.status_code, 200) response = self.client.post('/query', {}) self.assertEquals(response.status_code, 200) My question is: why there is status 301 returned?

    Read the article

  • NUnit Test Run Order

    - by Zaps
    Hi, By default nunit tests run alphabetically. Does anyone know of any way to set the execution order? Does an attribute exist for this? Any help would be greatly appreciated. Thanks Zaps

    Read the article

  • Factorial function - design and test.

    - by lukas
    I'm trying to nail down some interview questions, so I stared with a simple one. Design the factorial function. This function is a leaf (no dependencies - easly testable), so I made it static inside the helper class. public static class MathHelper { public static int Factorial(int n) { Debug.Assert(n >= 0); if (n < 0) { throw new ArgumentException("n cannot be lower that 0"); } Debug.Assert(n <= 12); if (n > 12) { throw new OverflowException("Overflow occurs above 12 factorial"); } //by definition if (n == 0) { return 1; } int factorialOfN = 1; for (int i = 1; i <= n; ++i) { //checked //{ factorialOfN *= i; //} } return factorialOfN; } } Testing: [TestMethod] [ExpectedException(typeof(OverflowException))] public void Overflow() { int temp = FactorialHelper.MathHelper.Factorial(40); } [TestMethod] public void ZeroTest() { int factorialOfZero = FactorialHelper.MathHelper.Factorial(0); Assert.AreEqual(1, factorialOfZero); } [TestMethod] public void FactorialOf5() { int factOf5 = FactorialHelper.MathHelper.Factorial(5); Assert.AreEqual(120,factOf5); } [TestMethod] [ExpectedException(typeof(ArgumentException))] public void NegativeTest() { int factOfMinus5 = FactorialHelper.MathHelper.Factorial(-5); } I have a few questions: Is it correct? (I hope so ;) ) Does it throw right exceptions? Should I use checked context or this trick ( n 12 ) is ok? Is it better to use uint istead of checking for negative values? Future improving: Overload for long, decimal, BigInteger or maybe generic method? Thank you

    Read the article

  • How to test Text Search accuracy and efficiency?

    - by DEN
    I have created a web application. One of the feature is text search which perform the boolean operator ( NOT, AND, OR) as well. However, I have no idea on calculating the search's accuracy and efficiency. For example: 1 . Probe identification system for a measurement instrument 2 . Pulse-based impedance measurement instrument 3 . Millimeter with filtered measurement mode when the user key in will return the result as below input :measurement instrument Result: 1,2 input : measurement OR instrument NOT milimeter Result: 1,2,3 so, i have no idea on what issue and what algorithm to calculate on the accuracy and efficiency of the text search.. anyone have any idea on that?

    Read the article

  • Multiple choice test GUI with serialization of Q&A

    - by Bobby
    I'm working on a project for school in Java programming. I need to design a GUI that will take in questions and answers and store them in a file. It should be able to contain an unlimited number of questions. We have covered binary I/O. How do I write the input they give to a file? How would I go about having them add multiple questions from this GUI? package multiplechoice; import java.awt.*; import javax.swing.*; public class MultipleChoice extends JFrame { public MultipleChoice() { /* * Setting Layout */ setLayout(new GridLayout(10,10)); /* * First Question */ add(new JLabel("What is the category of the question?: ")); JTextField category = new JTextField(); add(category); add(new JLabel("Please enter the question you wish to ask: ")); JTextField question = new JTextField(); add(question); add(new JLabel("Please enter the correct answer: ")); JTextField correctAnswer = new JTextField(); add(correctAnswer); add(new JLabel("Please enter a reccomended answer to display: ")); JTextField reccomendedAnswer = new JTextField(); add(reccomendedAnswer); add(new JLabel("Please enter a choice for multiple choice option " + "A")); JTextField A = new JTextField(); add(A); add(new JLabel("Please enter a choice for multiple choice option " + "B")); JTextField B = new JTextField(); add(B); add(new JLabel("Please enter a choice for multiple choice option " + "C")); JTextField C = new JTextField(); add(C); add(new JLabel("Please enter a choice for multiple choice option " + "D")); JTextField D = new JTextField(); add(D); add(new JButton("Compile Questions")); add(new JButton("Next Question")); } public static void main(String[] args) { /* * Creating JFrame to contain questions */ FinalProject frame = new FinalProject(); // FileOutputStream output = new FileOutputStream("Questions.dat"); JPanel panel = new JPanel(); // button.setLayout(); // frame.add(panel); panel.setSize(100,100); // button.setPreferredSize(new Dimension(100,100)); frame.setTitle("FinalProject"); frame.setSize(600, 400); frame.setLocationRelativeTo(null); // Center the frame frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }

    Read the article

  • handling javaScript alerts when running a selenium test?

    - by Mo
    Hi I am am running some selenium tests(ruby) on my web page and as i enter an invalid characters in to a text box i have the JavaScript throw a alert like so if(isNaN($(this).val()) || Number($(this).val().valueOf() <=0)){ alert("Please Enter A Number"); } how can i handle this alert when its made and close the pop up? i tried to use the wait_for_pop_up() and close() but i think that's only for browser pop up's and not JavaScript alerts. any ideas? thanks

    Read the article

  • Test/expand my email regex

    - by Ross
    I'm really not confident with Regex, I know some basic syntax but not enough to keep me happy. I'm trying to build a regular expression to check if an email is valid. So far here's what I've got: [A-Za-z0-9._-]+@[A-Za-z0-9]+.[A-Za-z.]+ It needs to take account of periods in the username/domain and I think it works with multiple TLDs (e.g. co.uk). I'm working with the preg engine in PHP so it needs to work with that. Thanks if you can help!

    Read the article

  • Test the sequentiality of a column with a single SQL query

    - by LauriE
    Hey, I have a table that contains sets of sequential datasets, like that: ID set_ID some_column n 1 'set-1' 'aaaaaaaaaa' 1 2 'set-1' 'bbbbbbbbbb' 2 3 'set-1' 'cccccccccc' 3 4 'set-2' 'dddddddddd' 1 5 'set-2' 'eeeeeeeeee' 2 6 'set-3' 'ffffffffff' 2 7 'set-3' 'gggggggggg' 1 At the end of a transaction that makes several types of modifications to those rows, I would like to ensure that within a single set, all the values of "n" are still sequential (rollback otherwise). They do not need to be in the same order according to the PK, just sequential, like 1-2-3 or 3-1-2, but not like 1-3-4. Due to the fact that there might be thousands of rows within a single set I would prefer to do it in the db to avoid the overhead of fetching the data just for verification after making some small changes. Also there is the issue of concurrency. The way locking in InnoDB (repeatable read) works (as I understand) is that if I have an index on "n" then InnoDB also locks the "gaps" between values. If I combine set_ID and n to a single index, would that eliminate the problem of phantom rows appearing? Looks to me like a common problem. Any brilliant ideas? Thanks! Note: using MySQL + InnoDB

    Read the article

< Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >