在webapp的控制器中,当给定条件为真时,我将重定向到其他页面(xyz.jpsx).
现在,在Junit测试中,我想强制执行重定向,但重定向也指向实际存在的jsp.
在Junit内部,我找不到从WEB-INF内部读取文件的方法.我不想硬编码完整路径,因为解决方案不太便携.
我完全理解WEB-INF中的文件不在类路径中,但可能有办法访问这些文件.寻找可在我的集成服务器上运行的便携式解决方案.
这是我尝试在 ubuntu 14.04 上使用 gcc 编译器编译的程序的一部分。
#include<stdio.h>
#include<string.h>
main() {
int i;
char str[50], pat[3];
char sep;
printf("Enter the sting to seperate\n ");
scanf("%s", str);
fpurge(stdin);
printf("Enter the patern in Numbers to seperate Example : 1 2 3\n");
//__fpurge(stdin);
scanf("%s", pat);
fpurge(stdin);
printf("Enter the seperator Example: ; or enter ,space");
scanf("%c", &sep);
}
Run Code Online (Sandbox Code Playgroud)
这是错误:
/tmp/cc0bHLkO.o: In function `main':
str_sepert.c:(.text+0x4d): undefined reference to `fpurge'
str_sepert.c:(.text+0x95): undefined reference to `fpurge'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud) 我编写了这个程序,为用户提供所有急性三角形解决方案,当它们给出最小值和最大值时.它正常工作,除了似乎解决方案不包括循环的第一次迭代(例如,min = 1和max = 45,(1,1,1)不包括在解决方案中).怎么解决这个问题?我认为问题在于我的while循环的a值,但是当我将其更改为for循环时,问题仍然存在.我怎么能包含这些第一个值?
if (c >= dmin) {
c = dmin;
do {
++c;
for (b = dmin; b < dmax; b++) {
a = dmin;
while (a < dmax) {
a = a + 1;
if (a * a + b * b - c == c * c) {
if (((a + b) > c) && ((b + c) > a) && ((c + a) > b)) {
printf("(%d, %d, %d)", a, b, c);
}
} …Run Code Online (Sandbox Code Playgroud) c ×2
classpath ×1
do-while ×1
for-loop ×1
java ×1
junit ×1
string ×1
ubuntu-14.04 ×1
while-loop ×1